The 2.5D kits
How the first-person and Mode-7 kits work, and how to retune them.
8 min readThe kits filed under 3D are pseudo-3D. There is no 3D engine underneath — they use the same 2D renderer as everything else, with techniques that were invented precisely because 3D hardware did not exist yet. They are fast, they run everywhere, and they are far easier to reason about than a real scene graph.
Raycasting — First-Person Maze, Blank 2.5D
The world is a grid. For every vertical column of pixels on screen, a ray is cast until it hits a wall; the distance decides how tall to draw that column. Near walls are tall, far walls are short, and that alone produces perspective. This is how Wolfenstein 3D worked.
Behaviour: raycastRenderer
resolution 320 internal width; lower is faster and blockier
fov 66 field of view in degrees
viewDistance 20 how many cells before it fades out
ceiling/floor colours above and below the horizon
Movement uses firstPersonController, which resolves each axis separately — so walking diagonally into a wall slides you along it instead of sticking.
Mode-7 — Kart Racer, Rail Shooter, Endless Runner
A flat top-down image is sampled one screen row at a time. Each row stands for a fixed distance ahead of the camera, and rows nearer the horizon sample a wider span of the map. The result is a ground plane in perspective. The SNES did this in hardware.
Behaviour: mode7Renderer
track which texture to project
wrap true = tiles forever (runner, shooter)
false = a finite map (the kart circuit)
cameraHeight how high the camera sits
focalLength with cameraHeight, sets how fast the ground recedes
horizon 0..1, where the horizon sits on screen
drawDistance beyond this, ground fades into haze
billboardTag which tag gets drawn as approaching sprites
Billboards
Other karts, enemies and obstacles are ordinary 2D sprites scaled by distance. They are drawn by a separate proxy image, so the entity itself stays where its AI put it in the top-down world — the projection never moves the real thing.
Retuning them
Because the karts still drive around a normal top-down world, everything you know about the 2D racer applies: the same handling values, the same lap logic, the same AI. Only the camera differs. Select the renderer entity and change its settings in the inspector.