🕹 ENTERTAINMENT · the arcade · the algorithms behind the fun · kept by THE CABINET

THE RAYCAST ◧ 2D · ◍ 3D · ◆ 4D · ◐ shadow · 👶 TAP

Wolfenstein and Doom faked 3-D on a machine that couldn’t do it: from a flat map, cast one ray per screen column, measure how far to the wall, and draw a slice as tall as the wall is near. A whole corridor from a grid and a little trigonometry. Turn (or tap) and walk the walls.

◆ LIT▲ AMBER
◧ THE MEASURE · 2D
◍ THE FANS · 3D · the rays, cast around
◆ THE FOURTH · 4D · a tesseract turns
◐ THE SHADOW · one dimension down
👶 THE TODDLER CORNER — one fat tap
facing
rays cast
96
nearest wall
the view

◆ LIT — exact / checkable

Grid raycasting, the Wolfenstein-3D engine. From the player's position, cast one ray per screen column across a field of view; a DDA (digital differential analyser) steps the ray cell by cell until it hits a wall, giving the exact distance. A wall slice is drawn with height ∝ 1/distance (nearer = taller), and the perpendicular distance is used so straight walls stay flat (no fisheye). It is real trigonometry faking a third dimension. A fail-loud self-check throws unless a ray fired straight at a wall a known distance away returns that distance.

▲ AMBER — the figure

A small fixed grid map, axis-aligned walls, flat shading (real engines add textures, sprites, floors); FOV and step count are illustrative. The DDA traversal and the 1/distance projection are computed exactly.

ENTERTAINMENT: every game is a loop that lies to you sixty times a second.  — THE CABINET
David Lee Wise / ROOT0 / TriPod LLC  ·  the arcade row, with AVAN