Add a building icon layer to the web map

events-server-web keeps the latest state of every building in memory (read
from the map-chunk-entity topic, like the resource patches) and serves them
per area. The web map draws the icons at their real size onto canvas tiles,
so large bases stay fast, and shows each building's name, status and health
on hover. Ghosts are ignored, and buildings are removed when they're mined.

The icons belong to Wube and the mod authors, so they aren't in the repo.
export_building_icons.py builds them from a Factorio client's
--dump-data/--dump-prototype-locale/--dump-icon-sprites output, and the
web-map nginx serves them from a mounted volume.

Also label single-well oil fields "1 well".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lazzexus 2026-10-21 09:52:07 +02:00
parent 4aba8d67f3
commit c773b05922
15 changed files with 615 additions and 5 deletions

View file

@ -88,3 +88,16 @@ on `127.0.0.1`, and Kafka isn't exposed at all.
WebSocket support is enabled.
7. In Factorio, run `/kafkatorio prototypes` and then `/kafkatorio chunks 10` to send the existing
map.
8. Optional: building icons. The web map's 'Building icons' layer uses icons and building sizes
exported from a Factorio client that has the same mods as the server (they're not in this repo,
since they belong to Wube and the mod authors). With the game closed, run
```terminal
factorio --dump-data
factorio --dump-prototype-locale
SteamAppId=427520 factorio --dump-icon-sprites # SteamAppId stops Steam relaunching the game
python3 docs/kafkatorio-platform/building-icons/export_building_icons.py ~/.factorio/script-output ./icons
scp -r ./icons root@<unraid>:/mnt/user/appdata/kafkatorio-platform/
```
Re-export them when the mods change.