Game Development Community

Integration rate?

by AzraelK · in General Discussion · 01/23/2002 (2:03 pm) · 8 replies

I was looking for info about wheeled vehicles and ran into a large explanation on what was the problem with them. I was understanding this quite well until I stumbled with this section:

Quote: Dynamix reduced the wheel integration rate down to 30 Hz (I had them running at 120 Hz, and I know the Papyrus guys Nascar 4 etc. run their cars at 300 Hz). This is going to make it very tough, if not impossible to make high speed ground vehicles with T2 mods.

This is a fraction of the post by Tim Gift, Im sorry but I really have to ask, what is Integration rate? I know what integration is... but I have never heard this term before, and why is it so important for the wheeled vehicles?

P.s. Somewhere along the thread, it was mentioned that this problem arised due to the terrain being too rough (too many slopes and bumps in the terrain) does this mean that making the terrain more uniform and flat (like a racetrack) could help vehicles to work better and run faster?

#1
01/24/2002 (1:00 am)
trying to remember school, calc....
integration is slope of curve (am i right)
integration rate must be how often the slope is calcualted, thus higher rates will result in increased accuracy. (sounds reasonable so far)

sooooo to track terrain accurately a fast moving vehicle on smoothish terrain may require a similar "integration rate" as a slow vehile over rugged terrain .....

im out of my depth (im the artist) but thats my reading of it....
#2
01/24/2002 (6:31 am)
Just a little bit on math I learned on high school which may help:

What you're thinking of is derivation.

The instantaneous rate of change in distance over time = velocity. Hence if you have plotted a graph with x axis = time and y axis = distance/displacement the slope at each point will be equal to the velocity. Hence you could map a velocity graph by taking all your slopes at every point and plotting them on a y axis vs time (distance per time). The slope of any point on your velocity graph is the instantaneous rate of change in velocity which = acceleration. Plot those on a graph vs time and you get an acceleration graph with time on x and acceleration on y (displacement per time squared). Most of your accelations are constant and uniform otherwise you'd have jerks.

So what can be understood? Well if your velocity graph has an equal slope throughout you've got a straight line for an acceleration, there is no change in velocity.

Now Integration is the opposite of derivation it's when you've got your acceleration graph and you wanna get a velocity graph, or velocity and want to get displacement (this must be VERY important in torque). (OK I'm being very simple here are there are loads of formulas for integration: by parts, quotient rules, multiplication rules, but I think it's better if you can picture it)

So how do you do this? You'd take a certain distance on x and see where that lands you on y multiply those two vales (displacement/time squared times time = displacement/time = velocity) and you'll have the velocity for the x point from which you started. The smaller the distance you take from the point you started to the next, the more accurate your integration will be (so I guess this is the frequency?). It's a process of taking the area under the curve millions of times. There are many formulas for this, the most useful to know being the fundamental theorem of caclulus (it was something along the lines of F1(b) - F1(a) = integral of x @ a,b, I'm sorry I can't remember it very well you can find it on any site I'm sure).

I wish I could link some sites but I don't know any. If you do a search you'll find some diagrams which will help explain it better than reading.
#3
01/24/2002 (6:35 am)
Just reread your first post.

What that may mean is for getting the shape of the terrain for the wheels to displace over? By lowering the frequency it'll make it much less accurate hence at high speeds the engine won't be able to see how much the wheels need to displace up and down to not hit the terrain and will cause hard collisions?

These are guesses so PLEASE do not take them as being the truth. But it makes sense as when I was coding T2 (I'd made a jeep which I then transformed to a hover jeep so it'd go smooth) high speed vehicles would jerk around a lot.
#4
01/24/2002 (10:55 am)
Aha! after searching over the net I found this article that enlighten me a bit about this problem:

Lone Game Developer Battles Physics Simulator

So this is what is happening at torque right? the integrator rate at a higher speed blows up, (just like the article says) and we are using Euler method instead of Taylor or RK, because is faster although not the most stable =) right?

Maybe Im talking non sense because Im new to this kind of aproach (I ussually use simulated physics not rigid body physics) but couldnt it be possible to actually take samples aproximations of the following integrations and then displace the vehicle forward a few steps ahead so it gives you the feeling that you are going faster than you actually are? to make the ride little more bumpy you could change the gravity value to a lower, so it looks you are "getting air" due to the speed. Sure it may look like skipping frames, so we could interpolate with a curve algorithm so it wouldnt look like it.
Nah! forget it I know Im talking nonsense, sorry.

(That or use other integrator, they both could do. ;) )

Anyway if you are interested in vehicle and rigid body physics here are a bunch of links that came out of my
search enjoy!

www.miata.net/sport/Physics/

www.d6.com/users/checker/dynamics.htm

www.cfxweb.net/pages/Articles/Algorithms/Rigid-Body/

www.gamedev.net/community/forums/topic.asp?topic_id=56598

www.martinb.com/physics/physics.htm

www.gamasutra.com/php-bin/gig_display.php?gig_id=209

www-2.cs.cmu.edu/afs/cs/user/baraff/www/pbm/pbm.html

www.cfxweb.net/cgi-bin/links/search.cgi?query=physics
#5
01/24/2002 (1:20 pm)
Aha! (again) after reading this thread and the original thread where this came, I have reached the conclusion that actually:

* You do need to either take more samples per frame, to avoid the simulation to "blow" (hey I wasnt talking so much nonsense after all! =) )

*And/or Implement a new (and slower) integrator like RK or other, and optimize the heck out of it (perhaps by using asm)

*And.. in order to achieve better speeds, the terrain should be a bit less "rough" so: a.-you actually dont bounce so much and therefore gain speed and b.-you have less chances for the simulation to go "boom!"

Please correct me if Im wrong. as I might give it a go =) to test it.

By the way, anyone for a jeep ride? ;)
#6
01/24/2002 (2:04 pm)
Now... 120khz is approxamately what speed relative to default model and real life?

All I need is about 80mph max (hummer, of course I do'nt keep track of the stats... but that sounds right)

If Nascar was 300hz and they go... what, max 250mph? (I don't follow nascar hehe)

Soooo.... 120khz would be just fine for all realistic land vehicles... but THIRTY?

Whaaa?

How do the wheeled vehicles in T2 handle? I never played it, but I can assume they aren't that slow...
#7
01/24/2002 (2:15 pm)
Like I said, I had made my own Jeep for T2. It was fine at the same speed as the MPB (a slow vehicle with a turret and inventory station in Tribes2) but as it got faster (I even moved the suspensions up like 20 units) it would crash get jumpy. Move forward for a bit, looked good then bam you were facing somewhere else.

If you make flat terrain you should be fine though (totally flat).

I think it's got to do with the wheel positions (z axis) but I'm not totally sure.
#8
01/24/2002 (3:28 pm)
Quote:How do the wheeled vehicles in T2 handle? I never played it, but I can assume they aren't that slow...
There is only one wheeled vehicle in T2 -- the MPB, which is the very definition of slow.