General Discussion - VEHICLE PHYSICS !!!

Let me know what are your thoughts on this it was made in Unity 3D:

Early last year i was workin on a system similar to this ey !!!



Judging from the looks of it it seems like BGE’s abit behind here ey?

Fred/K.S

well, yes, blender is behind a lot of engines…in a lot of ways :slight_smile: but each engine is the same in that you get out of it what you put into it.
But generally speaking without a lot of self written functions, blender is far behind unity…not to mention drawing code.
this is not really a debate or anything unknown to the users…

I still prefer BGE though, I tend to change engines based on the amount of time I have and what project I am doing…if the future of BGE gets better I will stick around…otherwise I will change…it’s really no big deal…but I would seriously miss the work flow.

That’s why I don’t like engines that give you stuff on a silver platter. Everything is already made and ready for you to use. I like making things work from the ground up and enjoying the process of making things myself. I would not say that this is not achievable in BGE/UPBGE. It’s all just a matter of finding a nice looking car model, nice sounds, nice textures and materials, and some excellent programming to bind it all together.

I bet if you weren’t making your speed racer game on an integrated graphics card, you could achieve this level of realism.

1 Like

Things from the video that are hard to do on the BGE:

  • the UI.

Everything else might be hard (car/engine/physics logic, car model) but entirely doable on the BGE.

Also I like the Unity’s default shader.

True thats me right there , I luv BGE and UPBGE and offcourse these are great Engines i wouldn’t go commercial using BGE offcourse … Switching to unreal Engine would be my choice right now I’m busy watching tuts on UE 4 to get used to The Designing part and its tools. Be4 I can get started on a very serious project however BGE is still fun and as good as it used to be on BGE i’d make my assets quicker and also test quicker and build quicker its a much easier tool to use than UE 4 and Unity . those engines require team effort im still puttin up a team for these new titles in drafing up BTW !!!

But yeah man you’re right “from a certain point of view offcourse”.

Fred/K.S

Yeahh I hate that too, but what’s good is that blender lets you work from scratch and quicker and easier the only downside is lighting and shadows otherwise it does an exceptional amount of faking for example. Blender can fake even the most intense and most realistic forms of lighting in the GE even shadows. But you’ll need to be a master mind to know all the tricks of setting up such !!!

This thing of unreal Engine dishing out assets is so over the top that you’d get shit for $70 why to buy assets when u can make em from scratch on blender.
As i recruit individuals from where I work I’ll train them to use blender.

I bet if you weren’t making your speed racer game on an integrated graphics card, you could achieve this level of realism.
yeah true I could have achived alot better results actually the problem was that I started on a Low End and i reaped low end results. But on the high end it plays well Offcourse. I can still improve the graphics but i would need more time. (I will need to do the proper programming on it) Lol one of the objectives were to build a big game on a low end for the low end pc’s and on High ends it would just beast out gameplay at 60 fps or 128 if possible.

Fred/K.S

Guys nothings hard to do in BGE I think if I can remember Adriansnetlis made a Drifting car physics sysetm for worn tires idk if its still on. But thats exactly how Need For Speed Underground 2’s arcade physics is. Its highly possible to achive AAA level type of graphics , gameplay on BGE if u know how to fake. (Programming counts for the most part here) :smiley:

Faking is one of the best way despite BGE’s limitations all you need is to know what it can do and what it can’t do and try and use what it can, to do what it can’t by faking results to achive what it can’t do. (Sounds complicated but its not once u do it just know what to do)

Ive used alot of faking techniques in almost all my blender game projectd.

Fred/K.S

Make a UI system in BGE for debugging that includes dynamic graphing and is easy to use? Challenge accepted! P.S. Now just wait a few days.



But I mean its 3 different takes on the same problem.

Got to use bgui, so far its doing the job :slight_smile:

Yessssss finally yr back I’ll see the progress in the upcomming days adrians. :smiley:

But I mean its 3 different takes on the same problem.

Got to use bgui, so far its doing the job

Awesome Stuff !!!

Fred/K.S

having a single ui manager that adds element object and updates, and removes objects etc can handle all of this easy*

I use a tuple at the moment for each element,
(‘ElementName’,element[‘data’],[stuffToUpdat],owner,target)

if len(tuple) < 5:
(tab)add element and set data(some elements update themselves)
else:
(tab)if valid update, else add to poplist

where things to update are functions

moveRelativeToGameObject

moveRelativeToCameraSpace

rotateToMatch

faceCamera

updateText

updateProgressBar

etc

@BluePrintRandom Nice ! Its really systemic i can see how yr functions would run in that case. Seems quite like a long process is this another way of daking or is this a direct way?

Fred/K.S

nothing is as flexible
(this ui will work for any game, and elements themselves may use traditional animations / armatures/ glsl nodes etc)

