-2
\$\begingroup\$

I see the problem of the current tick-dependent approach to propel the in-game progression. The drawback of this tick-dependent approach is that if a computer running the game is not powerful enough, or there is so many entity to be ticked, the TPS will drop and overall in-game progress will be slowed down, which will negatively impact the in-game experience and immersion.

If the game used time-dependent approach instead, behavior and progression of any entity in a world will be based only on time, which increments regardless of how fast the computer is.

Imagine of projectile motion. The position of a projectile can be readily calculated by the simple formula which is a function of time, without the need of "repeatedly ticking" the object to the new position.

Also this can apply to any redstone circuits, which has exact operation time for each component. Given a serial connection of redstone repeaters, which, for some given time, can be finded out that which repeater is activated.

I wonder that this approach can be apply to Minecraft (or other video games)?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ "Imagine of projectile motion. The position of a projectile can be readily calculated by the simple formula which is a function of time". It's not that simple. A zombie might walk into its path and stop it, or might get killed by something else before it does. You won't know if the arrow arrives at its destination or not unless you simulate the whole world around it. \$\endgroup\$
    – Philipp
    Jan 7, 2021 at 2:05
  • \$\begingroup\$ Does this answer your question? When should I use a fixed or variable time step? \$\endgroup\$
    – Philipp
    Jan 7, 2021 at 2:07

1 Answer 1

0
\$\begingroup\$

Yes, up to a point. In practice, no.

This is due to the butterfly effect. In a system with enough interacting elements, there is not one simple formula that will predict its state \$t\$ seconds from now. The system starts to exhibit what's called chaotic behaviour, where small perturbations in the state (like from a tiny integration error or rounding of an intermediate result) lead to large deviations in its future trajectory.

This is easy to see when we consider huge timesteps. Could the computer simulate in one tick what your Minecraft world would look like a full year from now? Obviously not - there's too much that could occur in that timespan. So any prediction we make in a single tick is likely to contain errors. That same argument applies, in diminishing degrees, to every timestep longer than a single tick.

The further you move something in a single step (to account for more time passed), the greater the chance that you skip over and miss a collision that should have happened along the way, a physics glitch we call "tunnelling". There are more expensive ways to reduce missed collisions, but even they don't guarantee you'll get exactly the same results at any time interval — even just rounding to a finite precision for storage is enough to break this.

That means you could load the same Minecraft save on a fast computer and on a slow computer, sit there without affecting the system in any way, and see two different sequences of events play out. Players get different gameplay outcomes depending on their hardware!

The only way to guarantee you get consistent results is to run your simulation consistently: using the same step size/frequency.

This is why many games implement what's called a fixed timestep (equivalent to a standardized simulation tick) - to ensure that no matter how fast or how slow your computer runs, you still get the same gameplay behaviour, so players on all kinds of hardware can play and be treated fairly (even if players on slower machines get choppier performance - at least they're playing the same game with the same eventual simulation results).

\$\endgroup\$
2
  • \$\begingroup\$ I think the fixed timestep thing may work well for minecraft. What is your opinion? \$\endgroup\$
    – armamoyl
    Jan 7, 2021 at 5:24
  • 2
    \$\begingroup\$ @armamoyl - a tick is a fixed timestep; that's what Minecraft already does. The problem is not the lack of timing (e.g., it already measures time to determine when a tick has elapsed - you don't get speedups on fast computers). The problem is that a slow computer simply can't keep up because it's busy doing calculations, and by the time they are done too much time has passed. So if the computer is slow, whatever you do, you either get a slowdown, or strange nondeterministic behavior - skips that send you flying across the map at high speeds, or put you inside a wall, or whatever. \$\endgroup\$ Jan 7, 2021 at 6:14

You must log in to answer this question.

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