Brodgar client

The map database: MapFile

The map the player has explored, on disk and persistent — as opposed to MCache, the terrain streamed around them (state.md). The client that reads it — the coordinate bridge and the drawings — is minimap.md.

The file

Segments, grids, markers

Zoom grids

Reading a recorded grid back as a live one

A recorded Grid and an MCache.Grid hold the same picture in the same layout — a cmaps-sized int[] of tile indices and a float[] of heights — so the record is rasterizable by the terrain machinery in terrain-raster.md, once these four differences are paid.

The record The live cache What has to happen
DataGrid.tiles, indices into this grid’s own tilesets MCache.Grid.tiles, this session’s tile ids, indices into MCache.sets remap per grid, through a name→id map the reader keeps for itself
TileInfo.res, a Resource.Saved MCache.sets[id], an Indir<Resource> the same shape already; MCache.settileset (// addon:) is the two lines filltiles3 runs with no wire message around them
DataGrid.zmap, Grid.id MCache.Grid.z, .id copy. The id seeds each Cut’s Random, so a place meshes identically every time it is built
DataGrid.ols, a Collection<Overlay> keyed by resource MCache.Grid.ols/.ol, parallel arrays not the same shape at all — and MCache.Grid.getol walks ols.length unguarded, so a grid filled from the record needs empty arrays, never null

Gotchas