Typical workflow
Typical workflow
Section titled “Typical workflow”The core loop of working with golem-engine is three steps, repeated as your game evolves:
- Edit YAML — add or change entity fields, commands, or world types in your schema files.
- Run
golem-bake— regenerates the integration outputs you configured, such as Go server code, JS/TS clients, native Go clients, or engine bridges. - Run your server — the updated generated code is immediately available to import.
# From your project rootgolem-bakego run ./cmd/serverWhen to re-bake
Section titled “When to re-bake”Re-run golem-bake any time you change:
- An entity field (
varsin an entity schema)—adding, removing, or changing its type or sync mode - A command (YAML under your
command_schemadirectory, defaultschemas/commands/)—new commands, renamed fields, changed targets - A world type (YAML under your
world_schemadirectory, defaultschemas/world/)—new types, changed fields, or changedsource:config - A server event (YAML under your
event_schemadirectory, defaultschemas/events/)—new events, renamed fields, changedentity_typeorfoi_only golem.yamlitself—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.
Project layout
Section titled “Project layout”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.goThe 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.
First-time setup
Section titled “First-time setup”If you’re starting from scratch:
- Create
golem.yamlat your project root—seegolem.yamlreference. - Add at least one entity schema under the directory set by
entity_schema(defaultschemas/entities/). - Run
golem-baketo produce the initial generated output. - Wire
golem.Serverwith the generatedMarshalEntityRemovedand start building—see Minimal server wiring.
See also Installation if you haven’t set up the CLI yet.