typed-factorio 2.0.0+ stopped declaring types as ambient globals - they
now live in virtual modules ("factorio:runtime", "factorio:common",
"factorio:settings") and must be explicitly imported. Adds those imports
throughout events-mod. Also:
- Bumps typescript-to-lua 1.11.1 -> 1.25.2 and typescript 4.9 -> 5.4.2,
since tstl pins an exact peer TypeScript version and typed-factorio
3.x needs a newer one than 4.9 supports (a real compiler bug in
TS 4.9 against the generated defines.segmented_unit_ai_state enum).
- Bumps the pinned isolated Node (14.19.1 -> 24.21.0), since
typescript-to-lua 1.25.2 requires Node >=16.10.0.
- Renames bare uint/int -> uint32/int32 (import aliases), since the
unsized aliases no longer exist.
- Drops OnEntityDestroyedEvent from an unused documentation-only union
type - that event no longer exists in the 2.0 API.
- LuaEntityPrototype.max_health is now get_max_health() (quality-aware).
- Fixes a branded-type mismatch between our generated schema's
ForceIndex and typed-factorio's own ForceIndex.
Verified by actually running tstl end-to-end (clean compile, Lua
emitted) after installing a real JDK and Node toolchain.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
||
|---|---|---|
| buildSrc | ||
| docs | ||
| gradle | ||
| gradle-plugins | ||
| modules | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| kt52647.gradle.kts | ||
| LICENSE | ||
| README.md | ||
| settings.gradle.kts | ||
Kafkatorio
Kafkatorio is a platform used for creating Factorio mods that require communication with an external server.
Development is ongoing.
At present Kafkatorio is used to create a live-view web map, that shows the current status of a Factorio server, and any connected players.
However, Kafkatorio can be used for more than this. It has the potential to export metrics, and allow for inter-server communication.
Kafkatorio was created to explore the possibilities of using Apache Kafka to process updates from a Factorio server.
Running
Instructions for running a Kafkatorio instance are available in the docs.
Overview
This is a brief overview of how Kafkatorio gathers data, processes it, and uses it to create the live web-map.
Kafkatorio receives updates from a Factorio server, processes them, and exposes them over a REST and WebSocket APIs.
-
The Kafkatorio game mod,
events-mod, collects event data, de-bouncing and grouping events, and converts them to JSON packets -
events-modprints the packets to the Factorio game server logs -
The Factorio logs are forwarded to a Kafka cluster, either using
- syslog (using Docker logging plugin)
- or Kafka Pipe (a script that reads the server logs and forwards them to a Kafka topic)
-
The packets are consumed by
events-server, which processes the packets using Kafka Streams, creating and hosting map tiles.events-serverserves the map tiles via a REST API, and produces WebSocket messages regarding updates (for example, when a player's location has changed). -
The
web-mapuses Leaflet/JS to display the map, using the tiles and WebSocket messages fromevents-server
sequenceDiagram
Factorio multiplayer server->>events-mod: in-game events
Note over events-mod: converts events to packets
events-mod->>logs processor: packets logged to console
logs processor->>Kafka: publishes packets<br/>(Requires API key!)
Kafka->>events-server:
Note over events-server: Packets are processed
events-server->>web-map: Web map tiles (REST API)
events-server-)web-map: WebSocket updates<br/>(e.g. player movement)
License
Because I care about sharing improvements, Kafkatorio is licensed under the
GNU General Public License v3.0.