Redrawn sixty times a second
How Does a Video Game Work?
A game is not a moving picture. It is a still picture, worked out from scratch dozens of times every second.
-
Step 1 of 5
Nothing in a game actually moves.
The character is a set of numbers saying where it is. Each time round the loop the numbers change a little and a new picture is drawn. Fast enough, and your eye reads it as motion.
-
Step 2 of 5
The loop has to finish in time.
At sixty pictures a second, everything — controls, physics, enemies, drawing — must be done in about sixteen thousandths of a second. Miss the deadline and the game stutters.
-
Step 3 of 5
The world is built out of triangles.
Every surface in a three-dimensional game is a mesh of flat triangles with pictures stretched over them. Curves are just triangles small enough that you cannot see the corners.
-
Step 4 of 5
A separate chip does the drawing.
Working out the colour of two million pixels is the same simple sum done two million times. A graphics chip has thousands of small processors doing them all at once, rather than one after another.
-
Step 5 of 5
The rules are chosen, not discovered.
Game gravity, friction and jumping are numbers someone picked because they felt right, not because they are real. That tuning is why one game feels sharp and another feels like treacle.
Games often cheat where it will not be noticed — things far away are drawn crudely, and things behind you are not drawn at all.
The short version
A game reads your controls, recalculates its whole world and redraws the screen — around sixty times a second.
Try it yourself
Wave your hand in front of a screen showing fast motion. The stutter you see is the frames arriving one at a time.
Topics