Bullet for a race-sim ?

Nico65
Posts: 8
Joined: Mon Apr 14, 2008 1:48 pm

Bullet for a race-sim ?

Post by Nico65 »

hello,

(apologies for my english)

with some friends we plan to try to make a race-sim, "as close as it gets" you'd say, and I was wondering if Bullet is up to the job (e.g. actual sim are running from 200Hz to 400Hz and the Bullet-doc says it's not a good idea to go above 60...)

I'm actually analyzing the VehicleDemo the RaycastVehicle to see what could be done. A know this is not supposed to be realistic (well at least I hope so :lol: ) but it's very interesting anyway. I'd love to start from scratch but there is so much of this code I do not get that it would never work :( you have to admit it's quite badly documented, and a weird OOP - e.g. I would have imagined Chassis, Wheel and Suspension classes but that's just me :roll: in the meantime I'll try to modify it as it is and look at related projects (SuperTuxKart and so)

if some of you are interested in offering help in my project please let me know ;)
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Bullet for a race-sim ?

Post by sparkprime »

Nico65 wrote:hello,

with some friends we plan to try to make a race-sim, "as close as it gets" you'd say, and I was wondering if Bullet is up to the job (e.g. actual sim are running from 200Hz to 400Hz and the Bullet-doc says it's not a good idea to go above 60...)
It's fine to go above 60. You can go pretty much as high as your cpu will allow.
I'm actually analyzing the VehicleDemo the RaycastVehicle to see what could be done. A know this is not supposed to be realistic (well at least I hope so :lol: ) but it's very interesting anyway. I'd love to start from scratch but there is so much of this code I do not get that it would never work :( you have to admit it's quite badly documented, and a weird OOP - e.g. I would have imagined Chassis, Wheel and Suspension classes but that's just me :roll: in the meantime I'll try to modify it as it is and look at related projects (SuperTuxKart and so)
What I would do is read up about car physics simulation, friction/suspension models, etc, and then have a go at implementing something basic myself. Then compare with the bullet version and decide what to do.
Nico65
Posts: 8
Joined: Mon Apr 14, 2008 1:48 pm

Re: Bullet for a race-sim ?

Post by Nico65 »

I'll do that and let you know, thanks ;)
stenyak
Posts: 29
Joined: Fri Aug 12, 2005 4:59 pm

Re: Bullet for a race-sim ?

Post by stenyak »

There are many open source projects you may want to look at for inspiration: vamos, vdrift, torcs, rars, motorsport. Racer is proprietary but its source code was made public (which does not mean opensourced or anything; it still retains the usual copyright and licensing), and is available somewhere on the net.

Of all, i think only vdrift uses bullet (or was it ode? can't remember). Anyway, bullet and ode are pretty similar except for the api (they're both general purpose physics engines), so it should do.

Coincidentally, i'm working on one of those projects, Motorsport. Old versions (evo2 and previous ones) used ODE , but i'm now rewriting the sim completely from scratch, using Bullet. The rewrite is still on very early stages so no interesting code to look at, sorry.

Anyway, good luck with your project and experiments.
Nico65
Posts: 8
Joined: Mon Apr 14, 2008 1:48 pm

Re: Bullet for a race-sim ?

Post by Nico65 »

VDrift uses "Vamos Automotive Simulator", and I really should be looking forward to this, though I'm more interested about proper documentation than raw code :(
stenyak
Posts: 29
Joined: Fri Aug 12, 2005 4:59 pm

Re: Bullet for a race-sim ?

Post by stenyak »

Nico65 wrote:VDrift uses "Vamos Automotive Simulator", and I really should be looking forward to this, though I'm more interested about proper documentation than raw code :(
I thought they started complementing Vamos physics with a generic physics engine some time ago, but my memory tends to fail :-)
Nico65
Posts: 8
Joined: Mon Apr 14, 2008 1:48 pm

Re: Bullet for a race-sim ?

Post by Nico65 »

I read the RaycastVehicle code and made some experiments. It's a interesting base and we know it won't stress Bullet to it's limits, but it had flaws. Imagine a car going slowly up a staircase, it will (almost) be like the car is going up hill on a flat road
beside, a car wheel is not moving vertically
I'm thinking of using the ConcaveConvexcastDemo and replace the boxes by btCylinderShapes (thanks to Erwin Coumans), see if it helps