Pekko Game Service

Scala and Pekko backend for turn-based multiplayer games, with a browser client

Image 1 of 2: Liar's Dice in two browser windows, one per player, after a Liar call reveals the dice

A backend for multiplayer turn-based games on Pekko typed actors: accounts, lobbies, rematches, server-side move validation, per-turn timeouts, AI bots and fog-of-war views pushed over WebSockets, with Postgres, a Redis cache, Prometheus metrics and eight games from Tic-Tac-Toe to Texas Hold 'Em.

Trade-offs

  • One actor per match serializes its moves, so concurrent requests can't corrupt state, with no locks or shared mutable state.
  • Snapshot writes are fire-and-forget: a move's latency is never gated on Postgres, at the risk of losing the newest move in a crash.
  • It runs as one instance today; actor boundaries are drawn so Pekko Cluster Sharding can spread games across nodes later.

Q&A4

A game actor never ships raw state. Every reply and push is rendered per viewer through a GameStateView type class, so players see their own hand and spectators a fog-of-war view.

Reviews

Loading reviews

    More in Scala

    • ScalexScala code navigation for coding agents, from source and without a build
    • DederA client-server JVM build tool with Pkl config and concurrent task stages

    More in Game dev

    See all 22 →
    • Rigby2DOpen-source 2D skeletal animation editor for games and film
    • Raising HellA Tamagotchi-style virtual pet game for the M5Stack Cardputer ADV
    • WhimTexA sprite and texture editor inside Unity, with layers that stay editable
    • GodotMakerAgent workflow that turns a game idea into a tested Godot project
    • CSG_BlockoutLevel blockout in Godot with native CSG nodes, from drawn rooms to playtest
    • SculptForgeOpen-source digital sculpting app for Linux, macOS and Windows

    More in Distributed systems

    See all 20 →
    • arbiterPostgreSQL job queue for Haskell, with no broker and no leader
    • RRQClosed-loop payment ledger on sharded Postgres with a Kafka outbox
    • RuvioRust key-value server that speaks RESP, with locks and queues as commands
    • EgresPostgres-compatible database in Zig for heavy, multi-tenant workloads
    • clinkC++ stream processing engine that stays correct when processes die
    • pg-statusSidecar that reports PostgreSQL master, replicas and replication lag