Setting maxSubSteps = 0

Post Reply
allsey87
Posts: 33
Joined: Fri Oct 26, 2012 1:50 pm

Setting maxSubSteps = 0

Post by allsey87 »

Hi All,

I'm currently adding a 3D Dynamics plugin to the ARGoS Simulator (http://iridia.ulb.ac.be/argos/). In this simulator, the concept of frame rate independence isn't a big deal, ultimately what I (think I) would like to see is that when I step by simulation 0.01 seconds, the physics engine takes one step of 0.01 seconds and then I render a frame, if a render is selected.

On the page http://bulletphysics.org/mediawiki-1.5. ... D.3D_0_.3F, I states the following:
If you pass maxSubSteps=0 to the function, then it will assume a variable tick rate. Every tick, it will move the simulation along by exactly the timeStep you pass, in a single tick, instead of a number of ticks equal to fixedTimeStep. This is not officially supported, and the death of determinism and framerate independence. Don't do it.
Now I understand why from a gaming perspective this is important, however from the simulation perspective, smooth graphics etc really isn't high on the priority list. My question would be, are my instincts, that tell me that setting maxSubSteps=0 is actually exactly what I want, correct? and as long as I'm always stepping my simulation forward by a fixed time step, shouldn't the simulation still be deterministic?

Is there any other reason why 'Don't do it.' is written on the wiki page?

Cheers,
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Setting maxSubSteps = 0

Post by Erwin Coumans »

The wiki information is not always accurate. I started rewriting a new Bullet user manual, and once it is finished, I remove the out-of-date wiki pages and point to the new manual.

It is perfectly fine to stepSimulation(1./120. , 0) to get a fixed timestep of 120 Hertz for example.

The wiki refers to combining with maxSubSteps=0 with a VARIABLE timestep, based on the real delta time. In that case the internal timestep is variable too. Big changes and a too large internal simulation step makes the simulation unreliable and unstable.

Your case is perfectly fine.
Post Reply