DATABASE / FORMULAS
Formula Reference
No derivations, just conclusions. All formulas can be found in OpenFrontIO/src/core/configuration/Config.ts.
⚠ Reading Notes
Formulas use in-game variable names (tick, tiles, troops).
10 ticks ≈ 1 second. Constant DEFENSE_DEBUFF_MIDPOINT = 150,000 tiles from source.
- Plains terrain
- mag = 80, speed = 16.5
- Highland terrain
- mag = 100, speed = 20
- Mountain terrain
- mag = 120, speed = 25
- Defense Post bonus
- Within 30 tiles: mag ×5, speed ×3
- Fallout-zone penalty
- mag *= (5 - falloutRatio × 2)
- Large-army sigmoid penalty
- defenseSig = 1 - sigmoid(defender.tiles, ln(2)/50000, 150000)
- Betrayal penalty
- Defense ×0.5, Speed ×0.8, duration 300 ticks (30s)
- Large-attacker bonus
- When tiles > 100k: bonus = (100k/tiles)^0.7
- Population cap base
- 2 × (0.6 × tiles^0.6 × 1000 + 50,000) + Σ(cityLevel × 250,000)
- Population type multiplier
- Human ×1 / Bot ÷3 / Nation Easy ×0.5, Med ×0.75, Hard ×1, Imp ×1.25
- Troop growth rate
- toAdd = (10 + troops^0.73 / 4) × (1 - troops / maxTroops)
- Base gold income
- Players 100 / tick, Bots 50 / tick (× goldMultiplier)
- City troop bonus
- Each City level provides +250,000 troop cap
- Train revenue
- baseGold (ally 35k / team 25k / self 10k) − distPenalty (5,000 × max(0, citiesVisited − 9)), floor 5,000
- Trade ship revenue
- floor( (75,000 / (1 + exp(-0.03 × (dist - 300))) + 50 × dist) × goldMultiplier )
- Trade ship spawn
- spawnRate = floor((100 × 1/(rejections+1)) / (1 - sigmoid(numShips, ln(2)/50, 200)))
- Trade ship cap
- Global 150 ships (v24)
- Atom bomb blast radius
- inner 12 / outer 30 tiles
- Hydrogen bomb blast radius
- inner 80 / outer 100 tiles
- MIRV warhead
- inner 12 / outer 18 tiles
- SAM cooldown
- 90 ticks (9s)
- SAM range formula
- samRange(level) = 150 - 480 / (level + 5); default 70, top ≈ 140, cap 150
- SAM intercept targets
- Only AtomBomb / HydrogenBomb; MIRV body and warheads immune
- Pre-fire window
- tickBeforeShooting = nukeReachTick − samReachTick ≥ 0
- Alliance duration
- 3000 ticks ≈ 5 minutes
- Renewal warning
- Both parties notified 300 ticks (30s) before expiry
- Renewal rules
- Mutual consent auto-renews; single-party consent enters renewal window
- Betrayal immediate effect
- Triggers automatic embargo; defense ×0.5, speed ×0.8, duration 300 ticks
- Spawn immunity
- 50 ticks (5 seconds) attack immunity
- Random spawn phase
- Single-player 100 turns / Multiplayer random 150 turns / Multiplayer fixed 300 turns