docs: combat volley, loss threshold and ram phases; raids in real hours, fewer rams and camps that stay home
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
007e80b26a
commit
09a0160db0
|
|
@ -146,7 +146,7 @@ A village may fail through war or bad play, but it must never get stuck. Every l
|
|||
| Wounded never return | Each battle's wounded stand again at a fixed `heals_at`. Lint: `combat.hospital.heal_time` above 0 and `share` between 0 and 1. |
|
||||
| All merchants killed | Merchants are trained at the market like units, so dead merchants can always be replaced. |
|
||||
| Player loses every village | The player can restart on the same world with a fresh village. |
|
||||
| Raids bleed a village dry | Raids come `every_hours` apart, after beginner protection, and loot only what the hiding places don't cover; rams never take a wall below 1, and no band takes a village. Beating the camp down scatters its next band. Lint: intervals above 0, `scatter_below` above 0. |
|
||||
| Raids bleed a village dry | Raids come `every_hours` apart in real hours on every world, after beginner protection, and loot only what the hiding places don't cover. Rams never take a wall below 1, a beaten band's rams fire only their first half, and no band takes a village. Beating the camp down scatters its next band, and a band facing a defence far too strong stays home. Lint: intervals above 0, `scatter_below` above 0, `dare` at least 0. |
|
||||
|
||||
## Config
|
||||
|
||||
|
|
@ -260,8 +260,10 @@ See "Tribes". Encounters (M5) will check hostility at encounter time, not at sen
|
|||
|
||||
Barbarian camps raid the player villages around them (`config/game/raids.php`, rules in `Raids`, rows in `Raiders`), so a village has something to defend against even on a quiet world.
|
||||
|
||||
- Every player village has one `raid.planned` event waiting. The first fires when the owner's beginner protection ends (`world.join`, a conquest, or the seeder on deploy for villages from before raids). It picks the nearest barbarian village within `range` (15) fields and sends a band at the village, then plans the next raid `every_hours` (18 to 30, drawn per event) after this one arrives. With no camp in range it tries again after that interval.
|
||||
- The band attacks with `attack.base + attack.per_point × village points` (50 + 1.5 × points) in its camp's garrison profile, plus `rams.per_wall_level` rams per wall level once the village has `rams.from_points` (300) points. It is an attack movement without a player (`player_id` null): it gathers at the camp for `gather_hours` (3) and then marches (`sent_at`), and the village sees it from the moment it is planned (`visible_at`). The payload marks it `raid` with `marches_at` while it gathers.
|
||||
- Every player village has one `raid.planned` event waiting. The first fires when the owner's beginner protection ends (`world.join`, a conquest, or the seeder on deploy for villages from before raids). It picks the nearest barbarian village within `range` (15) fields and sends a band at the village, then plans the next raid `every_hours` (20 to 40, drawn per event) after this one arrives. With no camp in range it tries again after that interval.
|
||||
- `every_hours` and `gather_hours` are real hours on every world, like `world.inactive_days`: they follow the player's day, not world time. Only the band's march runs at world speed.
|
||||
- The band attacks with `attack.base + attack.per_point × village points` (50 + 1.5 × points) in its camp's garrison profile, plus `rams.per_wall_level` rams per wall level (0.5, rounded) once the village has `rams.from_points` (300) points. It is an attack movement without a player (`player_id` null): it gathers at the camp for `gather_hours` (3) and then marches (`sent_at`), and the village sees it from the moment it is planned (`visible_at`). The payload marks it `raid` with `marches_at` while it gathers.
|
||||
- The camp sizes the village up first. It fights the battle on paper (`CombatResolver`, no luck, full morale) with its full band against everyone in the village, support and levied militia included, its wall, a military village's defence bonus and the night at the expected arrival. When the band would lose with less than `dare` (30%) of the defence's strength, or be shot down before the melee, it stays home: no movement, no report, and the next raid comes after the interval.
|
||||
- On arrival it is as strong as its camp is then: each unit × the camp garrison's share of full strength. Below `scatter_below` (25%), or when the camp changed hands, it scatters and the village gets a report saying so. So striking the camp in the hours before a raid weakens or stops it. A conquered camp's raids are deleted with its other commands.
|
||||
- The battle is an ordinary one at full morale. A won raid loots and returns to its camp, which keeps the loot (stock to raid back) and takes the survivors in as far as its garrison has room. A beaten band leaves `bounty` × its attack strength (0.5), a third each of wood, clay and iron, in the village. Reports carry `raid` and `bounty`.
|
||||
- Feature tests run with raids off (`tests/Pest.php`), like barbarian spawns; `RaidTest` turns them on.
|
||||
|
|
@ -293,7 +295,7 @@ Players band together in tribes (`Tribes` action, `tribe.*` over WS, rules in `D
|
|||
- `account.show|password|delete` over WS. Deleting needs the password: on every world the player's villages turn barbarian (`Abandon`), a tribe they lead goes to the strongest council member (else the strongest member) or ends with them, then the players and the account go, and with them their reports, quests and chat messages.
|
||||
- **Losing a village** ("geadelt"): the conquest hands it over (`Nobility::handOver`, which shares `release()` with abandoning: queues end, the owner's groups from and to it are lost, its support elsewhere too), the old owner gets the defence report and a `village:lost {world_id, village_id, name, x, y, by}` whisper, so an open client leaves the village's screens. With no village left, `world.index` marks the world `fallen` and `world.join` starts the player over on the frontier, with fresh beginner protection (`players.protected_since`; protection lasts `combat.beginner_protection` from then, at world speed).
|
||||
- **Abandoned accounts**: every village action records `players.last_active_at` (at most every 5 minutes). Once a minute the worker turns the villages of players not seen for `world.inactive_days` (14, real days: it measures people, not world time) barbarian (`Abandon::inactive`); the player can come back and start again. A barbarian made this way keeps its buildings and stock, sends other players' support home, loses the owner's troops and queues, grows, and holds a garrison like any other.
|
||||
- `world.index` gives each world its players, villages, tribes, start, season state and the player's own state; `world.settings` the rules in plain units (durations in seconds at the world's speed) for the world overview.
|
||||
- `world.index` gives each world its players, villages, tribes, start, season state and the player's own state; `world.settings` the rules in plain units (durations in seconds at the world's speed, inactivity and raids in real seconds) for the world overview.
|
||||
|
||||
## Chat
|
||||
|
||||
|
|
@ -323,10 +325,16 @@ A world is a season with a winner (`world.season`, rules in `Season`, rows in `S
|
|||
|
||||
Combat uses the TW model, in `CombatResolver` (pure, tested with fixed luck) and `config/game/combat.php`:
|
||||
|
||||
- **Volley.** Before the melee both sides shoot at once, from their numbers at the start. A side's volley is the sum of its units' `volley` (archer 0.1, catapult 0.5, every other unit 0). The defenders shoot from the wall (× `factor^L`, with L the wall before the rams), the attackers at it (÷ `factor^L`). A unit soaks as much as it eats, a levied villager one. The volley kills `min(1, volley / food the other side eats)` of every unit it hits. Scouts neither shoot nor get hit. Luck, morale and the night don't touch the volley.
|
||||
- The melee runs with who is left. An attack shot to pieces has lost, and the defence loses only what the attackers' volley killed. A defence shot to pieces leaves the wall alone to fight, as in an empty village.
|
||||
- Attack strength is split into infantry, cavalry and archer by each unit's class. Every defender, own or support, counts with its defence against each class, weighted by the attacker's mix. Levied militia defend with `combat.militia.defense` per head.
|
||||
- The wall at level L adds `basic_defense × L` and multiplies the defence by `factor^L` (20 and 1.037). Rams lower the wall before the battle: each level L down needs `base × factor^(L − 1)` rams (2 and 1.09). Nothing drops below level 1.
|
||||
- The wall at level L adds `basic_defense × L` and multiplies the defence by `factor^L` (20 and 1.037). Each level L down needs `base × factor^(L − 1)` rams (2 and 1.09). Nothing drops below level 1.
|
||||
- Rams fire in two phases. The rams the volley left fire `siege.ram.before_battle` (half) of their count before the melee, and the melee is fought at the lower wall. After a won battle the surviving rams fire the rest at the wall as it then stands; what the first ones did on the level they stopped at counts. A lost battle ends after the first phase.
|
||||
- The attack is multiplied by morale and (1 + luck). Luck is drawn evenly from ±`combat.luck` (25%) with the movement's seed, so a replayed event fights the same battle. Morale is `min(1, 0.3 + 3 × defender points / attacker points)` and always 1 against barbarians. Worlds with a night bonus multiply the defence at night.
|
||||
- The winner loses `(loser / winner)^1.5` of every unit, rounded per stack; the loser loses everything. Dead militia shrink the levy. Part of the defender's own dead come back from its hospital (see "Hospital").
|
||||
- With r = loser strength / winner strength, the winner loses `((r − t) / (1 − t))^1.5` of every unit, and nothing at r ≤ t (`loss_threshold`, 0.1). A side ten times stronger loses nobody; at even strength both sides fall. The loser loses everything.
|
||||
- Every stack of a side, support included, falls alike: the volley's share first, then the melee's share of the rest, each rounded per stack (`Battle::defenseDead`). Volley deaths count like any other: in `lost`, in the hospital and in the ranking. Dead militia shrink the levy. Part of the defender's own dead come back from its hospital (see "Hospital").
|
||||
- Attack and defence reports and the simulator (`rally.simulate`) carry `volley: {attacker: {unit: dead}, defender: {unit: dead}}`, null when nobody shot. Those dead are already inside `lost`. An attacker who learns nothing about the defence gets `volley.defender` null.
|
||||
- Lint: `loss_threshold` at least 0 and below 1, `before_battle` between 0 and 1, no `volley` below 0.
|
||||
- After a won battle, surviving catapults hit the highest instance of the chosen type (headquarters by default) by the same siege rule. A damaged building's queued orders are cancelled with a full refund, since their levels no longer fit.
|
||||
- Scouts (units with `scout: true`) never fight. They meet the scouts in the village first: they get through when they outnumber `combat.scouting.defense` × the defending scouts, losing `(defence / attack)^1.5` of themselves; otherwise all of them die, and defending scouts never die in this. Scouts that get through add the village's resources and building levels, after the battle, to the attacker's report. Scouts alone cause no battle; defending scouts die with the village's other defenders when a battle is lost.
|
||||
- `LootCalculator`: survivors carry `carry` per unit. They take wood, clay and iron evenly, above what the hiding places protect (`hides` per resource; instances add up). Food is not looted.
|
||||
|
|
|
|||
Loading…
Reference in New Issue