Repository navigation
Blockilization: closed borders keep civilians out too - #43
Merged
Merged
Conversation
Without open borders (or a war), no unit may enter another major civ's land: settlers, workers, great people and caravans now as well as soldiers, as in Civ V. Missionaries, inquisitors and Great Prophets still go in without leave, and a city-state's land stays open to all. Units left in land that closes to them (open borders ending, borders growing over them) are moved out as the turn ends, civilians included. The move order, the rules' paths, the bots' paths and the screen's route preview share the one rule (`heedsBorders`, `closedLand`). The bots keep to it: settler sites behind closed land are passed over, a worker with no way to its best job takes the next, and a Great Musician tours only where borders are open to it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs7MayRsd4NGm4hDhohn7n
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.
Requested by Patrick · project thread
What this is
A Blockilization fix. Closed borders kept soldiers out, but settlers, workers, great people and caravans could walk through any civ's land. In Civ V, no unit may enter another major civ's land in peace without Open Borders, so now civilians are kept out too.
rules/units.tsheedsBorders,rules/movement.tsclosedLand). Every unit is kept out of land that's closed to it: another major civ's, at peace, that hasn't opened its borders to you. Missionaries, inquisitors and Great Prophets are exempt, as they are in Civ V. A city-state's land is still open to everyone, and so is an enemy's land in a war. A Great Musician now needs Open Borders to go on a concert tour, as in Civ V.ai/context.tspassable) and the route preview on the screen (client/path.ts) all use it.Missionaries can enter freely but don't lose strength in closed land. Civ V's "Unwelcome Evangelist" attrition isn't modelled.
Screenshot or clip
Rules only, no visual change. The route preview and the "borders are closed" reason now show for civilians as they already did for soldiers.
Checklist
npx tsc --noEmitandnpm run check:boundariespass. A fullnpm run buildcouldn't run here: wasm-opt couldn't be downloaded, so the engine was built with--no-optfor the tests.npm run test:headlesspassestests/cases.ts) pass, 273 of 273. The four new tests fail on the old code:tests/ai-bench.ts, small maps, seeds 1–8), before and after. Cities by turn 60 and 120 are unchanged (3.95 and 5.95 on average). Turns spent broke went from 2.8 to 1.5 a game, a bot turn still takes about 11 ms, and there were no exceptions. The victory mix shifts because the games play out differently.Generated by Claude Code