docs: conquest with coins, noblemen and loyalty

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fabian @ Blax Software 2026-10-29 10:28:20 +01:00
parent 222cd2e797
commit f6c77163aa
2 changed files with 16 additions and 4 deletions

View File

@ -148,8 +148,8 @@ A building entry looks like this (numbers start TW-like):
| Table | Columns | | Table | Columns |
|---|---| |---|---|
| `worlds` | name, slug, config json, started_at, ends_at null | | `worlds` | name, slug, config json, started_at, ends_at null |
| `players` | user_id, world_id, name, points. unique(user_id, world_id) | | `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, loyalty_at, points. unique(world_id, x, y) | | `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) | | `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 | | `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) | | `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. 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
Combat uses the TW model, in `CombatResolver` (pure, tested with fixed luck) and `config/game/combat.php`: Combat uses the TW model, in `CombatResolver` (pure, tested with fixed luck) and `config/game/combat.php`:

View File

@ -71,8 +71,8 @@ What Die Stämme has at this stage that the game still lacks.
## M6: Conquering, tribes, multiple villages ## M6: Conquering, tribes, multiple villages
- [ ] Loyalty (lazy regeneration), noble drop per hit, conquest transfers the village - [x] Loyalty (lazy regeneration), noble drop per hit, conquest transfers the village
- [ ] Coins at the academy, rising noble cost per world config - [x] Coins at the academy, rising noble cost per world config
- [ ] Tribes with ally/NAP/enemy relations, applied at encounter time - [ ] Tribes with ally/NAP/enemy relations, applied at encounter time
- [ ] Village switcher and overviews across villages - [ ] Village switcher and overviews across villages
- [ ] Inactive villages turn barbarian; restart on the same world after losing every village - [ ] Inactive villages turn barbarian; restart on the same world after losing every village