CURRENT CODE IN MANIC MACK

#Scripts by Jacob Merrill# http://creativecommons.org/licenses/by-nc/3.0/us/
# Mit CC Non-Comercial - Must Attribute author


#Email [email protected] and inquire for other permisions  


import bge
from mathutils import Vector


cont = bge.logic.getCurrentController()
own = cont.owner






def Lives(Data):
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        Spawned_Element.children[0].text = str(Element[3]['Lives'])
        Spawned_Element.children[1].text = str(Element[3]['Lives'])


def HealthB(Data):
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    prop = thing[1]
    max = thing[1]+"_Max"
    if not Element[3].invalid:
        Spawned_Element.children[0].localScale = [Element[3][prop]/Element[3][max],1,1]
    
def Prop(Data):
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        Spawned_Element[thing[1]] = Element[3][thing[1]]
    
def Text(Data):
    #print(Data[2])
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        Spawned_Element.text  = str(Element[3][thing[1]])
        
#New center text mode!        
def Text2(Data):
    #print(Data[2])
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        textOB = Spawned_Element.children['UI_Text2_Text']
        Box = Spawned_Element.children['UI_Text2_Box']
        textOB.text  = str(Element[3][thing[1]])        
        dim = textOB.dimensions
        textOB.worldPosition = Spawned_Element.worldTransform*Vector([-1.6,0,0])
        Box.localScale = [1.8,2,1]
        if len(textOB.text)&lt;1:
            Box.visible=False
        else:
            Box.visible=True    
    
def Pos(Data):
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        Spawned_Element.worldPosition = Element[3].worldPosition + Vector(thing[1])
        #Spawned_Element.worldOrientation = own.scene.active_camera.worldOrientation


def Pos2(Data):
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        Spawned_Element.worldPosition = Element[3].worldPosition + own.scene.active_camera.worldOrientation*Vector(thing[1])
        #Spawned_Element.worldOrientation = own.scene.active_camera.worldOrientation        


def RotC(Data):
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        Spawned_Element.worldOrientation = own.scene.active_camera.worldOrientation
        
def Rot(Data):
    thing = Data[2]
    Spawned_Element = Data[0]
    Element = Data[1]
    if not Element[3].invalid:
        rot = Element[3].worldOrientation.to_euler()
        rot.x+=thing[1][0]
        rot.y+=thing[1][1]
        rot.z+=thing[1][2]
        Spawned_Element.worldOrientation = rot
    
def CamPos(Data):
    Spawned_Element = Data[0]
    
    cam = own.scene.active_camera
    Element = Data[1]
    if not Element[3].invalid:
        thing = Data[2]
        offset = Vector(thing[1])
        Spawned_Element.worldPosition = cam.worldPosition+(cam.worldOrientation*offset)
        Spawned_Element.worldOrientation = cam.worldOrientation   
        
                     
ElementDict = { "Lives":Lives, "HealthB":HealthB, "Prop":Prop, "Text":Text,"Pos":Pos,"CamPos":CamPos, "Rot":Rot, "RotC":RotC, 'Pos2':Pos2, "Text2":Text2 }










def multi_delete(list_, args):
    indexes = sorted(list(args), reverse=True)
    for index in indexes:
        del list_[index]
    return list_


def main():


    if 'Main' not in own:
        for scene in bge.logic.getSceneList():
            if scene.name =="Main":
                own['Main']=scene
                #print('Overlay Found main scene')
                own['MainCam']=scene.active_camera
                #print('Found main cam')
                
    cam = own.scene.active_camera
    cam.worldPosition = own['MainCam'].worldPosition 
    cam.worldOrientation = own['MainCam'].worldOrientation
    
    if 'initTest' not in own:
        own['initTest']=True
        
        own['Elements']= [  ]
    index = [ 0, 1, 2, 3, 4 ]
    example = ['element',['data'],['things to update'],'target','gameOb'] 
    
    index = 0
    popList = []
    for Element in own['Elements']:
        #print(Element)
        if Element[3].invalid:
            popList.append(index)
            continue
        
        if len(Element)&lt;5:
            #print('adding '+Element[0])
            Spawned_Element = own.scene.addObject(Element[0],own.scene.active_camera,0)
            Spawned_Element['data']=Element[1]
            own['Elements'][index].append(Spawned_Element)
            
            
            for thing in Element[2]:
                string = thing[0]
                if thing!="Pop":
                    func = ElementDict[string]
                    func([Spawned_Element,Element,thing])
                else:
                    popList.append(index)
                    print('popping element')    
                
                
                
                    
                
                
                
                
                    
                
        else:
            if not Element[3].invalid:
                if not Element[4].invalid:
                    for thing in Element[2]:
                    
                        Spawned_Element = Element[4]
                        string = thing[0]
                        if string!="Pop":
                            func = ElementDict[string]
                            func([Spawned_Element,Element,thing])
                        else:
                            popList.append(index)
                            print('Popping')
                    
                     
                else:
                    
                    popList.append(index)           
            else:
                if not Element[4].invalid:
                    if 'RT' not in Element[4]:
                        Element[4].endObject()
                else:        
                    popList.append(index)            
                        
                    
        index+=1
        
    if len(popList)&gt;0:
        multi_delete(own['Elements'],popList)
