Instances of a type rank by level, then id; rank n works at 0.5^n: production,
the farm's nominal food, storage, hides, hospital beds and training speed. Workers
stay full. The payload carries instance_share on every building and build option,
and effects/next_effects at the building's share.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The worker ticks seasons every loop: due crowns are placed, a holder who reached
ends_at wins, the world closes and the next one opens with the same rules. Ended
worlds refuse changes, joins and raids. Payloads carry the season, worlds their
winner, the map a crown flag.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ranking.index pages 25 rows and opens on the user's own row. Battles bump
defeated.attack and defeated.defense by the food the fallen ate; defenders share by
what they had standing.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A village whose space is mostly camps becomes a resource village (+20% from its
camps); one mostly barracks, stable and workshop a military village (+20% training
speed, +10% defence). The payload carries the role and the space per role.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A raid.planned event per village picks the nearest camp in range, announces a
band sized by the village's points hours before it marches, and plans the next
one. On arrival the band is as strong as its camp; a beaten camp's band scatters.
Loot goes back to the camp, a beaten band pays a bounty.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Full strength follows the village's points in one of four profiles, capped by its
food; a barbarian.regroups event brings it back a quarter at a time. Existing
barbarians get theirs from the seeder on deploy.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The map's coordinates now run from -500 to 499 around 0|0, with DS continent names
counted from the top-left (K55 at 0|0). New villages settle on a frontier whose
radius follows all villages at DS density (0.29 per field), at a random angle in
the direction the player picked; they avoid touching other players, not barbarians.
Each join brings 1.3 barbarian villages on average within a few fields. The
one-time barbarian square around the centre is gone, and game:reset-world wipes a
world back to empty while keeping user accounts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every per-level formula uses level - 1 as its exponent, so a building at level n
costs, makes and scores what it did at level n - 1. The migration shifts stored
levels and queued orders up by one; removing an instance now targets level 0.
Building space: 40 at HQ level 1, plus 20 per level above.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
villages.space becomes the base at HQ level 0 (existing villages 50 -> 40). A queued
HQ demolition counts already, and the HQ can't go below what stands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Starvation::sync() runs after every mutation and event: it keeps food.runs_out at
the moment the stock hits 0, starts the grace timer once the village starves and
stops it when income covers upkeep again. Each desertion wave takes the fewest
soldiers, highest upkeep first, that feed the rest; then the levy ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drafted villagers still eat but stop working; recruiting trains only undrafted ones.
A levy.ends event settles the village and sends them back; village.endLevy ends it early.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package resolves the per-message authtoken for that message only.
Recording socket_<id> and the authed-user map lets the server authenticate
later messages itself and the game:events worker find sockets to push to.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>