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

71 lines
3.9 KiB
PHP
Raw Permalink Normal View History

<?php
// Battles in the Die Stämme model (architecture.md, "Combat").
return [
// Attack strength × (1 + luck), luck drawn evenly from [−luck, +luck] per battle. 0 turns it off.
'luck' => 0.25,
// Attacks on smaller players hit with less strength:
// min(1, floor + points_factor × defender points / attacker points). Barbarians always take 100%.
'morale' => ['enabled' => true, 'floor' => 0.3, 'points_factor' => 3],
// With r = loser strength / winner strength, the winner loses
// max(0, (r − loss_threshold) / (1 − loss_threshold)) ^ loss_exponent of every unit; the
// loser loses all. A side ten times stronger (r ≤ 0.1) loses nobody.
'loss_exponent' => 1.5,
'loss_threshold' => 0.1,
// Wall at level L: defenders get basic_defense × L extra, then everything × factor^L.
// Before the melee both sides shoot at once (units.*.volley): the defenders' volley
// × factor^L, the attackers' ÷ factor^L. A volley kills min(1, volley / the other side's
// food upkeep) of every unit but scouts; the melee runs with who is left.
'wall' => ['basic_defense' => 20, 'factor' => 1.037],
// Rams hit the wall, surviving catapults the chosen building after a won battle.
// Taking a building from level L to L − 1 needs base × factor^(L − 1) of them;
// buildings never drop below level 1. The rams left after the volley fire
// before_battle of their count before the melee, which is fought at the lower wall;
// after a won battle the surviving rams fire the rest, and the first ones' work on
// the level they stopped at counts. A lost battle ends after the first share.
'siege' => [
'ram' => ['base' => 2, 'factor' => 1.09, 'before_battle' => 0.5],
'catapult' => ['base' => 2, 'factor' => 1.09],
],
// Defence × factor while the defender's clock is between start and end (hours).
'night' => ['enabled' => false, 'start' => 0, 'end' => 8, 'factor' => 2.0, 'timezone' => 'Europe/Berlin'],
// Scouts meet scouts before the battle: the attacking ones get through when they
// outnumber defence × the defending scouts, losing (defence / attack)^loss_exponent of
// themselves; otherwise all of them die. Defending scouts never die in this.
'scouting' => ['defense' => 1.0],
// Levied villagers defend with these values per head.
'militia' => ['defense' => ['infantry' => 5, 'cavalry' => 5, 'archer' => 5]],
// New players can't be attacked by players for this long after joining, and can't
// attack players themselves meanwhile; barbarians are fine. Real seconds, as in Die
// Stämme: world speed doesn't shorten it.
'beginner_protection' => 5 * 86400,
// Lazarett: of the own units that fall defending their village, `share` (rounded down)
// come back wounded, as far as its hospitals have free beds. The wounded eat like
// soldiers and stand again heal_time (seconds at world speed 1) after the battle.
'hospital' => ['share' => 0.5, 'heal_time' => 4 * 3600],
// Taking villages, like Die Stämme. Loyalty runs from 0 to max and grows back
// regen_per_hour × world speed. Every surviving nobleman of a won attack lowers it by
// an even draw between drop[0] and drop[1]; at 0 or below the village changes hands,
// one nobleman settles there, and loyalty starts again at after_conquest.
'conquest' => [
'loyalty' => ['max' => 100, 'regen_per_hour' => 1.0, 'drop' => [20, 35], 'after_conquest' => 25],
// Noblemen don't march further than this many fields (0: no limit).
'max_distance' => 100,
// Coins minted at the academy pay for villages, not noblemen. Each village beyond
// the first takes a slot, and the n-th slot needs n more coins (1, 3, 6, 10, …).
// A conquest without a free slot leaves loyalty at 0 and the noblemen go home.
'coin_cost' => ['wood' => 28000, 'clay' => 30000, 'iron' => 25000],
],
];