From f6c77163aa2ab8d9fab96ca7dc9e07b3012e62e9 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Thu, 29 Oct 2026 10:28:20 +0100 Subject: [PATCH] docs: conquest with coins, noblemen and loyalty Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/architecture.md | 16 ++++++++++++++-- docs/roadmap.md | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index cef5020..8f02ad6 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -148,8 +148,8 @@ A building entry looks like this (numbers start TW-like): | Table | Columns | |---|---| | `worlds` | name, slug, config json, started_at, ends_at null | -| `players` | user_id, world_id, name, points. unique(user_id, world_id) | -| `villages` | world_id, player_id null (null = barbarian), name, x, y, space, wood/clay/iron/food decimal(14,4), resources_at datetime(3), villagers, militia, levy_until null, starving_since null, loyalty, loyalty_at, points. unique(world_id, x, y) | +| `players` | user_id, world_id, name, points, coins. unique(user_id, world_id) | +| `villages` | world_id, player_id null (null = barbarian), name, x, y, space, wood/clay/iron/food decimal(14,4), resources_at datetime(3), villagers, militia, levy_until null, starving_since null, loyalty (0..100), loyalty_at null, points. unique(world_id, x, y) | | `buildings` | village_id, type, level, priority (workers are derived on every read) | | `build_orders` | village_id, building_id null (null = new instance), type, action (build/upgrade/demolish), target_level, cost json, builder null, starts_at null, finishes_at null. Queue order is id order | | `unit_stacks` | village_id (where they stand), home_village_id (owner), unit, count. unique(village_id, home_village_id, unit) | @@ -230,6 +230,18 @@ The visibility radius decides two things: Tribes arrive in M6, with ally, NAP (non-aggression pact), and enemy states between them. Until then, every other player is hostile. Hostility is checked at encounter time, not at send time. +## Conquest + +Villages change hands the Die Stämme way (`combat.conquest`, rules in `Conquest`, rows in `Nobility`): + +- **Loyalty** runs from 0 to 100 and is stored with `loyalty_at`; it grows back `regen_per_hour` × world speed (1/h) lazily, like resources. +- **Coins** are minted at an academy (`village.mint {village_id, count}`, 28000/30000/25000 each) and belong to the player. Noble slots grow with coins: the n-th slot needs n more coins (1, 3, 6, 10, …). Every nobleman alive (home, away, under way, in training) and every village beyond the first takes a slot; training one needs a free slot (`coins`). +- Noblemen march at most `max_distance` (100) fields (`too_far`). +- Every nobleman that survives a won attack lowers loyalty by an even draw from 20 to 35 (the movement's seed, after the luck draw). At 0 or below the village goes to the attacker: one nobleman settles, the other survivors stay as support from their home village, and nothing is looted. Loyalty starts again at 25. +- The handover (`Nobility::handOver`) ends the village's build and recruit queues and its levy without refunds, deletes the old owner's commands from it and troops on their way home to it, and drops its support standing elsewhere. Barbarian villages can be taken too. Attack and defence reports carry `loyalty: {before, after, conquered}`. +- A player who loses the last village joins the world again with a fresh one (`world.join`). +- The village payload carries `loyalty`, `conquest: {coins, slots, used, next_slot_coins, coin_cost, max_distance}` and `villages` (the player's villages in the world, for the switcher). + ## Combat Combat uses the TW model, in `CombatResolver` (pure, tested with fixed luck) and `config/game/combat.php`: diff --git a/docs/roadmap.md b/docs/roadmap.md index 08e5e8d..3359166 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -71,8 +71,8 @@ What Die Stämme has at this stage that the game still lacks. ## M6: Conquering, tribes, multiple villages -- [ ] Loyalty (lazy regeneration), noble drop per hit, conquest transfers the village -- [ ] Coins at the academy, rising noble cost per world config +- [x] Loyalty (lazy regeneration), noble drop per hit, conquest transfers the village +- [x] Coins at the academy, rising noble cost per world config - [ ] Tribes with ally/NAP/enemy relations, applied at encounter time - [ ] Village switcher and overviews across villages - [ ] Inactive villages turn barbarian; restart on the same world after losing every village