Repository navigation
Diagonal River Crossing Now Calculates Movement Cost Correctly - #1107
Merged
ajhalme merged 4 commits intoNov 14, 2026
Merged
Conversation
… diagonal directions.
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
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.
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 theTileclass to properties but would have broken a lot of stuff downstream (see what I did there?)Let me know what y'all think, thanks!