Maximum physic time

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
User avatar
didi71
Posts: 1
Joined: Fri Dec 16, 2011 9:43 pm
Location: Italy

Maximum physic time

Post by didi71 »

Hello Norbo.
First thank you for this great work.

I’ve two questions:

1) How is the maximum reasonable physics time onto a Windows Phone? Currently WP 7.5 Mango can runs up to 60 fps.
2) Is the physics time exactly proportional to the entity amount?

Thanks in advance and happy new year..

Diego.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Maximum physic time

Post by Norbo »

1) How is the maximum reasonable physics time onto a Windows Phone? Currently WP 7.5 Mango can runs up to 60 fps.
Assuming that physics time is referring to the time step duration, it depends on the simulation. If there's a lot of detail, high speeds, and articulated structures, a smaller time step duration (Space.TimeStepSettings.TimeStepDuration) is a good idea. The default of 1/60f can handle almost all simulations, though in extreme cases you may want to go to 1/120f or faster.

For many simple simulations, a time step duration of 1/30f works just fine. Things will tend to get into deeper penetration and generally be a bit less robust, but it works. 30 1/30f updates do less work overall than 60 1/60f updates so there will be a performance boost.

Note that the parameterless Space.Update() method performs a single time step of length Space.TimeStepSettings.TimeStepDuration.

The other version that takes an elapsed time accumulates the time and performs as many time steps of length Space.TimeStepSettings.TimeStepDuration as it can to catch up to the accumulated time. There's usually time left over (to be accumulated with the next frame) which can cause a very slight unevenness to motion. Interpolation buffers are designed to handle this. More information can be found in the asynchronous update documentation. The interpolation buffers don't have to be used with asynchronous updating, it's just a common use case.

The simplest way to handle updating is to call the parameterless Space.Update() a fixed number of times per game update to match the game's update rate.
2) Is the physics time exactly proportional to the entity amount?
Not in general, no.

If physics time refers to time step duration again, the complexity of the simulation is what usually determines the requires time step duration. A few boxes flying through the air with ballistic motion don't need a high frequency. An over-leveraged complicated articulated robot arm would need a higher frequency.

If physics time refers to the real-world time it takes to compute a time step, the interaction between bodies is generally more important. A big pile of interacting objects can run slower than a much larger amount of floating, separated objects.
Thanks in advance and happy new year..
To you, too :)
Post Reply