Skip to content

Overview

Build an authoritative multiplayer game server in Go—without hand-writing serialization glue for every entity and every field you add.

golem-engine gives you:

  • A fixed tick loop so simulation stays deterministic and easy to reason about, with optional per-entity tick and lifecycle hooks so you can co-locate behavior with the entity it belongs to.
  • YAML-driven schemas for entities (dynamic, per-tick sync) and world data (static, server-authoritative).
  • golem-bake output: typed Go server, Go client, JavaScript (plus .d.ts), C#, and engine bridge scaffolds generated from your YAML, with an entities.proto reference so the same message shapes are visible to every toolchain.
  • Live entity tracking on golem.Server: register entities with CreateEntity, replicate spawns, removals, and per-tick deltas—then the loop hands ready-to-send bytes to your transport layer.
  • Integrated networking: set an address and the server handles HTTP, WebSocket or WebTransport sessions, world snapshots, and per-tick broadcast—with optional static file serving for game assets.
  • Interest management: each client receives only the entities near its avatar. Circular fields of interest with hysteresis keep bandwidth low and prevent boundary flicker—fully server-authoritative, opt-in via a single config field.
  • 2D or 3D entity positions: keep the default 2D sync path or set simulation.dimensions: 3 to replicate pos_z and use the pure-Go 3D collision MVP.
  • Optional client commands with typed handlers and, when you need it, per-session authority over entities.

Together, that covers the shared game state between server and clients—the part of netcode that is easy to get wrong when every message type is hand-rolled—so you can focus on gameplay and systems.

It fits if you want:

  • Server authority: gameplay rules live in Go; clients receive updates and send commands you define.
  • Declarative sync: describe fields and sync rules in YAML, regenerate when the design changes.
  • Binary, efficient updates: one schema-derived format for spawns, deltas, and removals—consistent message shapes end to end.
  1. Describe entities (and optionally commands) in YAML next to golem.yaml in your project.
  2. Run golem-bake to write entities.proto (reference) and the integration directories you configured, such as go-server, js-client, go-client, or engine bridges like phaser and ebiten.
  3. Implement ticks: CreateEntity / Get / DeleteEntity on golem.Server, then Run for the loop and flush.
  4. Connect clients: set Addr and the server handles the selected transport, world snapshots on join, and per-tick broadcast automatically. Incoming reliable bytes feed the generated CommandRouter when you use commands.

Minimal shape of that pipeline:

# golem.yaml (abbreviated)
proto:
out: gen/entities.proto
integrations:
go-server:
golem_import: golem-engine/golem
out: internal/synced
Terminal window
golem-bake

That path—from schema to bytes on the wire—is the core story. The rest of this documentation breaks that down by configuration, codegen, server behavior, and clients & networking.

Next: Installation, Workflow, Minimal server wiring, and Channels and transports.