Friday, January 2, 2026
spot_img

Ask a Recreation Dev


We will construct a frame-agnostic world replace as a result of we will get the present time in milliseconds at the start of every body replace. Meaning we will calculate how a lot actual time has handed for the reason that final body replace and recalculate the brand new world state (physics, animation, VFX, motion, lighting, UI, and so on.). Thus, if it’s been 15 milliseconds for the reason that final body, we all know to advance the state of the world by 15 milliseconds. If we drop a bunch of frames and uncover it’s been 160 milliseconds for the reason that final body replace, we will nonetheless advance the state of the world by 160 milliseconds to maintain timing constant.

image

This scales completely effectively when rising the body fee. As a result of we’re doing extra frames, the body time decreases and we get greater constancy as a result of we see extra body updates than earlier than. Because the world state progresses in actual time, including extra frames makes the whole lot really feel higher at little to no price. However what occurs when the alternative scenario occurs? As an alternative of including extra frames per second, let’s think about the scenario the place {hardware} is confused, inflicting body time to extend and body fee to drop.

image

Issues come from having to parse and deal with inputs relative to the world state. What happens between body updates is successfully atomic – if gamers press a button after which launch it in between body updates, there is no such thing as a method for the sport to register that each occasions occurred whereas updating the world state. When a body replace occurs, we will solely register a button enter as both on or off, regardless of how a lot time has handed in between frames. This will trigger some critical frustration when the sport drops frames!

image

Think about that an enemy throws a short-fused grenade in the midst of a giant visually explosive battle. The sport drops a bunch of frames due to all the stuff on display screen. On the subsequent body replace a half second later, the sport calculates the fuse timer on the grenade has expired and that the grenade has already exploded, killing the participant who has not moved as a result of there was no method for the participant to see the grenade coming and dodge in response to it. To the participant, the sport froze for a half second after which she was useless.

image

We will keep away from the dropped frames drawback if the world state is tied to the body fee. When the participant is assured to see each body, she will be able to nonetheless see each recreation occasion coming – even when the sport’s body fee slows to 30, 20, 15, and even 10 fps. The participant is at all times given an opportunity to react to in-game occasions by locking the world replace to the body fee. For this reason many video games that pushed {hardware} limitations and nonetheless selected to lock a decrease body fee (e.g. 30 fps) on the time of launch most well-liked to lock the world state to the body fee – it was to protect towards the conditions the place the {hardware} was pushed to its limits and builders didn’t need to add extra frustration to an already tense scenario.

[Join us on Discord] and/or [Support us on Patreon]

Bought a burning query you need answered?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles