feat: troops & armies (existence phase, no combat) - #12
Merged
Conversation
Add troops and armies as a new 5th actor kind. Barracks train troops (4 tier-1 types) which spawn as armies at the barracks tile; armies carve out a capped military share of city population, add food upkeep to the nearest owned city, march tile-by-tile with 8-directional (Chebyshev) movement, and can merge when co-located. Combat is out of scope. - domain.Army + TroopType; constants troop stat table + barracks training capacity + MilitaryPopulationFraction - armies table (JSONB troops) with sqlc queries + write-behind flush - proto: ArmyId/TroopType, Army/TroopStack, EntityBag armies, ArmyService - army actor: create/get/move/merge/delete, movement ticker, nearest-city upkeep attribution, tile occupancy - barracks producer: FIFO per-barracks training queue + completion timer - city: MilitaryPopulation reserve/release, army upkeep map, civilian + army food upkeep in the food tick - tile army occupancy; stream/GetMap/StreamState army wiring; setup restore
…ev script GetArmy now bypasses the vision check when the caller owns the army, so a player can always inspect an army they've marched out of sight (ListArmies already returns all owned armies). Adds scripts/troops.py, a Connect JSON-over-HTTP helper to exercise ArmyService locally without grpcurl.
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add troops and armies as a new 5th actor kind. Barracks train troops (4 tier-1 types) which spawn as armies at the barracks tile; armies carve out a capped military share of city population, add food upkeep to the nearest owned city, march tile-by-tile with 8-directional (Chebyshev) movement, and can merge when co-located. Combat is out of scope.