HomeWildfire Games

Implement MapBoundsPlacer that returns all points on the tilemap.

Description

Implement MapBoundsPlacer that returns all points on the tilemap.
Use it to replace the hacky resetTerrain rmgen2 function from rP17903 and initHeight from rP20419.

Highlights that createArea is the primary tool of rmgen, rather than nested for-loops over the mapsize.
Neglect that the heightmap grid is one tile larger than the tilemap grid for now.

Details

Event Timeline

Neglect that the heightmap grid is one tile larger than the tilemap grid for now.

Is a nuisance. Few maps of prior releases had this issue too, for instance ambush, and revealed a 1-tile sized mountain in the blackened tiles at the map border.

There are some ways to fix this, for instance by creating a HeightMapBounds placer. The Painters and createArea functions would have to be changed to not fall apart when handling a coordinate that only exists on the heightmap grid but not on the tilemap grid.

The issue of the heightmap grid being 1 tile larger is also present in that TILE_CENTERED_HEIGHT_MAP variable which will need some elegant design.