docs: update mana-conversion-spec with rebalanced cost formulas
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m32s

Update Section 2 (Cost Formula), cost table, Section 8 display example,
and Section 11 formula summary to reflect the new linear cost formulas:
- rawCost: 10^(d+1) → 2×distance
- componentCost: 10×(d+1) → 3×distance

These changes keep the spec in sync with the fix for issue #378.
This commit is contained in:
2026-06-12 12:38:58 +02:00
parent c17a8755ae
commit 58181139d0
3 changed files with 34 additions and 35 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# Circular Dependencies # Circular Dependencies
Generated: 2026-06-12T10:15:03.641Z Generated: 2026-06-12T10:30:18.304Z
Found: 4 circular chain(s) — these MUST be fixed before modifying involved files. Found: 4 circular chain(s) — these MUST be fixed before modifying involved files.
1. 1) data/guardian-encounters.ts > data/guardian-procedural.ts 1. 1) data/guardian-encounters.ts > data/guardian-procedural.ts
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"_meta": { "_meta": {
"generated": "2026-06-12T10:15:01.393Z", "generated": "2026-06-12T10:30:16.054Z",
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
}, },
+32 -33
View File
@@ -42,42 +42,41 @@ All conversions produce **1 unit** of destination mana. The cost depends on the
For a destination element at distance `d`: For a destination element at distance `d`:
- **Raw mana cost** = `10^(d+1)` - **Raw mana cost** = `2 * d`
- Distance 1 (base): `10^2 = 100` raw per 1 element - Distance 1 (base): `2` raw per 1 element
- Distance 2 (composite): `10^3 = 1,000` raw per 1 element - Distance 2 (composite): `4` raw per 1 element
- Distance 3 (exotic): `10^4 = 10,000` raw per 1 element - Distance 3 (exotic): `6` raw per 1 element
- Distance 4 (time): `10^5 = 100,000` raw per 1 element - Distance 4 (time): `8` raw per 1 element
- **Each component mana cost** = `10 * (d + 1)` per 1 destination element - **Each component mana cost** = `3 * d` per 1 destination element
- Distance 1: `10 * 2 = 20` of that element per 1 destination - Distance 2: `6` of that element per 1 destination
- Distance 2: `10 * 3 = 30` of that element per 1 destination - Distance 3: `9` of that element per 1 destination
- Distance 3: `10 * 4 = 40` of that element per 1 destination - Distance 4: `12` of that element per 1 destination
- Distance 4: `10 * 5 = 50` of that element per 1 destination
### Cost Table (per 1 unit of destination mana) ### Cost Table (per 1 unit of destination mana)
| Destination | Distance | Raw Cost | Each Component Cost | Components | | Destination | Distance | Raw Cost | Each Component Cost | Components |
|-------------|----------|----------|---------------------|------------| |-------------|----------|----------|---------------------|------------|
| Fire (base) | 1 | 100 | — | — | | Fire (base) | 1 | 2 | — | — |
| Transference | 1 | 100 | — | — | | Transference | 1 | 2 | — | — |
| Metal | 2 | 1,000 | 30 fire + 30 earth | fire, earth | | Metal | 2 | 4 | 6 fire + 6 earth | fire, earth |
| Sand | 2 | 1,000 | 30 earth + 30 water | earth, water | | Sand | 2 | 4 | 6 earth + 6 water | earth, water |
| Lightning | 2 | 1,000 | 30 fire + 30 air | fire, air | | Lightning | 2 | 4 | 6 fire + 6 air | fire, air |
| Frost | 2 | 1,000 | 30 air + 30 water | air, water | | Frost | 2 | 4 | 6 air + 6 water | air, water |
| BlackFlame | 2 | 1,000 | 30 dark + 30 fire | dark, fire | | BlackFlame | 2 | 4 | 6 dark + 6 fire | dark, fire |
| Radiant Flames | 2 | 1,000 | 30 light + 30 fire | light, fire | | Radiant Flames | 2 | 4 | 6 light + 6 fire | light, fire |
| Miasma | 2 | 1,000 | 30 air + 30 death | air, death | | Miasma | 2 | 4 | 6 air + 6 death | air, death |
| Shadow Glass | 2 | 1,000 | 30 earth + 30 dark | earth, dark | | Shadow Glass | 2 | 4 | 6 earth + 6 dark | earth, dark |
| Crystal | 3 | 10,000 | 40 sand + 40 light | sand, light | | Crystal | 3 | 6 | 9 sand + 9 light | sand, light |
| Stellar | 3 | 10,000 | 40 plasma + 40 light | plasma, light | | Stellar | 3 | 6 | 9 plasma + 9 light | plasma, light |
| Void | 3 | 10,000 | 40 dark + 40 death | dark, death | | Void | 3 | 6 | 9 dark + 9 death | dark, death |
| Soul | 3 | 10,000 | 40 light + 40 dark + 40 transference | light, dark, transference | | Soul | 3 | 6 | 9 light + 9 dark + 9 transference | light, dark, transference |
| Plasma | 3 | 10,000 | 40 lightning + 40 fire + 40 transference | lightning, fire, transference | | Plasma | 3 | 6 | 9 lightning + 9 fire + 9 transference | lightning, fire, transference |
| Time | 4 | 100,000 | 50 soul + 50 sand + 50 transference | soul, sand, transference | | Time | 4 | 8 | 12 soul + 12 sand + 12 transference | soul, sand, transference |
### Key Constraint ### Key Constraint
Raw mana cost is always **greater** than any individual component cost. This is inherent in the formula: `10^(d+1)` for raw vs `10*(d+1)` for each component. Costs are linear with distance, keeping conversions achievable at all game stages. Raw mana cost scales as `2*d` while component costs scale as `3*d` per component.
--- ---
@@ -356,13 +355,13 @@ For each element with active conversions:
│ Effective Rate: 0.50/hr → produces 0.50 fire/hr │ │ Effective Rate: 0.50/hr → produces 0.50 fire/hr │
│ │ │ │
│ Costs (deducted from raw regen): │ │ Costs (deducted from raw regen): │
│ Raw: 100 × 0.50 = 50.0 raw/hr │ │ Raw: 2 × 0.50 = 1.0 raw/hr
│ │ │ │
│ Drained by downstream conversions: │ │ Drained by downstream conversions: │
│ → Metal: 30 × 0.005 = 0.15 fire/hr │ │ → Metal: 6 × 0.005 = 0.03 fire/hr
│ → Lightning: 30 × 0.003 = 0.10 fire/hr │ │ → Lightning: 6 × 0.003 = 0.02 fire/hr
│ │ │ │
│ Net Fire Regen: +0.50 - 0.15 - 0.10 = +0.25 fire/hr │ Net Fire Regen: +0.50 - 0.03 - 0.02 = +0.45 fire/hr │
└─────────────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────────────┘
``` ```
@@ -380,8 +379,8 @@ Where:
meditationMult = 1 + (meditationMultiplier - 1) / elementDistance meditationMult = 1 + (meditationMultiplier - 1) / elementDistance
Cost per 1 unit of destination: Cost per 1 unit of destination:
rawCost = 10^(distance+1) rawCost = 2 × distance
componentCost = 10 × (distance+1) per component componentCost = 3 × distance per component
All costs deducted from source regen (not from mana pool). All costs deducted from source regen (not from mana pool).
Conversions pause if source regen < conversion cost. Conversions pause if source regen < conversion cost.