Page 1 of 6

Vehicle demo

Posted: Thu Apr 02, 2009 2:07 am
by mi076
Hello,
... new Vehicle demo, with vehicle configuration dialog. May be
useful.

http://code.google.com/p/game-ws/

Re: Vehicle demo

Posted: Sat May 09, 2009 2:05 pm
by mi076
<...>

Re: Vehicle demo

Posted: Thu May 28, 2009 8:48 pm
by Mic
Outstanding demo. I have a few questions, in terms of building the assets and assembling the scene, what modeling program did you use? Also, how are you rendering the scene. Are you using blender, ogre, or something else?

Thank you :)

Re: Vehicle demo

Posted: Fri May 29, 2009 1:47 pm
by mi076
<...>

Re: Vehicle demo

Posted: Fri Jun 12, 2009 5:26 pm
by Verbo
Very cool!

I see you added wheel width parameters but they don't have graphic and physics feedback yet, are you planning on adding it?

I am also porting Bullet in an engine and I eventually want to be able to take the wheel mass and width into account, and also the ground friction. I also want to have the motored wheel spinning even if there is no contact with the ground. Ouch...lot of work ahead...

See ya!

Verbo

Re: Vehicle demo

Posted: Mon Jun 15, 2009 3:22 am
by mi076
<...>

Re: Vehicle demo

Posted: Mon Jun 22, 2009 3:28 pm
by Verbo
Hi,

I am currently testing my new Bullet vehicle and I have some problems. I wonder if you ran in the same issues or questionning. I also tried to emulate your settings as much as I could (even if my car model is not the same...it has more a dodge charger style ) so that my question make more sense.

My settings are:

mass: 800kg
max steering: 40 degree
max engine force per wheel = 2000
max braking force per wheel = 500 -> I am not using it yet however, I am just using negative force for the moment(more like an electric car...)
static friction: 2
susp stiff: 20
susp rest: .1
susp damp: 2.3
susp max travel: 10 cm
roll influence: 0.2

1) The engine force you are using is a value per wheel, right? Because in my implementation, I allow the user to define how to distribute the force to each wheels (I use a torque ratio that defines what part of the total engine force is going to each wheel), so I guess I have to put a lot more engine force to take the torque distribution distribution into account.

2) If I use a max travel length of 10 cm, I see my rear wheels sink half way to the ground.

