Advanced vehicle physics

Latest update: http://www.gameblender.org/download/file.php?id=3577 (Version 0.97)

This is a raycast vehicle simulation I’ve been working on. It’s eternally a WIP, so I wouldn’t advise using it in a game, but please do whatever you wish with it.

The vehicle model is an Evo 8. I obviously don’t own it; Mitsubishi does.

See the readme text block for controls and more information. :slight_smile:

It ends up making the car drift whenever i try to turn even slightly.

It’s a bit slippery, yes. The friction model is limited at the moment.

Very nice!

IT’S YOUR FAULT! I drove till I fell into oblivion!~

Great Demo, has really evolved!

http://www.gameblender.org/download/file.php?id=3394

Update.

  • The friction model is roughly complete, with sub-stepping to increase accuracy.
  • Spacebar is now brake, and E is flip. Try braking on a slope- once you come to a stop, you won’t slide down :smiley:
  • Adjusted the anti-drift steering feature to only activate above a certain velocity, to provide better control.

Great template!
Thank you very much for sharing!
I’ll try to add a track to it in a few days…
PS. What do you mean by “The friction model”?..because the car don’t react on Material’s friction settings?

Thanks!

And, well, friction simulation would be a better term. I just mean the code for simulating wheel friction is nearly complete.

It doesn’t respond to material friction yet; I haven’t gotten around to adding that. (Assuming the python API exists to retrieve material properties from a raycast- I hope it does!)

Tracks, vehicles, props… anything would be greatly appreciated :smiley:

never cease to amaze us haha

Hello Raiderium
I’ve adapted your car template to an old level/game of mine…it works pretty well!
It’s here, if you want to test it:
http://otothecleaner.free.fr/downloads/A_Special_Day_Raiderium_Template-2.blend
I’ll try to make the level “playable” and…more interesting!
Bye

@Marci97: Hehe, yes, I keep up to date on Bueraki :smiley:
In case Bananaft stops by, he’s very welcome to use this. I dunno if a raytest system is quite the same as one with physical wheels, though.

@BurningSniper:
http://www.myfacewhen.com/images/257.jpg

@OTO: Thanks! But, I can’t seem to access the file.

Hi Raiderium,
I really like your vehicle physics setup, most accurate I have seen so far for BGE. One thing that bothers me a little is the feeling that the centre of mass, or centre of gravity (CG) is too high. This causes the roll centre to be really high and even the slight weight transfer while vehicle is turning causes the car to flip really easily.
In your setup it seems it is in right position though. I am not sure if Bullet physics translates the mesh origin point also as the centre of mass…

here are some topics related to car physics… perhaps you know those already :slight_smile:


http://gt5mania.com/driving-guide/sideways-weight-transfer/

Thanks!

There are a few things left to do which should reduce the rolling problem. (Inertia tensor scaling and a downforce effect particularly.) Thank you for the links- I’ll take a look at them.

There is another problem which doesn’t seem to be with my sim: When a physical object is sliding across a triangulated surface like in the demo, it randomly jumps and jitters. I’ve never had this problem with Bullet before… I tried adding collision margins on both the vehicle and the terrain, decreasing friction to 0, etc etc, and it still happens. Anyone else experiencing this? It means that when the vehicle slides on stuff, it’ll randomly jump around.

Edit: Oh yeah, and you can now drive on physical moving objects :smiley:

this is a really great reference for car physics for games:
http://www.racer.nl/reference/carphys.htm

Oh, wow! This should prove useful in the future, thank you.

And now- an update.

http://www.gameblender.org/download/file.php?id=3396

  • Added curve-based tracks.
  • Redid the physics sub-stepping to literally increase Bullet’s internal framerate. It’s costly, but it gets the best results.
  • Added a buggy tire tread mark effect. It doesn’t work too well; I’ll be improving it.
  • Lots of improvements to the model.

With this update I’m turning it into a community project- See the file for details!

There is another problem which doesn’t seem to be with my sim: When a physical object is sliding across a triangulated surface like in the demo, it randomly jumps and jitters. I’ve never had this problem with Bullet before… I tried adding collision margins on both the vehicle and the terrain, decreasing friction to 0, etc etc, and it still happens. Anyone else experiencing this? It means that when the vehicle slides on stuff, it’ll randomly jump around.

Now that you mentions this, way back a few years ago when I was starting playing with BGE, I used to run into this when making stuff to slide around the floor, I guess it’s an old unresolved bug?

@Raderium:

i tried to use 6dof constraints in my game but the tire grip is usable only in rally games and not for track racing…

i didn’t can use your setup in my game i don’t know why… :frowning: but last update i’ve seen is fantastic XD :smiley:

http://www.4shared.com/file/A-8PjDhe/RaceDriver.html

:slight_smile: my game :slight_smile:

Hi! Amazing work

I have a question. I want to have a different friction for each wheel depending of the floor.

I’ve found the line that define the friction.

self.w_staticf= 1.5
in r_wheel.py

But I can’t figure out how to set a different value for each wheel.

Anyone can help me?

thanks in advance.

finally I did it by myself.

Proob of concept.

This is what happen if down the grip in the back wheels.