Add support for impassable terrain - #992
Merged
Merged
Conversation
ajhalme
reviewed
Sep 14, 2026
| protected Tile MakeImpassableDesertTile() { | ||
| return new(ID.None("")) { | ||
| baseTerrainType = new() { Key = "desert" }, | ||
| overlayTerrainType = new() { Key = "desert", movementCost = 1, impassable = true } |
Contributor
There was a problem hiding this comment.
#362 explicitly mentions 0 movementCost. That could be a good test case to check.
Contributor
|
LGTM, test is fine as is |
Contributor
|
I think barbarians spawn on these impassable tiles, if I remember correctly from the ww2 map. |
This was referenced Sep 15, 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.
Closes #362
Summary
Adds the
Impassableterrain flag from the BIQTERRsection to the terrain model and makes unit movement respect it. This fixes terrains like the WWII Pacific scenario's desert, which has a movement cost of 0 but must block entry entirely.ImpassableByWheeledis deliberately left for a follow-up, as scoped in the issue.Changes
impassableproperty, imported fromciv3Terrain.ImpassableIsImpassable()helper, reading the overlay terrain (consistent withMovementCost())Disabledon impassable tiles, which gates every entry path:MapUnit.Move)CanEnterPeacefully/CanEnterForcefully)MoveAlongPath)MakeImpassableDesertTile()helper plus two tests — a land unit can't enter an impassable tile (even forcefully) and can't path through oneVerification
dotnet build C7/C7.sln— 0 errorsdotnet test C7/C7.slnwithCIV3_HOMEset — 69/69 pass, 0 skipped (real Civ3 scenario/save tests included)dotnet format C7/C7.sln whitespace --verify-no-changes— cleanStandard BIQs have no impassable terrain, so this is a no-op for normal games; it only affects mods that flag terrain impassable.