main()



For the UI discussion; Python modules do allow the BGE to have good quality UI’s and other mechanics, but where they fall down is that they don’t allow the developer to create systems in the WYSIWYG fashion. I have mentioned here, many times, that the BGE needs more visually-based tools for these types of things, but the unfortunate thing is that the very thought of seeing what you are designing (as opposed to just guessing through code) appears to be a very difficult concept for some fans to grasp.

Right now, UPBGE is probably the only engine (out of the capable indie solutions) that does not have visual UI bulding and theming (not to mention having no visuals to help build other mechanics). I know there’s many here who like to build things purely with code, but don’t project it as the only way those things should be done.

Hi there, I’m the author of the vehicle physics shown in those videos. First video is mine, indeed. :slight_smile:

In this case, the vehicle physics have little to do with the engine. Vehicle physics in Unity 3D is broken in several levels. Unity exposes a subset of nVidia’s PhysX Vehicle SDK. Not only nVidia’s model itself is based on a wrong interpretation of a specific vehicle physics principle (the sprung-mass model), but also the implementation is poor, buggy, and causes many unwanted side effects.

Unreal Engine also uses PhysX for vehicle physics, so it suffers the same issues as Unity 3D. The advantage in UE is that the entire PhysX Vehicle SDK is exposed and you have a better chance of finding a setup that works.

So I developed a custom vehicle physics engine that provides accurate and realistic vehicle simulation in Unity 3D. What you see in the videos is Vehicle Physics Pro, a vehicle simulation kit comparable to some extent to the big car simulation titles.

Here’s a more recent video:

BGE might have the same vehicle physics if Vehicle Physics Pro were ported to it (out of scope). Speaking of stock physics, and based only on a few pieces I’ve seen about Bullet Physics vehicles, I think that BGE has a real chance of having better vehicle physics that both Unity 3D and UE.

Its a bit funny how a thread on some vehicle physics simulation came to be about UIs…

The true unfortunate thing is that the very thought of making such an addon/module for the Blender UI + the BGE appears to be a very difficult concept for some fans to grasp.

I mean, yes, it would be awesome to have a WISIWIG. But who is to do this ? Any idea how hard it is to implement such a thing ? Did you also know that the addon system theoritically supports this ? Yet, who is going to spent some months on desinging it ?

If you want “the devs to do it”, then you are out of luck, as most of the work on the engine is not about adding features like UIs. I could be wrong, but I don’t think its the main focus for them right now.

@Wknight02 true I agree with yr statement.

Fred/K.S

Hello! Any moderator could please look into the moderation-pending message queue and validate the post I wrote here yesterday? Possibly the message ways put on hold because it contains several links, but they all are valid references on this discussion.

Believe it or not though, WYSIWYG design and creation has been a thing since the beginning of the 21st century and the overall trend in game engines favor more visual elements.

There’s a reason why older engines with no visual aspects and an all-code “build everything with text” workflow have either died or have lost most of their users over the years (do you know of anyone now using engines like Crystal Space, Dark Basic, Irrlicht, ect…)? This is about growing the userbase for UPBGE, as the engine’s opportunity for growth will be very limited if it only caters to the existing and former userbase (I mention the latter because they know what it’s like to work in the engine).

I have also mentioned the pushback against visual tools over the years as well and how that could be impacting the potential of the BGE, visual tools for things like UI’s do not have to feel like an inflexible black box (especially if it’s extensible). Not having those tools also betrays the idea of UPBGE being seen as easy to use (what good is that line if you can bang out game logic quickly and easy, and to moderate complexity even, but need hundreds of lines of code and countless trial-and-error tests for basic concepts in other cases)?

I have a method to rig up cars where you label the parts in the view port,

the script cycles through children recursive and builds a hiarchy,
and then sets up my own custom vehicle script.

I think one could use meshes that get deleted to setup the standard wrapper using similar methods (wheel mesh is parented to turning rotor, planes parent to rotator, top/bottom of Z plane indicate suspension min / max.

yellow plane length indicates turn length in radians?

but baiscally build a gui for the car using mesh, that is read and deleted, and sets up the in game script.

when you add instance of a car, you then replace it’s mesh, and child shape meshes, scale planes, press p and have a wrapped vehicle.