I don’t know if I’m explaining this right…
A computer can run logic at some speed based on how powerful the components of it are, so if it can perform the logic of something, for example, movement in a game, how does it know how much should be done based on its power, instead of essentially running in “fast-forward” or conversely in slow motion?
In: 1307
It’s called a game loop.
Think of it as a chess game. There is a set time (for example 1/60 frame of a second) that the chess players will switch turns. They don’t want to do it faster, so that the game speed will be consistent, and the players can interact with eacother in a predictable way (predictable lag).
The other player (the computer) will do multiple different things (render the things on screen, prepare possible interaction) in preparation for the other player (you). If they are quicker (more processing power), before when your turn starts, they can provide more information (more graphical frames per second, for example).
Then It’s your turn, and an internal ticker will move to the next “tick” in the loop, starting the process again.
Ps. Interesting anecdote. Space Invaders, a very famous (one of the earliest) game did speed up when you got to nearer to the end (less enemies on screen, no fixed loop, game responded faster). The developers considered it as a part of the gameplay loop then, to make the game harder at the end stage.
Latest Answers