Overview
golem-engine
Section titled “golem-engine”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-bakeoutput: typed Go server, Go client, JavaScript (plus.d.ts), C#, and engine bridge scaffolds generated from your YAML, with anentities.protoreference so the same message shapes are visible to every toolchain.- Live entity tracking on
golem.Server: register entities withCreateEntity, 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: 3to replicatepos_zand 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.
Is it for you?
Section titled “Is it for you?”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.
How it fits together
Section titled “How it fits together”- Describe entities (and optionally commands) in YAML next to
golem.yamlin your project. - Run
golem-baketo writeentities.proto(reference) and the integration directories you configured, such asgo-server,js-client,go-client, or engine bridges likephaserandebiten. - Implement ticks:
CreateEntity/Get/DeleteEntityongolem.Server, thenRunfor the loop and flush. - Connect clients: set
Addrand the server handles the selected transport, world snapshots on join, and per-tick broadcast automatically. Incoming reliable bytes feed the generatedCommandRouterwhen you use commands.
Minimal shape of that pipeline:
# golem.yaml (abbreviated)proto: out: gen/entities.protointegrations: go-server: golem_import: golem-engine/golem out: internal/syncedgolem-bakeThat 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.