Expand description
Coordinate systems of the campaign map.
The campaign map uses three related coordinate systems:
- World: the
f32positions stored in startposCoord2dnodes. - Raw: the
u16units stored in the map files (trade_routes.ptd).raw = world * scale + 4. - Cell: the logical hex grid of the map (
HEX_MAP_DATA, 1016x720 cells in Attila’s main map). A cell is 6 raw units wide and 8 raw units high, and odd columns are shifted half a cell down.
The scales of a map (MapScale) come from its hex grid and its size in world units: the last column starts
at the map’s right edge, and the last row of odd columns ends at its bottom edge. Characters placed on cells land
exactly where the current game build (the one BOB uses) puts them: 518 of 518 in Attila’s main campaign. CA’s
older build of the shipped startposes rounds the horizontal position differently, one ulp away at most.
Structs§
- Edge
Piece - A piece covering some edges of a hex cell (a road or a coast), as a shape and a rotation.
- HexCell
- A cell of the logical hex grid of the campaign map.
- MapScale
- World units per raw unit of a campaign map, horizontally and vertically.
Constants§
- CELL_
RAW_ HEIGHT - Raw units per cell, vertically.
- CELL_
RAW_ WIDTH - Raw units per cell, horizontally.
- HEX_
EDGES - Edges of a hex cell.
- RAW_
OFFSET - Offset added to raw coordinates.