3) I see in the Bullet Vehicle that if we are braking, we stop applying engine force or vice-versa, but I aren`t we able to do both together with a real car? It seems to me that when I drive my car and press the brake pedal, the engine doesn`t stop applying force right away, because the engine is still revolving, and in the more extreme case, I remember braking both pedals at the same time (it was a crazy night when my gas pedal cable was frozen, so I had to brake every 20 sec to avoid reaching sublight speed...). I don`t know, I might be wrong, but my first guess would have been to cumulate the engine force and the braking force, This way we could brake while pressing gas to acheive some driving tricks, etc etc...
Again, I am just raising the question, no offense hey :)

4) How do you take the ground friction into account? From what I tested, even if I set the floor friction to 0.00001, the car doesn't behave differently at all. Shouldn't we multiply the ground friction by the friction slip and do a square root to get the real friction?

Thx. :)

Verbo

Re: Vehicle demo

Posted: Sat Aug 08, 2009 10:21 pm
by vikthered
Hi,

Has anyone implemented the vehicle demo on the iphone? Is it slow on the device?

Re: Vehicle demo

Posted: Thu Jun 03, 2010 3:40 pm
by smjones
Awesome! I haven't gone into the details yet but I am interested in the vehicle physics design and there configuration values. I guess that's like everybody else! :)
At my company I have been asked to investigate vehicle physics. Our primary application will be a high fidelity flight simulation with vehicles traveling on highways. My company makes UAVs and my job is involved in creating flight simulator software for our UAV trainers. My point is the application isn't going to be a high speed racing game. (although that would be sort of fun to give the UAV payload operator something fun to look at!) :D Although I don't think the Army would think that would be very funny. They don't have a sense of humor as far as I'm aware of. :P No disrespect intended to any military folks! I respect your job completely.

I've read a little bit that Bullet physics has a better or more complete vehicle class than other physics SDKs such as PhysX. Is this true? I'm traveling up a steep learning curve so I need all the help I can get.

Thanks so much for putting in all the time and effort in this demo.


EDIT: Oh one more thing. I forgot to say that TAB didn't work for me to change directions. I got the car stuck a few times and couldn't back up. No problem though! I just restarted the app. My main thing was to see a good sample of very tuned vehicle dynamics using Bullet.

Steve

Re: Vehicle demo

Posted: Wed Jun 16, 2010 2:17 pm
by mi076
Thank you very much for looking into it..
I forgot to say that TAB didn't work for me to change directions.
Oh, mea culpa, it is BACKSPACE...

May be i shall update the demo.. There are some minor simulation issues i would like to check, but first i have to look at new Bullet version. Thank you.

Re: Vehicle demo

Posted: Sun Jun 20, 2010 5:16 am
by mi076
<...>

Re: Vehicle demo

Posted: Tue Feb 15, 2011 12:57 pm
by dumbo2007
Thanks for the great demo. I am trying to integrate the Vehicle Model into a game and I found your code easy to understnad and learn from. I was wondering how complex is it to add a engine model with gears. Is it possible to integrate something like the Vehicle Dynamics Library or similar library into your code ?

Re: Vehicle demo

Posted: Sun Feb 27, 2011 5:53 am
by mi076
@dumbo2007
Thank you very much! You are right, the vehicle needs engine model. Currently "throttle" is temporary and very very simple... I have started once implementing engine, but haven't finished it, i hope i shall do it little later or take it if i shall find good code (throttle, gear, rpm/power, etc). Sorry for late response.

Re: Vehicle demo

Posted: Sun Feb 27, 2011 3:10 pm
by dumbo2007
hey,

yeah I am going to trying to build some gearing code. I was wondering if you would know whether Bullet simulates friction and torque to the extent required for this. For example at 1st gear the torque output is maximum but the angular velocity is less. But this will not make any difference when the vehicle is climbing up a slope unless Bullet simulates torque and friction accurately. Similarly at 5th gear the torque is very less but angular speed output is high. So the vehicle should have lot of trouble even holding position on the slope. Probably I can fix some sort of power output value of the engine and since the power remains the same after a gear transition, I can use it to calculate the torque and finally the rpm.

Which brings me to another point...is it possible to set the torque of the wheels individually at every step in the simulation with a ray cast vehicle ?

Re: Vehicle demo

Posted: Tue Mar 01, 2011 11:19 pm
by proof
For the gearing system, each gear should have its ratio:

Code: Select all

gear. no.     ratio
-1              -1
0                0
1                2.3
2                1.8
3                1.3
4                0.9
5                0.5
The current torque you should apply is the currentGearRatio * baseTorque. The hardest thing to implement gears would be to calculate the RPM. Once you do, you can define values: maxRpm = 8000, minRpm = 1000, maxRpmToGearUp = 6000, minRpmToGearDown = 4000. The following rules apply:

Code: Select all

limit: minRpm <= currentRpm <= maxRpm
if (currentRpm >= maxRpmToGearUp && gear != maxGear)
{
   currentRpm = minRpmToGearDown + 100;
   gear++;
}
if (currentRpm <= minRpmToGearDown && gear != minGear)
{
   currentRpm = maxRpmToGearUp - 100;
   gear--;
}
Then you could just apply the baseTorque * gearRatios[gear] and that should work for a base. (at least, that's how I plan on implementing it)

On the other hand, has anyone played around with the vehicle configuration? For the past couple of days I've been trying to find an optimal configuration and I just can't seem to get it right. What I'm looking for can be seen here: http://www.youtube.com/watch?v=BJidtxqDtfo#t=1m28s

One thing I have noticed is that if you steer left, the car tilts to left and it should tilt to the right which is an odd behavior :roll: