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

FieldMeaning
idStarts with its layer and a colon, like war-zone:12,40. A producer replaces its layer whole.
styleWhat it stands for: WAR_ZONE, PROTECTED_ZONE, STRONGHOLD_GROUNDS, SETTLEMENT, PROVINCE, TREASURE. The clients own the look of each style.
shapeA circle (centre and radius) or a polygon (a closed ring of points).
labelOptional, like a Stronghold’s or a province’s name.
foggedShown only where the viewer has charted.
masterIdSet 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 one MapMarkersChanged event 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 a MapMarkersChanged live 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 (level L is 2^L metres per pixel). rev is 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

  1. Pick a layer name and a MapMarkerStyle. Add the style’s look to map_view.gd and markersLayer.ts.
  2. 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.
  3. A marker for one master sets masterId and accountId, and its layer holds only that master’s markers.

Last updated 04 Dec 2026, 01:08 +0100 . history