Skip to main content
QUICK REVIEW

[Paper Review] Explaining the Entombed Algorithm

Leon Mächler, David Naccache|arXiv (Cornell University)|Apr 18, 2021
Artificial Intelligence in GamesComputer Science1 references1 citations
TL;DR

This paper explains the long-standing mystery of the Entombed Game's maze-generation algorithm by revealing that its lookup table enforces three invariants: no 2×2 blocks of the same type, no thickness-one walls or paths, and vertical path connectivity. The algorithm uses a 5-bit local context to make decisions that preserve these invariants, with one exception resolved by a conflict-preventing rule. The method is extended to 3D mazes using a 10-bit context and similar invariants, maintaining structural coherence while allowing controlled randomness.

ABSTRACT

In \cite{entombed}, John Aycock and Tara Copplestone pose an open question, namely the explanation of the mysterious lookup table used in the Entombed Game's Algorithm for two dimensional maze generation. The question attracted media attention (BBC etc) and was open until today. This paper answers this question, explains the algorithm and even extends it to three dimensions.

Motivation & Objective

  • To resolve the open question of how the 1982 Atari Entombed game's lookup table generates playable mazes using only local 5-bit context.
  • To explain the seemingly arbitrary decisions in the lookup table by identifying underlying structural invariants.
  • To extend the 2D maze generation algorithm to three dimensions while preserving the same invariant-based logic.
  • To demonstrate that the algorithm's success stems from consistent enforcement of invariants, even when context values fall outside the maze.

Proposed method

  • The algorithm uses a 5-bit context (two left, three above) to determine whether the next cell is a wall (1) or path (0), with decisions precomputed in a lookup table.
  • Three invariants govern the decisions: no 2×2 blocks of same type, no isolated walls or paths of thickness one, and all paths must be vertically connected to the next line.
  • When both choices (0 or 1) satisfy all invariants, a random decision is made; otherwise, the choice that avoids invariant violation is selected.
  • A conflict arises in the context 01001, where invariant 2 demands a 1 and invariant 3 demands a 0; this is resolved by adding a rule that prevents the context from ever occurring.
  • The 3D extension uses a 10-bit context including depth neighbors, with the same three invariants applied across a 3D grid structure.
  • Conflict-preventing rules are added to avoid situations where invariants contradict each other, with 28 such conflicts identified in 3D, 75% of which are resolved.

Experimental results

Research questions

  • RQ1What is the underlying logic behind the seemingly arbitrary lookup table used in the Entombed Game’s maze generation?
  • RQ2How does the algorithm ensure that generated mazes remain playable and connected using only local 5-bit context?
  • RQ3Why does the algorithm avoid creating isolated paths or walls of thickness one, and how is this enforced?
  • RQ4Can the 2D invariant-based algorithm be generalized to three-dimensional maze generation?
  • RQ5What happens when multiple invariants conflict, and how is the resulting inconsistency resolved?

Key findings

  • The lookup table in the Entombed Game is fully explained by three structural invariants: no 2×2 blocks, no thickness-one walls or paths, and vertical path connectivity.
  • The algorithm resolves the only known invariant conflict (context 01001) by adding a rule that prevents the context from ever arising, ensuring consistent path connectivity.
  • The 3D extension uses a 10-bit context and maintains the same three invariants, resulting in 1024 possible context combinations.
  • In the 3D case, 28 conflicting contexts were identified, of which 75% were resolved using conflict-preventing rules, leaving only 0.7% of contexts that may violate an invariant.
  • The choice of auxiliary values (e.g., a=0, b=1, e=random) explains why some mazes contain disconnected paths, as the external context may not match the actual maze state.
  • The method is robust and extensible: it can be applied to higher dimensions by increasing the context size and adding conflict-resolving rules.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.