Sortis: A Pen-and-Paper Empire Game with Procedural Generation
Sortis is a solo empire-building game played entirely with pen and paper. It achieves the emergent complexity of a procedural digital game like Minecraft by utilizing computer science primitives—specifically Linear Feedback Shift Registers (LFSR) and XOR operations—to generate a map and manage resource progression without requiring a computer or calculator.
Procedural Map Generation via LFSR
Sortis uses a single-byte LFSR to create a 256x256 grid world without needing dice. The map is generated by XORing two independent random number sequences (one for the X-axis and one for the Y-axis).
The Generation Algorithm
To generate the map, the player picks two seeds (0x0 to 0xFF) for X and Y. The sequences are stepped using the following formula:
$$\text{step}(s) = ((s \ll 1) & \text{0xFF}) \mid (b_{8} \oplus b_{7} \oplus b_{2} \oplus b_{1})$$
For any square $(x, y)$, the terrain value $v$ is the XOR of the $x$-th number in the X sequence and the $y$-th number in the Y sequence:
$$v(x, y) = \text{LFSR}^{x}(s_{x}) \oplus \text{LFSR}^{y}(s_{y})$$
Terrain Classification
Terrain is determined by the resulting value $v$:
| Value | Terrain |
|---|---|
| $v < \text{0x75}$ | Water |
| $\text{0x75} \leq v < \text{0xE0}$ | Forest |
| $v \geq \text{0xE0}$ | Mountain |
Because of the XOR correlations, the map naturally forms geographic clusters such as lakes and mountain ranges. To speed up generation, players only need to calculate the first nibble of the value to determine the terrain, unless the value is in the 0x70s or 0xE0+ range.
Ore Distribution
Ore levels in mountains are determined by the number of trailing zeros in the binary representation of the square's value. For example, a value of E0 (binary 11100000) has five trailing zeros, making it ore(5). This ensures that higher-grade ore is exponentially rarer than lower-grade ore.
Game Mechanics and Resource Progression
The objective of Sortis is to upgrade a workshop to the highest possible level. Progression is gated by resource costs that scale exponentially ($2^{n}$).
Building Types and Costs
Buildings require a workshop of at least the same level to be constructed, and the agent performing the build must have visited a workshop of that level to be "authorized."
| Building | Primary Resource | Cost Formula | Requirement |
|---|---|---|---|
| Workshop | ore(n) | $2^{n}$ | Cleared land |
| House | wood | $2^{n}$ | Cleared land |
| Extractor | tile resource | $2^{n}$ | Forest (wood) or Mountain (ore) |
| Smelter | ore(n) | $2^{n}$ | Cleared land |
| Road | ore(d) | 1 per square | Cleared land or water (bridge) |
Resource Production and Smelting
- Extractors: An operated extractor of level $n$ produces $n + 1$ units per turn.
- Smelters: To bypass natural ore limits, smelters convert lower-grade ore into higher-grade ore. A smelter L(n) consumes $2^{n}$ ore(n) and $2^{n+1}$ wood to produce 1 ore(n+1). The output is available the turn after inputs are provided.
Computational Reducibility and Turn Management
Sortis is designed around the concept of "computational reducibility," allowing players to project future states without simulating every individual turn.
Skipping Turns
Instead of adding resources turn-by-turn, players use closed-form formulas to calculate totals over long periods. This allows the player to skip ahead hundreds of turns to the point where a genuine strategic change is required.
Agent Tracking
Agents are tracked via an append-only log. For agents moving in cycles (e.g., ferrying resources between two points), their position is recorded as a modulo function of the turn number $t$. This allows the player to determine an agent's exact location at any future turn instantly.
Community Insights and Clarifications
Discussion among players has highlighted several technical nuances and potential ambiguities in the initial ruleset:
- Ore Tier Calculation: While the text mentions hex trailing zeros, the examples (e.g., E0 = ore(5)) confirm that ore levels are based on binary trailing zeros.
- LFSR Accuracy: Community members noted a potential discrepancy in the worked example for the X-sequence seed 0x01, suggesting the feedback bit calculation for
step(0x0D)should result in1Brather than1A. - Resource Paradox: A point of confusion raised by players is the starting condition: since mines and workshops cost ore(0), but players start with no resources and only clearing forests yields wood, the method for obtaining the first unit of ore(0) requires clarification.
- Vehicle Capacity: The formula "2N slots" for vehicle capacity was questioned, as a level-0 vehicle would have zero capacity; users suggest $2(N+1)$ or $2^{N}$ as more logical alternatives.