Sign in to follow this  
ryan20fun

Why is 30Hz a Good Physics Time Stamp ?

Recommended Posts

ryan20fun    2635
Hi EveryBody.

as the title says, what makes 30Hz such a good number ?

because in [url="http://www.gamedev.net/topic/608448-issues-with-network-usage-and-cheating-using-client-side-input-prediction/page__pid__4848729#entry4848729"]this[/url] thread [url="user/46406-hplus0603/"][color=#CB021A]hplus0603[/color][/url]
said this:
[quote]First, you should fix your physics time step. 30 Hz is a common value. Each input from the client should be quantized to this rate. That way, you can't adjust the time slot size to cheat.[/quote]

so im now wondering why its such a good value.

Share this post


Link to post
Share on other sites
SriLumpa    198
The quote says it's "common", not "good" :)
It's a tradeoff between performance and precision/correctness.
So it all depends on the engine, on what level of incorrectness your game can tolerate, on how much you stress the engine, etc ...

I would advise to experiment with different values, rather than copying a one-size-fits-all value.

Share this post


Link to post
Share on other sites
It's a good value because it's reasonably good so you don't notice (with interpolation). That does not mean you can't do otherwise.

Of course nothing prevents you from using for example 5 Hz or 300 Hz. While 5 Hz will save you processing power compared to 30 Hz, 300 Hz will not be visible with typical frame rates of around 60 Hz.

But even 5 Hz may be entirely acceptable if it's reasonably believeable. Interpolating frames and displaying them at 60 Hz may be totally unnoticeable, it depends.

Share this post


Link to post
Share on other sites
JTippetts    12970
It's good because it is fast enough that humans will perceive the physics to be updating smoothly and with a minimum of error, but not so fast that the machine is too burdened to do anything else useful. 30 is commonly chosen, but if you experiment with lower values and it seems to be smooth and lacking in error, you can use a larger timestep to update at a slower rate. Just remember that physics engines frequently degrade in quality with larger timesteps due to [url="http://gafferongames.com/game-physics/integration-basics/"]integration errors[/url], so the smaller you can make your timestep without sacrificing visuals, AI, and responsiveness, the better.

Share this post


Link to post
Share on other sites
mhagain    13430
It's also good because you generally only have to deal with situations where your display is running faster than your simulation. If display is running slower you typically have to run multiple simulations to catch up, which will make display run even slower, which means even more simulations next time, and so on down to death. There are ways to deal with it (of course) but it's often easier to just avoid the situation altogether. 30 is also exactly half of 60, which is now the most common refresh rate for display devices, meaning that if you get an occasional slow frame it typically won't affect the rate of your simulation (even with vsync on).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this