hn.today

Show HN: Entombed in a Raycaster

stelabouras.com4 points0 comments
Screenshot of Show HN: Entombed in a Raycaster

Entombed's maze generator is a compact, idiosyncratic algorithm from an Atari 2600 game that builds each row of a scrolling maze using only local information and a five-bit lookup table. Each new cell is computed from two left neighbors and three from the row above, producing wall, passage or a random coin-flip outcome; that minimal, sliding-window approach allowed the maze to be generated one line at a time within the 128-byte RAM constraint. Because it never holds the full grid and offers no global solvability guarantees, the routine relies on correction passes after a row is completed to erase or trim lines that create repeats or isolated regions. The algorithm's mysterious lookup mapping and unconventional neighborhood made it a subject of game-archaeology, with researchers tracing its origin to a napkin-sketch solution implemented quickly on hardware.

A developer reimplements this logic inside a raycasting engine to create a Wolfenstein-like first-person maze that is procedurally generated as the player advances. Rows are stored as uint32 bitfields, the playfield is widened to 30 cells and mirroring is dropped, and rows are retained rather than discarded. Player and enemy wall-breaking is added, and several entity-sticking corner cases were fixed on top of a 3DSage-derived C codebase. A Three.js browser port with visual effects and a minimap was also produced for easy play; source and demo are available. The project demonstrates how an ancient, locally driven maze generator can be repurposed for modern real-time rendering while preserving its odd, emergent behavior.

Read on stelabouras.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.