Quantum Dice: Design Deep Dive
Building a quantum-themed roguelike that teaches probability through dice mechanics and glyph collection
The premise
What if dice could roll anything?
Take a six-sided die and add a seventh face - the quantum face. When it comes up, the result pulls from a pool of glyphs you've collected: playing cards, Roman numerals, runes, photons. A simple dice game becomes a roguelike deck-builder with genuine depth around probability and expected value.
Design Philosophy: Familiar Foundation, Strange Expansion
The Seven-Sided Die
The game begins with an impossible object: a seven-sided die. Six faces show the familiar pip patterns (1-6), while the seventh displays the quantum glyph. This immediately signals to players that the normal rules of probability are about to be bent.
Why Seven Sides Matters:
- Probability intuition: Players know a d6 has ~16.7% per face. Adding one face changes everything.
- The quantum face probability: At game start, there's a 1/7 (~14.3%) chance to hit the quantum outcome.
- Rarity creates value: Because quantum rolls are less common, they can afford to be more powerful on average.
- Familiar anchor: The six standard faces provide predictable, learnable outcomes to ground the experience.
The Roguelike Loop
Each run follows a simple structure: roll dice to reach a target score within a limited number of rolls. Hit the target, and you advance to the next level with an opportunity to add new glyphs to your quantum pool. Fail, and the run ends.
This structure creates natural tension between several design goals:
- Short-term optimization: Maximizing score with current rolls
- Long-term pool building: Choosing glyphs that synergize across runs
- Risk assessment: Deciding when to rely on the quantum face's potential
Glyph Systems: Intersecting Probability Spaces
The Glyph Schema
Every glyph in Quantum Dice follows a consistent data structure that enables flexible mechanics while maintaining predictability:
glyph = {
type: "dice" | "quantum" | "roman" | "cards" | ...,
value: number,
sprite: number,
effect?: function // optional modifier
}
This schema allows for multiple value systems to coexist on the same probability distribution. When the quantum face is rolled, the game samples from the player's accumulated quantum glyph pool, which can contain glyphs from entirely different number systems.
Glyph Categories by Design Intent
Standard Dice (Baseline)
Values: 1, 2, 3, 4, 5, 6
The anchor. Players understand these intuitively. Expected value: 3.5. These provide the reliable floor of score generation and teach the core mechanic.
Playing Cards (High Variance)
Values: Jack (11), Queen (13), King (13), Ace (14)
Cards offer higher values but introduce suit-based visual complexity. The Ace-high convention rewards players who recognize card game patterns. Adding cards to the quantum pool shifts expected value upward but increases variance.
Roman Numerals (Educational Scale)
Values: I (1), II (2), III (3), IV (4), V (5), VI (6), VII (7), VIII (8), IX (9), X (10), L (50), C (100), M (1000)
Roman numerals introduce exponential value scaling. Getting "M" in your quantum pool is a massive score spike - but it dilutes probability for lower-value numerals. This creates a genuine expected value calculation problem for players to solve intuitively.
Runes (Boon Triggers)
Values: 1 point each, but unlock permanent bonuses when paired
Runes like Sowilo and Fehu score minimally on their own but unlock the "Sun's Radiance" boon when both appear in a run's history. This creates a metagame layer where low-value glyphs become strategically crucial.
Photons (Entanglement)
Values: 2 points base, +2 bonus if partner photon is in pool
Alpha and Beta photons are "entangled" - having both in your pool grants a +2 bonus when either is rolled. This directly teaches quantum entanglement concepts through game mechanics: correlated outcomes across paired entities.
Superposition: Probability Within Probability
The Collapsing Glyph
Superposition glyphs exist in multiple states simultaneously until observed (rolled). When a superposition glyph comes up, the game animates through potential outcomes before "collapsing" to a single result. This isn't just visual flourish - it's a direct representation of wavefunction collapse.
Superposition Glyph Examples:
- Dice|Card: Collapses to either a random dice face (1-6) or a random card (1-13)
- Dice|Rune: Collapses to either a dice face or a rune (1 pt + boon potential)
Adding a superposition glyph to your pool effectively adds multiple glyphs to your probability distribution. The Dice|Card glyph has an expected value of approximately 4.75 (averaging dice's 3.5 and cards' 6.0), but with much higher variance than either system alone.
Educational Design Intent
Players naturally begin calculating: "Should I add this superposition glyph, or a specific high-value card?" This creates organic engagement with compound probability concepts:
- Conditional probability (what are my chances given I hit the quantum face?)
- Expected value across nested distributions
- Variance as a strategic consideration
- The trade-off between predictability and potential
The Boon System: Emergent Synergies
Unlockable Permanent Bonuses
Boons reward players for collecting specific glyph combinations across a run. Unlike loot selection (which is immediate), boon unlocks require rolling specific glyphs during gameplay.
Boon Unlock Conditions:
Requires: Rolling both Sowilo and Fehu in same run
Effect: All dice faces score +2 points
Requires: Rolling both Laguz and Ansuz in same run
Effect: +1 maximum roll per round
Design Tension
The boon system creates a fascinating strategic tension:
- Adding runes dilutes your pool: Runes only score 1 point, so adding them to enable boons lowers your immediate expected value
- Both runes must be rollable: Having both in your quantum pool doesn't guarantee you'll roll both in a single run
- Boons persist across rounds: Once unlocked, the bonus applies for the rest of the run, potentially justifying the early investment
- Compound effects: Sun's Radiance makes the standard dice faces more competitive with exotic glyphs
Progression & Scaling
Round Structure
The game uses a carefully tuned difficulty curve:
| Round | Max Rolls | Target Score | Required Avg |
|---|---|---|---|
| 1 | 7 | 15 | 2.14/roll |
| 2 | 10 | 22 | 2.2/roll |
| 3 | 12 | 29 | 2.42/roll |
| 4+ | 15 | +7 per round | Escalating |
Notice that early rounds require below-average dice rolls to complete (expected value of a d6 is 3.5). This ensures new players can progress while learning the systems. Later rounds require players to have built pools with higher expected values - the quantum expansion becomes necessary, not optional.
Loot Selection as Pool Building
After each successful round, players choose one of three random glyphs to add to their quantum pool. This creates the core roguelike tension:
- Pool size matters: More glyphs = more diluted probability for any specific one
- Synergy hunting: Taking that second rune now might enable a boon later
- Variance management: High-value glyphs increase ceiling but also variance
Implementation Notes
Platform Evolution
Quantum Dice was originally developed for PICO-8, a fantasy console with severe constraints (128x128 pixels, 16 colors, Lua scripting). The web version preserves the core mechanics while expanding the visual and audio presentation.
State Machine Architecture:
Both versions use an explicit state machine pattern with states for: menu, play, ascend (round end evaluation), loot selection, animation (superposition collapse), and game over. This clean separation makes the game logic easy to reason about and extend.
The Repeat Bonus System
An interesting mechanic from the original: rolling the same value twice in a run doubles the score for that roll. This creates situations where "lucky streaks" feel meaningful and adds another layer of probability for players to track mentally.
function check_for_repeat()
local hit_counter = 0
for v in all(roll_history) do
if (v.value == outcome_value) then
hit_counter += 1
end
end
return {hit = hit_counter > 0, amount = hit_counter}
end
Educational Design Insights
Teaching Through Play
Quantum Dice succeeds as educational design because it never lectures. Players naturally develop intuition about:
- Expected value: "Is adding this glyph actually helping my average?"
- Probability distribution: "What are my realistic outcomes from this pool?"
- Variance: "Can I afford high-variance plays right now, or do I need consistency?"
- Compound probability: "If I hit quantum, then what are my odds of getting a good result?"
- Quantum concepts: Superposition (multiple states until observed) and entanglement (correlated outcomes)
The "Aha" Moments
The best educational games create moments of genuine discovery. In Quantum Dice, these include:
- Realizing that adding too many glyphs dilutes your pool
- Discovering boon synergies through experimentation
- Understanding why the M (1000) Roman numeral isn't always the best choice
- Recognizing that superposition glyphs compound uncertainty
Future Design Directions
Potential Expansions:
- Curse glyphs: Negative values that could be strategically useful with multiplication effects
- Glyph removal: Allow players to prune their pools, creating deck-thinning strategies
- Multi-die pools: Multiple dice with different quantum pools running in parallel
- Observer effects: Mechanics where "looking" at certain outcomes changes them
- Quantum tunneling: Rare chance to skip past impossible targets