Commit graph

20 commits

Author SHA1 Message Date
Lazzexus
ba9cbe5afe Reduce memory use of the JVM services
The services now run on Java 17, with a periodic G1 GC that returns unused
heap to the OS when idle. Previously Java 11 kept the committed heap, so
events-processors held 5.5 GB while its live data was ~250 MB.

All RocksDB state stores now share one bounded block cache and write buffer
(ROCKSDB_TOTAL_MEMORY_MB, default 256 MB), instead of each of the ~45 stores
having its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:31:04 +01:00
Lazzexus
e1e59fe66c Draw belts, underground belts and splitters with their direction
Belts are drawn like the in-game map: a strip in the colour of their tier
(taken from the icon of the transport belt of the same tier), with an arrow
per lane in the direction items go. Splitters are drawn at their rotated
2x1 footprint with a bar across the back.

The mod now sends whether an underground belt is an entrance or an exit.
Entrances are capped on the side where items go underground, exits on the
side where they come out, and the hover tooltip says which it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:21:11 +01:00
Lazzexus
9d1f9b7623 Show building rotation, recipes and other surfaces on the web map
The mod now sends each building's direction and recipe (furnaces: the last
recipe, since they only have one while working).
- Rotated buildings are drawn at their real footprint.
- Crafting machines show their recipe icon, like Factorio's alt mode, and
  the hover tooltip includes the recipe.

The web map has a surface drop-down (e.g. Space Exploration planets and
orbits), backed by a new surfaces endpoint. Every layer, the resource labels
and the player markers follow the chosen surface.

Resource labels use the in-game names (e.g. "Iridite" instead of
"Se iridium ore"). export_building_icons.py also exports recipe icons, plus
recipe and resource names.

The three in-memory views in events-server-web now share one helper for
following a Kafka topic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 10:14:39 +02:00
Lazzexus
c773b05922 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>
2026-10-21 09:52:07 +02:00
Lazzexus
3d8673fe03 Add resource patch labels to the web map
Group nearby resource tiles of the same type into patches, and label
them on the map, e.g. "Iron ore / 2.4M", or "Crude oil / 12 wells".

- events-library: ResourcePatch model, shared by the server and map.
- events-server-web: ResourcePatchService reads the map-chunk-resource
  topic from the beginning (read_committed) into memory, and on request
  groups tiles into connected patches (join distance 2 tiles for ore,
  12 for infinite resources, whose wells are spread out). Results are
  cached until new data arrives.
  New endpoint: GET .../servers/{id}/map/resources/s{surface}/patches
- web-map: toggleable "Resource patches" overlay with labels at each
  patch centre and a hover tooltip, refreshed every minute. Patches
  under 10 tiles are hidden. (Surface 1 only, like the rest of the map.)
- events-mod: mark resources infinite based on the prototype's
  infinite_resource. Entity initial_amount is nil for e.g. crude oil, so
  oil fields were treated as hundreds of tiny ore patches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 07:07:23 +02:00
Lazzexus
d023ec61d9 Fix web map blanking and websocket dropping behind a reverse proxy
- web-map: main() was bound to the whole site state, so every state
  update (e.g. each player position update over the websocket)
  re-rendered the page and re-attached the Leaflet map to a new
  element, blanking the tiles. Only re-render when the view, server
  list, or map instance changes.
- web-map: reconnect the websocket when it closes, instead of silently
  stopping live updates.
- events-server-web: send websocket pings every 30s, so idle
  connections aren't closed by reverse proxies (nginx defaults to a
  60s read timeout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 18:09:03 +02:00
Adam
5562e86f09 [docker-files] remove user config 2022-10-22 23:36:00 +02:00
Adam
82c681e320 [dockerfiles] remove volumes 2022-10-22 20:35:52 +02:00
Adam
45691a049b [dockerfiles] fix user name/id variables 2022-10-22 20:27:17 +02:00
Adam
c9d21fa25a try fixing user permissions in containers 2022-10-22 20:24:27 +02:00
Adam
9b331cc105 update dockerfiles
- define user uid/gid
- use new geedeecee files (hopefully means smaller images, faster building)
2022-10-22 19:55:02 +02:00
Adam
b0722487a0 fix appProps in events-server-web 2022-10-08 14:20:01 +02:00
Adam
18bdfb70b1 fix dockerfile entrypoint run script 2022-10-08 13:50:16 +02:00
Adam
4c5ed2dc73 give +x to docker apps, tidy up docker conf 2022-10-08 13:05:24 +02:00
Adam
562296aa96 Dockerfiles: add syntax=docker header 2022-10-04 22:28:04 +02:00
Adam
0044f0cb98 create and use APP_NAME, APP_GROUP in docker compose files 2022-10-04 22:27:43 +02:00
Adam
3758906bb8 enable pushing of events-server-web docker image 2022-10-02 14:51:13 +02:00
Adam
f804c39a3b migrate docker-compose convention plugin out of buildSrc 2022-10-02 12:11:06 +02:00
Adam
f12a505d22 migrate buildSrc plugins to includedBuild plugins 2022-09-18 20:49:32 +02:00
Adam
873983f9a3 big ol' refactor to split up the events-server and events-processors 2022-09-13 17:56:57 +02:00