How a 2D map became a wall-filled screen

A ray-casting engine could treat a room as a map of empty spaces and solid walls rather than as a fully built 3D world. For each vertical slice of the screen, it sent an imaginary ray outward from the player’s position, angled slightly differently for each slice. The first wall a ray reached determined what that part of the view should show.

The crucial step was projection: the engine used the distance to the wall to calculate how tall its slice should appear. A nearby wall filled more of the screen; a distant one shrank. The engine then painted that narrow strip with the appropriate part of a wall texture. Repeating the calculation across the screen assembled a scene from many flat strips.

A clever shortcut with visible limits

Because the map was two-dimensional, the engine did not have to calculate and draw every surface of a three-dimensional model. That made fast, first-person movement possible on hardware with tight computing limits. The trick worked especially well for corridors and rooms whose walls stood upright.

It also shaped what those games could depict. A wall was essentially a vertical face extending from floor to ceiling, so sloping walls and stacked floors were difficult or impossible to represent in the same way. The engine could create a convincing sense of distance, but its world was built from a carefully chosen set of visual shortcuts. The illusion came not from rendering a complete 3D room, but from calculating just enough wall information to make each screen column agree with the player’s viewpoint.