en:toolworks:docs:apparatus:steady-tick

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
en:toolworks:docs:apparatus:steady-tick [2021/03/23 19:03] vladiusen:toolworks:docs:apparatus:steady-tick [2021/03/23 22:33] vladius
Line 8: Line 8:
 {{ :en:toolworks:docs:apparatus:ue-tick-event.png?nolink }} {{ :en:toolworks:docs:apparatus:ue-tick-event.png?nolink }}
  
-This technique is fine when you're playing some kind of pre-baked animation where results are clearly determined in time. +This technique is fine when you're playing some kind of pre-baked animation where results are clearly determined in time. Unfortunately that is not always the case, since games are generally interactive and the situation always changes. 
 + 
 +If we apply a variable frame rate to such concepts as collision detection and physics simulation, their stability will decrease considerably if the frame time is increased. Consider the following example. 
 + 
 +We have a ball physics simulation. The ball is stepping its position according to its velocity (which in turn results from gravity and other forces application). When the time step is stable and small enough, everything works as expected, but as soon as the one of the frames lags the system becomes unstable and the ball may actually fall through the ground, resulting in a totally inaccurate behavior. 
 + 
 +{{ :en:toolworks:docs:apparatus:collision-detection-instability.svg |}} 
 + 
 +Our goal would be to stabilize the frame time and in turn stabilize the calculations. 
 + 
 +{{ :en:toolworks:docs:apparatus:stable-collision-detection.svg |}} 
 + 
 +Unreal Engine's physics engine has a way to stabilize the frame rate by supplying the maximum frame time: 
 + 
 +{{ :en:toolworks:docs:apparatus:ue-max-physics-delta-time.png?nolink |}} 
 + 
 +If the actual frame time is higher than this value, the physics engine will still receive this value as its delta time to step with. This in turn will result in a slowdown of game time. Something like a slow-mo effect, but the simulation would not lose its stability, i.e. it won't be lower than the supplied tolerated value. 
 + 
 +Another way to achieve the physics stability effect is to use Unreal Engine's [[https://docs.unrealengine.com/en-US/InteractiveExperiences/Physics/Substepping/index.html|sub-stepping]]. You can read the linked official documentation for more information on that topic. 
 + 
 +Apparatus provides a somewhat similar concept to a sub-stepping that is called "Steady Ticking"
  • en/toolworks/docs/apparatus/steady-tick.txt
  • Last modified: 2021/04/08 22:24
  • by vladius