garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/adr/012-interest-management-and-osm-tiles.md

raw

ADR-012: Interest Management and OSM Tiles


Metadata:


Context

Problem: Sending all regions/prims to every client wastes bandwidth as the world grows. AOI (area-of-interest) filtering must decide which world DTOs (ADR-011) and avatar updates (ADR-010) a client receives, using the same anchor math as OSM tile selection (ADR-004, ADR-006). v0 keeps this simple (radius) before any prioritization queues.

Decision

Interest management v0: the server tracks each client’s observer position in sim space and includes only regions/prims within a configurable radius (aoi_radius, default 500 m). OSM tiles are not proxied through the sim; clients derive TileKeys (ADR-006) client-side and fetch over HTTP (ADR-004). The server’s role stays world + avatars only.

Implementation (cartopolis_simulator/src/state.rs, net.rs):

Rationale

Primary Reasoning:

  1. Scales world size: Reduces replication fan-out.
  2. OSM alignment: Tile choice follows the same spatial truth as AOI when coords are shared (ADR-006).
  3. Incremental: Radius AOI is easy; a distance prioritizer can plug in later.

Alternatives Considered:

AlternativeProsConsRejected Because
No AOI v0FastestBreaks at medium worldsSmall extra design now saves pain
Server proxies all map tilesSingle choke pointBandwidth + ToU complexityDefer
Grid-only AOIFast queriesRough at region boundariesCan combine with radius

Consequences

Positive:

Negative:

Related