No description
Find a file
2022-10-18 19:46:21 +02:00
buildSrc fix kotlinx-coroutines/kotlinx-serialization dependencies version clash in gradle-plugins 2022-10-08 17:06:04 +02:00
gradle revert kotlinx serialization to 1.4.0 https://github.com/Kotlin/kotlinx.serialization/issues/2065 2022-10-18 19:46:21 +02:00
gradle-plugins kdoc for DockerEnvUpdateTask 2022-10-15 20:41:03 +02:00
modules version 0.9.9 2022-10-17 00:18:33 +02:00
.gitignore migrate buildSrc plugins to includedBuild plugins 2022-09-18 20:49:32 +02:00
build.gradle.kts rm commented out code from root build.gradle.kts 2022-10-17 22:01:22 +02:00
gradle.properties set org.gradle.jvmargs 2022-10-15 23:53:33 +02:00
gradlew gradle 7.5.1 2022-08-13 11:56:07 +02:00
gradlew.bat gradle 7.5.1 2022-08-13 11:56:07 +02:00
kt52647.gradle.kts add 'Projects must be configuring' workaround script 2022-07-17 12:12:13 +02:00
LICENSE added kvision web-map, cleaning up a few gradle things (tokens) 2021-12-06 22:15:26 +01:00
README.md web-map tidy up, and add diagram to README 2022-09-03 11:15:43 +02:00
settings.gradle.kts rename 'convention' package to 'conventions' 2022-09-18 23:32:39 +02:00

Kafkatorio

Kafkatorio is a platform used for creating Factorio mods that require communication with an external server. It was created to explore the possibilities of using Apache Kafka to process updates from a Factorio server.

Kafkatorio receives updates from a Factorio server, processes them, and exposes them over a REST and WebSocket APIs.

Development is ongoing. At present the only application is a live-view web map, that shows the current status of a Factorio server, and any connected players. Other usage possibilities include exposing live metrics, and inter-server communication.

Overview

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)
  1. The Kafkatorio game mod, events-mod, collects event data, de-bouncing and grouping events, and converts them to JSON packets

  2. events-mod prints the packets to the Factorio game server logs

  3. 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)
  4. The packets are consumed by events-server, which processes the packets using Kafka Streams, creating and hosting map tiles.

    events-server serves the map tiles via a REST API, and produces WebSocket messages regarding updates (for example, when a player's location has changed).

  5. The web-map uses Leaflet/JS to display the map, using the tiles and WebSocket messages from events-server

License

While this project is under development, no license is provided.