0
\$\begingroup\$

I there a point in updating the physics at a different rate than drawing / taking input? Is it just to exploit parallelism?

I've heard that many engines update the physics at 15FPS but render at 60FPS. What's the point in rendering the same image four times until it changes if it doesn't add fluidity?

\$\endgroup\$
1
  • \$\begingroup\$ Updating the physics at 15FPS doesn't mean all physics properties. It's probably more like collisions, water flows, and so on. The player is moving its camera a 60 FPS anyway, or else the game feels truly lagging. \$\endgroup\$
    – Lærne
    Commented Jun 6, 2014 at 11:54

3 Answers 3

1
\$\begingroup\$

Physics literally can't be updated at the same time as drawing in many games, even if the programmer wanted to. Physics in most games is significantly more complicated than just applying velocity and acceleration. You can't simply move an object and then draw the object, since the actual final position of that object is going to require multiple passes over all nearby objects, constraints, etc.

The only way to get meaningful transform data out of physics is to let it step the entire physical simulation.

\$\endgroup\$
1
\$\begingroup\$

Usually you want physics to be deterministic, in that if you run your game multiple times the exact same simulation will occur each time. One key factor in implementing determinism is to have a timestep that never changes. The amount of time passed to physics shouldn't be a variable, but a constant.

However, when graphics is being run and things rendered to the screen it may be favorable to run at maximum FPS, or at 60 FPS, or 30 fps, or whatever you like. It's easiest if you let rendering occur at a variable interval, and only update the physics when discrete chunks of time has passed.

This idea doesn't have anything to do with parallelism.

Also, you don't render the same thing 4 times. Usually you interpolate between the lower resolution discrete jumps in physics. Say an object moves from point A to point B over the course of 4 render frames. Each render frame would interpolate from A to B to create a very smooth transition. In this way usually the screen renders about an entire frame behind whatever the actual physics is doing.

\$\endgroup\$
0
\$\begingroup\$

you don't render the same game state 4 times but interpolate the state between 2 physics frames

also 15 (visual) FPS just feels laggy you need at least 25ish to feel smooth

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .