History & Industry
Colossal Cave by the numbers: what Open Adventure's data file says about the first adventure game
Counted from the open-source data file: 184 locations, a median description of 12 words, 623 movement rules, 20 treasures and 10 hints with point penalties.
Colossal Cave Adventure is often described in a sentence: a cave, some treasure, a parser. The open-source revival of the game, Open Adventure, keeps all of its content in one structured data file, which means the game’s size and shape can be counted instead of described. This article counts them. It is about one specific file, and we say below what that does and does not tell you about the original game.
What the file is
The file is adventure.yaml, maintained by Eric S. Raymond. Its own header says it is processed into data structures for the game and that it replaces an ad hoc text database shipped with Adventure versions up to 2.5. It carries a BSD-2-Clause licence notice. We downloaded it on 2026-11-07 and read it with a small script rather than by hand. We report counts and give no long quotations from the game text.
The file is a modern restructuring of the game, so these are counts of Open Adventure’s data, not a verified census of the 1970s original. We did not compare the two.
Rooms and how much is said about each
The locations section has 184 entries once the placeholder entry for “nowhere” is set aside. One of the 184 has an empty long description, which leaves 183 with text. Together they hold 3,770 words (splitting on whitespace).
| Words in the long description | Locations | Share |
|---|---|---|
| 1 to 10 | 57 | 31.1% |
| 11 to 20 | 60 | 32.8% |
| 21 to 40 | 49 | 26.8% |
| 41 or more | 17 | 9.3% |
The mean is 20.6 words but the median is 12, because a few rooms are long. Rooms of 20 words or fewer number 117 of 183, which is 63.9%. The five longest descriptions have 224, 132, 96, 87 and 87 words. In other words, about two rooms in three are a sentence or two, and the writing effort is concentrated in a handful of set pieces.
The header explains that a location may have a short description and that, if it has none, the long one is used. In the file, 107 of the 184 entries (58.2%) have no short description, so for those rooms the player sees the full text on every visit.
Movement
The locations carry 623 movement rules in total, an average of 3.39 per location with a median of 3 and a maximum of 12. The smallest number is 1, so every location has at least one movement rule; a room with a single rule has only one way out.
Mazes are visible in the data. 27 entries carry the flag the header describes as “part of the maze all alike” and 12 carry the one for the maze “all different”, a total of 39, or 21.2% of the entries. The all-alike rooms average 2.63 movement rules, against 3.03 for the rooms that are in neither maze. Roughly one location in five is flagged as part of a maze.
Things and points
| Item | Count |
|---|---|
| Objects | 69 |
| Objects flagged as treasure | 20 |
| Objects flagged immovable | 33 |
| Hints | 10 |
The ten hints each carry a point penalty for asking: 2, 2, 2, 4, 5, 3, 2, 2, 4 and 4, which adds up to 30. The file also holds the score thresholds for the player’s rank: nine finite thresholds at 45, 120, 170, 250, 320, 375, 410, 426 and 429, plus a zero entry and a final open-ended one. The highest finite threshold is 429, which gives a sense of the scale of the scoring system, though we did not work out the maximum possible score.
What this suggests for someone writing a text game
- Most rooms can be short. In this file nearly two-thirds of the rooms take 20 words or fewer. Reserve length for places the player must remember.
- A maze is a design decision, not an accident. One room in five is dedicated to it, and it has fewer exits per room than the rest.
- Hints can cost something. The game charges points for each of its ten hints, which makes the choice to ask visible.
These are observations about one game. We make no claim that they hold for text games in general.
Limits
- Our reader is a pattern-matching script, not a YAML parser. It uses the section names given in the file’s header, but any entry that does not fit the pattern could be miscounted.
- The “treasure” and “immovable” flags are counted as the file marks them. We did not check that the 20 treasures are the ones a player would list.
- Word counts include only the long description, not other messages in the file.
- We did not play the game to compare the data with the experience.
How we calculated
Download the file with curl -sL -o adventure.yaml https://gitlab.com/esr/open-adventure/-/raw/master/adventure.yaml and run the script below on it, using Python 3.
# Counts from Open Adventure's adventure.yaml (BSD-2-Clause, gitlab.com/esr/open-adventure), downloaded 2026-11-07.
# Regex-based reader, no YAML library; usage: python3 e1.py adventure.yaml
import re, sys, statistics as st
L = open(sys.argv[1], encoding="utf-8").read().split("\n")
def sect(name, nxt):
a = next(i for i, l in enumerate(L) if l.startswith(name + ":"))
b = next(i for i, l in enumerate(L) if i > a and l.startswith(nxt + ":"))
return L[a+1:b]
def blocks(lines):
out, cur = [], None
for l in lines:
m = re.match(r"^- ([A-Z0-9_]+):", l)
if m: cur = [m.group(1), []]; out.append(cur)
elif cur: cur[1].append(l)
return out
locs = [b for b in blocks(sect("locations", "dwarflocs")) if b[0] != "LOC_NOWHERE"]
rows = []
for name, body in locs:
t = "\n".join(body)
m = re.search(r"long: (?:\|-\n((?:\s{8,}.*\n?)+)|'((?:[^']|'')*)')", t)
words = len(((m.group(1) or m.group(2) or "") if m else "").split())
has_short = not re.search(r"short: !!null", t)
cm = re.search(r"conditions: \{(.*?)\}", t)
flags = set(re.findall(r"([A-Z]+): true", cm.group(1))) if cm else set()
rows.append((name, words, has_short, flags, len(re.findall(r"\{verbs:", t))))
print("location entries (without LOC_NOWHERE):", len(rows))
W = [r[1] for r in rows if r[1] > 0]
print("entries with a long description:", len(W), "| words total", sum(W), "| mean", round(st.mean(W), 1), "| median", st.median(W), "| max", max(W))
for a, b in ((1, 10), (11, 20), (21, 40), (41, 10**6)):
n = sum(1 for w in W if a <= w <= b); print(f" {a}-{b if b < 10**6 else '+'} words: {n} ({n/len(W)*100:.1f}%)")
le20=sum(1 for w in W if w<=20); print(f"20 words or fewer: {le20} of {len(W)} ({le20/len(W)*100:.1f}%)")
print("longest five descriptions (words):", sorted(W, reverse=True)[:5])
print("no short description:", sum(1 for r in rows if not r[2]), f"({sum(1 for r in rows if not r[2])/len(rows)*100:.1f}%)")
maze = sum(("ALLALIKE" in r[3]) or ("ALLDIFFERENT" in r[3]) for r in rows)
print("ALLALIKE", sum("ALLALIKE" in r[3] for r in rows), "ALLDIFFERENT", sum("ALLDIFFERENT" in r[3] for r in rows), "maze entries", maze, f"({maze/len(rows)*100:.1f}%)", "| LIT", sum("LIT" in r[3] for r in rows), "| NOBACK", sum("NOBACK" in r[3] for r in rows))
EX = [r[4] for r in rows]
print("movement rules:", sum(EX), "| mean per location", round(st.mean(EX), 2), "| median", st.median(EX), "| min", min(EX), "| max", max(EX))
print("mean rules, ALLALIKE rooms:", round(st.mean([r[4] for r in rows if "ALLALIKE" in r[3]]), 2), "| other rooms:", round(st.mean([r[4] for r in rows if not (("ALLALIKE" in r[3]) or ("ALLDIFFERENT" in r[3]))]), 2))
objs = [b for b in blocks(sect("objects", "obituaries")) if b[0] != "NO_OBJECT"]
print("objects:", len(objs), "| treasures", sum("treasure: true" in "\n".join(b[1]) for b in objs), "| immovable", sum("immovable: true" in "\n".join(b[1]) for b in objs))
hs = "\n".join(sect("hints", "locations"))
pen = [int(x) for x in re.findall(r"penalty: (\d+)", hs)]
print("hints:", len(pen), "| penalties", pen, "| sum", sum(pen))
print("rank thresholds in 'classes':", re.findall(r"threshold: (\d+)", "\n".join(sect("classes", "turn_thresholds"))))
Output:
location entries (without LOC_NOWHERE): 184
entries with a long description: 183 | words total 3770 | mean 20.6 | median 12 | max 224
1-10 words: 57 (31.1%)
11-20 words: 60 (32.8%)
21-40 words: 49 (26.8%)
41-+ words: 17 (9.3%)
20 words or fewer: 117 of 183 (63.9%)
longest five descriptions (words): [224, 132, 96, 87, 87]
no short description: 107 (58.2%)
ALLALIKE 27 ALLDIFFERENT 12 maze entries 39 (21.2%) | LIT 37 | NOBACK 50
movement rules: 623 | mean per location 3.39 | median 3.0 | min 1 | max 12
mean rules, ALLALIKE rooms: 2.63 | other rooms: 3.03
objects: 69 | treasures 20 | immovable 33
hints: 10 | penalties [2, 2, 2, 4, 5, 3, 2, 2, 4, 4] | sum 30
rank thresholds in 'classes': ['0', '45', '120', '170', '250', '320', '375', '410', '426', '429', '9999']
Sources
- Open Adventure,
adventure.yaml, GitLab (esr/open-adventure), opened 2026-11-07: https://gitlab.com/esr/open-adventure/-/raw/master/adventure.yaml
This article is written for: Người đọc muốn biết cấu trúc thật của Colossal Cave (số địa điểm, độ dài mô tả, lối đi, kho báu, gợi ý) tính từ dữ liệu mở, để hiểu cách một game chữ đầu tiên được thiết kế.
AI assistance recorded as: AI draft, not edited. Review status: approved.