[ODE] simulation steps in a game
Phil Teschner
philt at microsoft.com
Tue Apr 9 11:52:01 2002
In addition to get the right "feeling" I think with ODE there is even
more reason to keep your time step constant.
The constraint solver in ODE actually uses the (previous?) time step to
figure out the constraint forces. This can break horribly if, for some
reason, you have a small time step followed by a much larger time step.
The reason the time step is considered in the constraint force
calculation is that it is velocity based. That means that the solver
calculates the forces needed over a given time step (again this would be
the frame rate dependent time step) to maintain/reach the velocities
required by the constraints.
ODE is pretty good about not needing the constraints to be met exactly
(there is a fair bit of constraint correction), but I think it can still
break or at least look very wrong if the constraints get too far out of
sync.
Another reason to stay with a fixed physics time step is that it is a
lot easier for you to make sure everything (in the physics subsystem) is
working properly since you don't have to deal with special cases (such
as time steps that are much too large or too small). If you have
variable frame rate you, theoretically, would have to test the system
with all the combinations (constant large time step, constant small time
step, large time steps followed by small time steps, etc...)
Possibly your idea of maintaining some kind of minimum update rate would
work just fine since the delta between your time steps could be
reasonably guaranteed.
Phil
-----Original Message-----
From: Karlsson, Henrik [mailto:Henrik.Karlsson@dice.se]
Sent: Tuesday, April 09, 2002 11:19 AM
To: 'madmax@red-falcon.net'; ode@q12.org
Subject: RE: [ODE] simulation steps in a game
It's very common that you always run the physics update at the same rate
to
keep the right "feeling" to your game.. In our games we run at around
150
updates per second while the framerate is at 60fps (hopefully :)..
This depends alot on what kind of integrator you're running though...
The
more accurate and stable the less number of updates you can do...
Try it out and see how low you can go?.. the less the better :), then
you
can use your computer power to other candies :)
Henrik Karlsson,
Sweden
-----Original Message-----
From: madmax@red-falcon.net [mailto:madmax@red-falcon.net]
Sent: den 9 april 2002 20:09
To: ode@q12.org
Subject: [ODE] simulation steps in a game
Hi!
I'm just trying to integrate ODE into my hobbyist 3D game engine.
At the moment the physics simulation is tied to the frame rate; so a
frame
rate of 50 fps corresponds
to 50hz simulation.
I just wondered, what framerate is necessary for smooth and stable
physics.
Shall I double the number
of simulation steps if the framerate drops below a minimum, say, 50Hz,
thus
doing 2 simulation steps
per rendered frame. Or do you use ways of making the physics simulation
independent of the rendering.
(threads ?)
Stephan Kaiser
_______________________________________________
ODE mailing list
ODE@q12.org
http://q12.org/mailman/listinfo/ode
_______________________________________________
ODE mailing list
ODE@q12.org
http://q12.org/mailman/listinfo/ode