Skip to content

fix(terrain): honor the configured map size - #1141

Open
dajiaohuang wants to merge 1 commit into
CytopiaTeam:masterfrom
dajiaohuang:fix/configured-terrain-size-20261015
Open

dajiaohuang wants to merge 1 commit into
CytopiaTeam:masterfrom
dajiaohuang:fix/configured-terrain-size-20261015

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

MapFunctions::newMap(true) constructs a map using Settings::mapSize, and point indexing/boundary checks use that same size. However, TerrainGenerator::generateTerrain uses the separate TerrainSettings::mapSize default of 128.

With the supported Game.MapSize set to 32, the map consequently receives 16,384 nodes instead of 1,024. The node vector's coordinate stride no longer agrees with Point::toIndex() or the map dimensions. This is reproducible through the production MapFunctions API, without malformed save files or out-of-range coordinates.

Change

Generate terrain using the configured map size already used by the owning map and point operations. Add a regression checking node count and the final coordinate for a 32x32 map. This does not implement the separate terrain-generation dialog in #975.

Validation

  • Base reproduction: 16,384 nodes for a configured 32x32 map. Fixed: 1,024 nodes, last coordinate (31,31).
  • Isolated offscreen workflow exercises new flat/procedural maps, tile placement/demolition, pixel hit selection, elevation/leveling, and saving/loading its own generated map.
  • Linux GCC 13 Debug build; CTest 55/55 passed in a combined validation tree with independent font-setting/empty-load-dialog fixes.
  • Locally extracted Ubuntu SDL2/libnoise dependencies; local include-layout adapter for existing fix(cmake): FindLibNoise: correct include dir, support Debian/Ubuntu header layout #1130. Optional audio, Angelscript and microprofile disabled. No Windows/macOS, Conan or interactive desktop visual acceptance.

This branch has not been deployed

No deployments
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