Skip to content

Diagonal River Crossing Now Calculates Movement Cost Correctly - #1107

Merged
ajhalme merged 4 commits into
C7-Game:Developmentfrom
zack-the-coding-actuary:river_crossing
Nov 14, 2026
Merged

ajhalme merged 4 commits into
C7-Game:Developmentfrom
zack-the-coding-actuary:river_crossing

Conversation

@zack-the-coding-actuary

Copy link
Copy Markdown
Contributor

In response to #1103.

Made helper functions to calculate whether river crossings exist in cardinal directions based on the positions of nearby river edges. Tested this against base game logic to ensure we covered all cases (and excluded any cases that do NOT count as river crossing, which is sometimes janky in Civ 3).

Rivers in cardinal directions pulled from the bits of Civ 3 SAV data is no longer used, the cardinal directions are derived every time now, whether from SAV or a new generated map, based off river edges.

Tested with both a SAV and a fresh map in OpenCiv3, seems to be working as intended now and keeps our data schema intact - I was thinking of changing riverNorth, etc. in the Tile class to properties but would have broken a lot of stuff downstream (see what I did there?)

Let me know what y'all think, thanks!

Both OpenCiv3 generated maps as well as loaded Civ 3 .SAV files properly utilize river crossing logic when run in OpenCiv3.
…sign cardinal directions on map load/generation.

Cardinal river flags are now assigned on map generation for new games, or derived from the NW/SW/SE/NE river edges read from Civ 3 SAV data. Any cardinal river bits from Civ 3 SAVs are now discarded and recomputed from actual river edges in OpenCiv3.
# Conflicts:
#	C7Engine/C7GameData/Save/SaveMap.cs
#	C7Engine/MapGenerator.cs
@ajhalme
ajhalme merged commit bb9a0ba into C7-Game:Development Nov 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants