Map Markers
One way to put shapes on the world map for the game and the companion app alike - war zones, ward fields, Stronghold grounds, settlement and province borders, treasure circles - kept by the zone and served by the api-server without a bus round trip.
A map marker is a shape on the world map: a circle or a polygon, in metres. War zones, ward stone fields, Stronghold grounds, settlement and province borders and treasure-map circles are all markers. The game client and the Companion App draw them from the same answer.
The marker
| Field | Meaning |
|---|---|
id | Starts with its layer and a colon, like war-zone:12,40. A producer replaces its layer whole. |
style | What it stands for: WAR_ZONE, PROTECTED_ZONE, STRONGHOLD_GROUNDS, SETTLEMENT, PROVINCE, TREASURE. The clients own the look of each style. |
shape | A circle (centre and radius) or a polygon (a closed ring of points). |
label | Optional, like a Stronghold’s or a province’s name. |
fogged | Shown only where the viewer has charted. |
masterId | Set for a marker only one master sees, like a treasure circle. Unset means everybody. |
The model lives in the bus module (MapMarker, MapShape), so the zone and the api-server share it.
Who keeps what
flowchart LR P[Producers in the zone] -->|replaceLayer| M[MapMarkers] M -->|MapMarkersChanged event| S[api-server MarkerStore] M -->|revision| G[Game client] S -->|marker tile| G S -->|LiveEvent + marker tile| A[Companion app]
- The zone keeps every marker in
MapMarkers. A producer replaces its whole layer; a real change raises the revision by one and goes out as oneMapMarkersChangedevent on the bus stream. The revision starts at the zone’s boot time, so a restarted zone always runs past the old numbers. - The api-server keeps its own copy in
MarkerStore. It applies each event. When it sees a gap in the revisions, its copy is stale, and the next request pulls all markers from the zone once (ZoneQuery.MapMarkers). - The game client hears the revision through
MapMarkersChangedSMSG, once after entering the world and after every change. The app hears it as aMapMarkersChangedlive event. Neither message carries the markers: only the revision, so a private marker never reaches anybody else’s socket. - Both clients then ask for the marker tiles in view again:
GET /v1/companion/masters/{id}/map/m/{level}/{x}/{y}?rev=N. The tiles are the map’s own (levelLis2^Lmetres per pixel).revis the revision the client heard of; a server copy behind it catches up before it answers. The ETag names the revision and the master’s charts, so an unchanged tile costs a 304.
In the normal case a marker tile needs no bus round trip: the api-server answers from its copy of the markers and its copy of the master’s charts.
Fog
The api-server keeps, per master, the charted blocks: the 4,096 m squares in which the master has charted
anything (ZoneQuery.MapCoverage, the blocks of the chart’s own coverage grid). It drops them on a ChartsChanged
event. A fogged marker goes on a tile only where its part on that tile touches a charted block.
The grain is coarse on purpose: a marker shows up to a block’s width beyond the charted land, but the whole set stays small enough to keep for every master who looks at the map. War zones and treasure circles are never fogged.
Polygons
A province border is traced on the place region grid and smoothed at boot, so it reads as a line and not as the
grid’s staircase (ProvinceBorderBootRunner). The api-server simplifies each polygon again per zoom level, to about
one pixel of that level (Ramer–Douglas–Peucker), and caches the result. Far out, a province is a few dozen points.
Adding a marker
- Pick a layer name and a
MapMarkerStyle. Add the style’s look tomap_view.gdandmarkersLayer.ts. - Call
MapMarkers.replaceLayer(layer, markers)whenever the layer changes. Calling it with an unchanged list sends nothing, so a system may call it on a cadence. - A marker for one master sets
masterIdandaccountId, and its layer holds only that master’s markers.
Last updated 04 Dec 2026, 01:08 +0100 .