game-village-politics-backend/config/game/economy.php

61 lines
3.0 KiB
PHP
Raw Normal View History

<?php
return [
// Per hour at world speed 1, regardless of staffing.
'base_production' => ['wood' => 5, 'clay' => 5, 'iron' => 5],
// Heads each villager takes: the food per hour it eats at world speed 1. Population
// counts in these heads, so a village holds as many on every world speed; farms make
// and people eat world speed times as much food.
'upkeep' => ['villager' => 1],
// Villagers and soldiers fill this share of the farms' nominal output at world speed 1;
// the rest is surplus that goes into storage. Expensive units eat into it, down to
// starvation.
'villager_share' => 0.8,
// Output at staffing ratio r is e^(k·(r−1)): 100% full, about 10% empty.
'staffing' => ['k' => 2.3],
// Copies of a building type work at a falling share. The instances of a type rank by
// level (highest first, then oldest); the one at rank n (0-based) gives instance_share^n
// of its output, storage, hides, beds and training speed, but needs all its workers.
'instance_share' => 0.5,
// Share of a level's cost refunded when it is demolished, and its build time spent doing so.
'demolish_refund' => 0.5,
'demolish_time_factor' => 0.5,
// Build time of a level, Die Stämme's formula: max(min, base × factors[level] ×
// hq_factor^−HQ level) seconds at world speed 1, divided by world speed and by the
// headquarters' staffing. `base` is per building (buildings.php); a building may bring
// its own `factors` or `min` there.
'build_time' => [
// One multiplier per level from 1: Die Stämme's table, levels 1 and 2 as its game
// pages show them in 2026 (pace.md in the research repo). Levels past the end grow
// by the ratio of the last two entries; lint wants one entry per level up to every
// type's max_level.
'factors' => [
0.0075, 0.0075, 0.161516, 0.500291, 0.956687, 1.50819, 2.15872, 2.92402, 3.82642, 4.89346,
6.15818, 7.65953, 9.44382, 11.5653, 14.0884, 17.0893, 20.6581, 24.9012, 29.9451, 35.9388,
43.0592, 51.5155, 61.5554, 73.4716, 87.6114, 104.384, 124.276, 147.861, 175.818, 208.951,
],
// Each headquarters level divides build time by this: HQ 20 builds in 0.377 of the time.
'hq_factor' => 1.05,
// No level builds faster than this many seconds at world speed 1.
'min' => 10,
],
// Each level of a military building makes training there this much faster.
'recruit_speed_per_level' => 0.05,
// Levy: villagers drafted as militia stop working for this long (seconds at world
// speed 1), then return to work on their own. One levy at a time; it can end early.
'levy' => ['duration' => 6 * 3600],
// Starvation: once the food stock is empty and upkeep still exceeds income, soldiers
// desert after `grace` and then every `wave_every` (seconds at world speed 1), each
// wave just enough to feed the rest. Income covering upkeep again stops the clock.
'starvation' => ['grace' => 24 * 3600, 'wave_every' => 3600],
];