Skip to content

Features: ice on land as small patches, as the original - #77

Open
MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/land-ice
Open

MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/land-ice

Conversation

@MortenLyhr

@MortenLyhr MortenLyhr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What it changes

Ice on a land plot (tundra or grassland with ice, from a scenario or the World Builder) drew the whole ice slab as one large white blob over the plot. The original shows only small white patches there.

The original uses the same ice pieces (IcePack/IceNN_0M.nif) on land and on the sea. Their top is 9 to 17.5 units over their origin (nearly all of it under 16). The original's land stands 15 units over the water: flat land is 64 in its height maps, the water iWaterHeight 49, fZScale 1 (CIV4TerrainSettings.xml). So on land the terrain hides almost all of the slab and only its highest bits come through. OpenCiv4's land is barely over the water, so the whole slab stood on it.

Now each point of an ice piece over land lies 15 units under the ground there. It is blended with the sea side over the last fifth of a plot to the shore, because OpenCiv4's land slopes to the sea over half a plot and the original's stays high almost to the shore. A piece that reaches land is a copy with its points lowered, shared by pieces lowered the same way. Ice on the sea is drawn as before. Only MapView.cpp changes.

Original left, OpenCiv4 right
Tundra, before
Tundra, after
Grassland, before
Grassland, after
Sea ice, after (unchanged)

The patches are not the same shapes as the original's: the piece chosen for each corner is random in both, and the original's flat land is not exactly level.

How it was checked

  • ctest passes: 15/15 (macOS, Release; rebased on master 8b7d8557).
  • Game results unchanged: --turns 100 --map Fractal --size STANDARD --seed 7 gives the same checksum as master on all 100 turns, ending at D7D43800 (drawing only).
  • Original saves still load: not affected, not tested.
  • Compared with the original under Wine on the test map: tundra and grassland with ice (inland with a river, on the coast with a river, on the coast), and coast and ocean with ice.

🤖 Generated with Claude Code

The original lays the same ice pieces on land as on the sea, but its land
stands 15 units over the water (flat land 64 in its height maps, the water
iWaterHeight 49, fZScale 1), so only the slabs' highest bits (9 to 17.5
units over their origin) come through: small white patches. OpenCiv4's land
is barely over the water, so the whole slab showed as a white blob over the
plot. Each point of an ice piece over land now lies 15 units under the
ground there (a copy of the piece per way it is lowered); ice on the sea is
drawn as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant