# ODE - Iterations / Quickstep

This topic is 5096 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've heard some people suggest using a maximum time check for time stepping in ODE. The version I downloaded has a quickstep function which allows specifying a number of iterations. So is it safe to constantly change the number of iterations according to how much time has passed in one frame? For example, 2 iterations for every 1 millisecond. If this were supposed to fix the problem, then slow-down should not have any effect on the simulation, correct? I'm giving ODE the correct number of iterations to laps the time value. But I seem to still be having issues when the frame rate drops. Anyone know why? Or is it obvious that I'm not doing it correctly? Perhaps I'm not understanding what quickstep iterations are doing? Help is much appreciated :) edit: Typo spelling [Edited by - Kest on November 30, 2005 9:43:59 AM]

##### Share on other sites
If you're working with a fixed framerate, I find 1 / TargetFPS to be quite smooth.... Although, that's working with the normal Step function, not QuickStep.

##### Share on other sites
Err, I've never heard of dynamically changing the number of iterations based on the framerate. What I have heard of (and I recommend) is using a fixed timestep size (0.01 seconds, so you get ODE running at 100 Hz, is what I use), and then vary the number of times you call dQuickStep() based on framerate.

##### Share on other sites
Quote:
 Original post by BradDaBugErr, I've never heard of dynamically changing the number of iterations based on the framerate. What I have heard of (and I recommend) is using a fixed timestep size (0.01 seconds, so you get ODE running at 100 Hz, is what I use), and then vary the number of times you call dQuickStep() based on framerate.

If the number of iterations are not based on time, what is their purpose?

If you vary the number of calls to dQuickStep() based on the current frame rate, doesn't that result in your simulation running slower when the host machine is already having trouble keeping up to begin with? The player completely misses these lapses of time, and the game would be unplayable on slower machines (or just when a scene becomes complex).

Thanks for the help :)

##### Share on other sites
I've had some issues with ODE when I've called the stepping functions numerous times without some time actually being passed, so the solution I used was to use the normal time, but don't let it exceed some preset value (0.02 worked fairly well).

Example:
float stepSize = timer.getSecondsPassed();#define MAX_STEP_SIZE 0.02fif (stepSize > MAX_STEP_SIZE) stepSize = MAX_STEP_SIZE;...//update joints, call the collision functions, etc.dWorldQuickStep(...,stepSize);...//release the contact joints

##### Share on other sites
Quote:
 Original post by KestIf you vary the number of calls to dQuickStep() based on the current frame rate, doesn't that result in your simulation running slower when the host machine is already having trouble keeping up to begin with? The player completely misses these lapses of time, and the game would be unplayable on slower machines (or just when a scene becomes complex).

It's definitely possible. The way I handle that is limit the number of times that dQuickStep() can execute per frame. Worst case senario is that the rate of the game begins to scale down (goes slow-motion, in other words) since the simulation is running at a slower rate. But the simulation stays stable. Plus when the framerate begins to drop due to other reasons (complicated graphics or something) the simulation stays stable. If you just sent 1/FPS to dQuickStep() as the timestep size you could be taking huge timesteps and who knows what could happen.

##### Share on other sites
I've noted that ODE's dQuickStep is less stable than the traditional StepFast.
It means on collisions with dQuickStep: suddenly, objects stack have popping behavior and do not rest very well. But with StepFast they mantain their positions when resting. And with StepFast, 5 Iterations is enough for good simulations, but with dQuickStep you'd need more than 10. do you have the same feeling?

##### Share on other sites
I haven't noticed that, but I haven't really used StepFast much. By the time I really started using ODE StepFast had already been depreciated in favor of dQuickStep. I guess it's possible.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 37
• 16
• 18
• 25