Skip to content

Typical workflow

The core loop of working with golem-engine is three steps, repeated as your game evolves:

  1. Edit YAML — add or change entity fields, commands, or world types in your schema files.
  2. Run golem-bake — regenerates the integration outputs you configured, such as Go server code, JS/TS clients, native Go clients, or engine bridges.
  3. Run your server — the updated generated code is immediately available to import.
Terminal window
# From your project root
golem-bake
go run ./cmd/server

Re-run golem-bake any time you change:

  • An entity field (vars in an entity schema)—adding, removing, or changing its type or sync mode
  • A command (YAML under your command_schema directory, default schemas/commands/)—new commands, renamed fields, changed targets
  • A world type (YAML under your world_schema directory, default schemas/world/)—new types, changed fields, or changed source: config
  • A server event (YAML under your event_schema directory, default schemas/events/)—new events, renamed fields, changed entity_type or foi_only
  • golem.yaml itself—output paths or integration settings

You do not need to re-bake when you only change Go game logic—OnTick handlers, entity methods, server startup code.

A typical project looks like this:

mygame/
golem.yaml # project config: schema dirs, output dirs, integrations
schemas/
entities/ # entity YAML (default entity_schema path)
player.yaml
enemy.yaml
commands/ # optional: command YAML (default command_schema path)
move.yaml
world/ # optional: one file per world data type (default world_schema path)
zone.yaml
types/ # optional: custom types for collections (default types_schema path)
item.yaml
events/ # optional: server event YAML (default event_schema path)
chat_message.yaml
internal/
synced/ # go-server output (generated, do not edit)
client/ # go-client output (optional, generated, do not edit)
views/ # ebiten bridge output (optional, generated, edit only if you choose to own scaffolds)
client/
src/synced/ # js-client output (generated, do not edit)
cmd/server/
main.go

The internal/synced/ directory (or wherever out: points in golem.yaml) is fully generated—commit it to source control so your CI doesn’t need to run golem-bake, but treat it as read-only.

If you’re starting from scratch:

  1. Create golem.yaml at your project root—see golem.yaml reference.
  2. Add at least one entity schema under the directory set by entity_schema (default schemas/entities/).
  3. Run golem-bake to produce the initial generated output.
  4. Wire golem.Server with the generated MarshalEntityRemoved and start building—see Minimal server wiring.

See also Installation if you haven’t set up the CLI yet.