docs: barbarian waves on the map, worlds.barbarians_at, their no-locks row and the roadmap line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b6c570809b
commit
e1121056c0
|
|
@ -32,6 +32,7 @@ app/Game/ pure rules: no Eloquent, no now(), fully unit tested
|
||||||
Map/Continent.php K-names of the 100 × 100 continents
|
Map/Continent.php K-names of the 100 × 100 continents
|
||||||
Map/MapBounds.php coordinates from −size/2 to size/2 − 1 around 0|0
|
Map/MapBounds.php coordinates from −size/2 to size/2 − 1 around 0|0
|
||||||
Map/Frontier.php where new villages settle as the world grows
|
Map/Frontier.php where new villages settle as the world grows
|
||||||
|
Map/BarbarianWaves.php when the next barbarian wave comes and how many per player
|
||||||
Travel/TravelTime.php
|
Travel/TravelTime.php
|
||||||
Trade/TradeRules.php merchants, their pace, fair offers, route shipments
|
Trade/TradeRules.php merchants, their pace, fair offers, route shipments
|
||||||
Combat/CombatResolver.php
|
Combat/CombatResolver.php
|
||||||
|
|
@ -147,6 +148,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. |
|
| 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. |
|
||||||
| Merchants never free again | Merchants come from the market's level, not from training. Every trip ends on a timer, cancelling an offer frees its merchants, and merchants a lost village had under way stop counting. Lint: every market level has at least 1 merchant, `market.carry` and `minutes_per_field` above 0, `max_ratio` at least 1. |
|
| Merchants never free again | Merchants come from the market's level, not from training. Every trip ends on a timer, cancelling an offer frees its merchants, and merchants a lost village had under way stop counting. Lint: every market level has at least 1 merchant, `market.carry` and `minutes_per_field` above 0, `max_ratio` at least 1. |
|
||||||
| Trade route stuck | A run sends what the stock and the free merchants allow, or nothing, and plans the next run either way. A route whose target changed hands pauses; the player can resume, change or delete it at any time. Lint: 0 < `route.min_every` ≤ `route.max_every`. |
|
| Trade route stuck | A run sends what the stock and the free merchants allow, or nothing, and plans the next run either way. A route whose target changed hands pauses; the player can resume, change or delete it at any time. Lint: 0 < `route.min_every` ≤ `route.max_every`. |
|
||||||
|
| A world with few players runs out of targets | Barbarian waves bring new villages near every active player every few world days, never on a taken field. Where no field near a village is free, the wave brings fewer. Lint: `waves.every_days` above 0, the smaller first, `per_player` at least 0, `near` at least 1. |
|
||||||
| Player loses every village | The player can restart on the same world with a fresh village. |
|
| 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 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. |
|
| 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. |
|
||||||
|
|
||||||
|
|
@ -173,7 +175,7 @@ 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, barbarians_at null (the next barbarian wave) |
|
||||||
| `players` | user_id, world_id, name, points, coins. 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 (0..100), loyalty_at null, 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) |
|
||||||
|
|
@ -210,6 +212,7 @@ The world grows the way Die Stämme's does (measured on de261, see the research
|
||||||
- **Frontier** (`Frontier`): a new player's village lands at a random angle on a ring of radius `start_radius + sqrt(villages / (π · density))`, ± `band` fields, where `villages` counts every village of the world, barbarians included. `density` is DS's 0.29 villages per field (about one in 3.4 fields). The first tries keep clear of the 8 fields around other players; barbarians may stand right next to a new village. If the ring has no room, the nearest free field around 0|0 is taken.
|
- **Frontier** (`Frontier`): a new player's village lands at a random angle on a ring of radius `start_radius + sqrt(villages / (π · density))`, ± `band` fields, where `villages` counts every village of the world, barbarians included. `density` is DS's 0.29 villages per field (about one in 3.4 fields). The first tries keep clear of the 8 fields around other players; barbarians may stand right next to a new village. If the ring has no room, the nearest free field around 0|0 is taken.
|
||||||
- **Direction**: when joining (`world.join {world_id, direction}`) a player picks random, nw, ne, sw or se, and the angle stays inside that quarter.
|
- **Direction**: when joining (`world.join {world_id, direction}`) a player picks random, nw, ne, sw or se, and the angle stays inside that quarter.
|
||||||
- **Barbarians come with players** (`SpawnBarbarians`): each join brings `barbarians.per_join` of them on average (1.3: one, and a second with 30% chance, as in DS), placed within `barbarians.near` fields of the new village so a small world has something to loot from the start (DS scatters them on the frontier instead; with thousands of players that ends up the same). Their buildings start at random levels up to `max_level`, and each has a `barbarian.grows` event: every `growth.every_hours` (at world speed) one building goes up a level, up to `growth.max_level`. Bonus villages (DS adds 0.4 per join) come later.
|
- **Barbarians come with players** (`SpawnBarbarians`): each join brings `barbarians.per_join` of them on average (1.3: one, and a second with 30% chance, as in DS), placed within `barbarians.near` fields of the new village so a small world has something to loot from the start (DS scatters them on the frontier instead; with thousands of players that ends up the same). Their buildings start at random levels up to `max_level`, and each has a `barbarian.grows` event: every `growth.every_hours` (at world speed) one building goes up a level, up to `growth.max_level`. Bonus villages (DS adds 0.4 per join) come later.
|
||||||
|
- **Barbarian waves** (`BarbarianWaves`, `Waves`): joins alone bring nothing new to a world with few players, so barbarian villages also come in waves. Every `waves.every_days` (5 to 9 world days, at world speed, drawn evenly per wave) each active player gets `per_player` of them (1.5: one, and a second with 50% chance), each within `near` (8) fields of a random village of theirs, placed and started like the ones that come with a join. Active means seen within `world.inactive_days`; when that rule is off, every player with a village counts. The world keeps its next wave in `barbarians_at`. The `game:events` worker ticks `Waves::tick` before every loop: it runs a due wave with the world row locked and plans the next from a draw seeded by the world and the wave, so a replay draws the same. A worker that was down catches up one wave per loop. A world without a time gets one an interval out, on deploy (`WorldSeeder`) or from the worker for a new or reset world. A wave without active players brings nothing, so a world still starts empty. Ended worlds get none. Each player village that got new neighbours is pushed `village:updated`, so an open client refetches.
|
||||||
- **Garrisons** (`BarbarianGarrison`, `Barbarians`): a barbarian village holds troops, so raiding it takes scouting and an army sized for it. Full strength is `garrison.per_point × (points − free_points)` heads, split by the village's profile (spearmen, swordsmen, archers or riders, fixed by its id, so a scout report tells what to send), and its upkeep stays under `max_food_share` (50%) of the village's food budget, so it never starves. A new barbarian village starts at full strength. After a battle there, or when it grows, a `barbarian.regroups` event gives back `regroup.share` (25%, at least one per unit) every `regroup.every_hours` (2) until it is full again. Their stock grows from their own buildings, settled like any village, up to their storage. Barbarian villages from before garrisons get theirs on deploy (`WorldSeeder`).
|
- **Garrisons** (`BarbarianGarrison`, `Barbarians`): a barbarian village holds troops, so raiding it takes scouting and an army sized for it. Full strength is `garrison.per_point × (points − free_points)` heads, split by the village's profile (spearmen, swordsmen, archers or riders, fixed by its id, so a scout report tells what to send), and its upkeep stays under `max_food_share` (50%) of the village's food budget, so it never starves. A new barbarian village starts at full strength. After a battle there, or when it grows, a `barbarian.regroups` event gives back `regroup.share` (25%, at least one per unit) every `regroup.every_hours` (2) until it is full again. Their stock grows from their own buildings, settled like any village, up to their storage. Barbarian villages from before garrisons get theirs on deploy (`WorldSeeder`).
|
||||||
- A village whose player has been inactive for too long turns barbarian (M6).
|
- A village whose player has been inactive for too long turns barbarian (M6).
|
||||||
- `php artisan game:reset-world {slug}` wipes a world back to empty (villages, players, movements, reports, events) and keeps user accounts and the world's config.
|
- `php artisan game:reset-world {slug}` wipes a world back to empty (villages, players, movements, reports, events) and keeps user accounts and the world's config.
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ Each milestone ends with tests green, `ConfigLint` green, and something playable
|
||||||
- [x] Spawn placement, like Die Stämme: the world starts at 0|0 (negative coordinates, DS continent names) and grows ring by ring with all villages at DS density; players pick a direction (random, NW, NE, SW, SE) and never land right next to another player
|
- [x] Spawn placement, like Die Stämme: the world starts at 0|0 (negative coordinates, DS continent names) and grows ring by ring with all villages at DS density; players pick a direction (random, NW, NE, SW, SE) and never land right next to another player
|
||||||
- [x] Barbarian villages come with the players: 1.3 per join on average, within a few fields of the new village, random levels; `game:reset-world` starts a world over
|
- [x] Barbarian villages come with the players: 1.3 per join on average, within a few fields of the new village, random levels; `game:reset-world` starts a world over
|
||||||
- [x] Barbarian growth over time (world config)
|
- [x] Barbarian growth over time (world config)
|
||||||
|
- [x] Barbarian waves: every 5 to 9 world days 1.5 new barbarian villages per active player settle within 8 fields of them, so a world with few players keeps moving
|
||||||
- [x] `map.view {world_id, x, y, w, h}` with village owner, points and continent; village points from building levels
|
- [x] `map.view {world_id, x, y, w, h}` with village owner, points and continent; village points from building levels
|
||||||
- [x] UI: Die Stämme-style coordinate map with rulers, continent lines, jump-to and village info
|
- [x] UI: Die Stämme-style coordinate map with rulers, continent lines, jump-to and village info
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue