Skip to content

Game servers

Every time you are hunting a Kacky map, you are connected to a Trackmania 2020 dedicated server: the same kind anyone can run, just loaded with the Kacky map pool and a lot of custom logic bolted on. A dedicated server on its own is dumb: it runs the maps and reports raw events. It does not know what a "finish count" is, or how to draw the in-game record list. That is a second program's job.

kontrol: the controller next to each server

Next to every Trackmania server runs a controller called kontrol. One kontrol per server, paired up. kontrol is the in-game brain. It talks to the game server locally. It renders the in-game UI you see, the record widgets and lists. It reports what happens back to the Kacky backend.

kontrol is a fork of an open-source controller (MiniControl) with the Kacky-specific features layered on top. It is written in TypeScript. When you cross the line, kontrol turns the server's raw event into a clean "player finished" message. kontrol publishes that message over Redis Streams to the backend. You can follow that whole finish journey end to end, or see the architecture overview for where it fits.

Where all this physically runs

None of it runs on some player's PC. Everything lives on Hetzner Cloud, our server sponsor, as rented virtual servers (VPS).

  • Game hosts run the Trackmania server and its kontrol side by side, as a pair of Docker containers sharing a local network. The Trackmania container comes from EvoEsports' open-source docker-trackmania image. The permanent hunting servers and the event servers each get their own host.
  • A separate utility host runs Redis, the pipe kontrol uses to reach the backend.
  • The app host runs the backend and the websites.

How the fleet is kept up to date

The whole fleet is set up and updated with Ansible (infrastructure-as-code: the servers are described in files, not clicked together by hand). Container images are built in CI and pulled from a registry. Running the servers walks through the whole flow.

Every box also runs Portainer, a web dashboard for its Docker containers, so someone can look at them without touching a terminal. A kontrol update restarts only the controller container. The game server beside it keeps running, so nobody gets kicked: you stay connected mid-hunt.

The older Trackmania Nations Forever servers

Kacky also runs some older Trackmania Nations Forever servers. Those do not have kontrol next to them yet.