3. Start from a bare world
Status: partly implemented. The
gamebuilderCLI, itsworld.edit.v1batch wire,--attachUI bridge, andplay-testrunner exist today in GameBuilder (gamebuilder/), and GameBuilder embeds directly inside OpenAgents Desktop's right-side Metaverse pane (apps/openagents-desktop/page/metaversepane.coax,gamebuilder/core/desktop-bridge.coax,#14043–#14045, gated for Desktop packaging viaOA_PACK_METAVERSE,#14057). Five live worlds publish ongamebuilder.org(Fated Dragon, SPLICEBOTS, Ice Cream Man, *Scrappers Arena*, and The Whispering Spring). Everglade's custom Coax modules live ineverglade/andrules/srd/. This chapter walks through the GameBuilder workflow from a bare world and shows where Everglade drops down into Coax and the Metaverse Engine.
You don't start Everglade by hand-wiring a web page and a shader pipeline. You start from a bare world in GameBuilder, driven programmatically from the command line, dipping into the desktop UI whenever you want to look around or tweak something by eye. This chapter answers the builder's question: "How do I create a bare world, build it up with commands and batches, see it in the app, and know when to drop down to engine code?"
What this chapter teaches
- How to create a bare world and inspect its things, shape table and palette with the
gamebuilderCLI. - How to build up a level programmatically with
add,set-field,deleteand atomicworld.edit.v1batches (apply-edits --dry-run). - How to dip into the GameBuilder desktop UI with
--attach,open-level,show-changesand one-step undo (⌘Z). - How to verify a level headless with
play-test, and where GameBuilder ends and Coax / the OpenAgents Metaverse Engine begins.
The CLI at a glance
Every gamebuilder (or gb) command answers JSON ({"ok":true,...} or {"ok":false,"error":CODE,"why":WORDS}). Exit code 0 means done (or a clean dry run), 1 means refused with the exact limit that refused it, and 3 means no such command.
| Group | Key verbs | What it does |
|---|---|---|
| Discovery | version, whoami, commands, list-templates | Check the install, account, full JSON command table and starter game types |
| Games & levels | new-game, list-games, new-level, list-levels, copy-level, rename-game, rename-level | Create and organize games and levels |
| Reading | read-level, read-state, read-content, list-palette, list-fields | Inspect things, shape rows, revision (rev), allowed kinds and field ranges |
| Editing | add, set-field, delete, apply-edits | Change one thing or land a world.edit.v1 batch atomically |
UI bridge (--attach) | open-level, changes, show-changes, dismiss-changes, undo, redo, focus | Drive the open GameBuilder desktop app and highlight external edits |
| Testing & publishing | play-test, publish, published, versions, set-live | Run headless bot walk-throughs and publish playable web links |
| Engine boundary | engine, engine-list, engine-read, triage, engine-ready, engine-mine | Inspect the pinned Metaverse Engine commit and propose engine PRs |
Run gamebuilder commands whenever you want the complete machine-readable list of verbs, arguments, flags and limits.
Step 1: Start a bare world
Check that the CLI is installed, then list the starter templates:
gamebuilder versiongamebuilder list-templatesGameBuilder ships templates such as third-person, adventure, village, field, platformer, crates and arena. For an open third-person world like Everglade, start from adventure (a place to walk around, seen from behind) or third-person:
gamebuilder new-game adventuregamebuilder list-gamesnew-game creates a game and its first level—a starter place with a few things already in it. Read the level and its palette before you change anything:
gamebuilder read-level 1gamebuilder list-palette 1gamebuilder list-fieldsread-level returns:
rev: the revision you read. Everyworld.edit.v1batch must name this exact revision; if anything changed the level in between, the batch is refused asstale.things: every thing in the level—itsid,kind(row in the shape table),is(kind name), position (x,y,zin centimetres, withyup andznorth),yaw(whole degrees,-180to180) andscale(percent,10to1000).content: the level's shape table (ID|KIND|WIDTH|HEIGHT|DEPTHin cm).locked:trueif the level isn't yours to change (usecopy-levelto make your own copy).
Step 2: Build programmatically with world.edit.v1
For a single quick tweak, add, set-field and delete are enough:
gamebuilder add 1 tree --x 600 --z -400gamebuilder set-field 1 12 yaw 45gamebuilder delete 1 7For real layout work—clearing starter props, framing a glade, placing a ring of trees and a path marker—send one atomic world.edit.v1 batch. Either the whole batch lands as a single undoable step, or none of it does.
A worked example: frame the first glade
Suppose read-level 1 returned rev: 3, a starter prop at id: 4, and a shape table where row 2 is a tree and row 5 is a rock. Write glade-batch.json:
{"schema":"world.edit.v1","rev":3,"do":"apply","edits":[ {"op":"despawn","id":4}, {"op":"spawn","id":0,"kind":2,"x":-600,"y":0,"z":-500,"yaw":15,"scale":110}, {"op":"spawn","id":0,"kind":2,"x":650,"y":0,"z":-450,"yaw":-30,"scale":100}, {"op":"spawn","id":0,"kind":2,"x":-550,"y":0,"z":600,"yaw":90,"scale":120}, {"op":"spawn","id":0,"kind":5,"x":400,"y":0,"z":350,"yaw":20,"scale":95}]}Always dry-run first, then apply, then read the level back:
gamebuilder apply-edits 1 glade-batch.json --dry-rungamebuilder apply-edits 1 glade-batch.jsongamebuilder read-level 1Key rules of the wire:
- Exact field order. Each edit keeps its fields in the order shown above.
- Bounded batches. At most 64 edits per batch, coordinates within
±20000cm onxandz(0to20000cm ony), and at most 64 shape rows per level. - Idempotent retries. Pass
--key Kwhen a script might retry a call; the same key replays the first result without applying the edit twice. - New sizes. Add a new shape row in the same batch before spawning it:
{"op":"cell","table":"shape","row":N,"col":"*","v":"N|block|400|50|200"}.
Step 3: Dip into the UI
Programmatic building doesn't mean working blind. When you want to orbit the glade, check sightlines, or nudge a boulder by hand, open the level in the GameBuilder desktop app:
gamebuilder --attach open-level 1With --attach, CLI commands talk directly to the running app instead of writing files underneath it:
gamebuilder --attach apply-edits 1 glade-batch.jsongamebuilder --attach changes 1gamebuilder --attach show-changes 1show-changesswings the viewport camera to frame every thing your batch added, moved, changed or removed.⌘Zin the app (orgamebuilder --attach undo) takes back the entire batch in one step.dismiss-changesclears the highlights once you've checked them.
If you edit the level's files on disk without --attach, close the level in the app first so the app's next save doesn't overwrite your CLI changes.
Step 4: Test headless and publish
Before you call a layout done, run the headless play-tester:
gamebuilder play-test 1For an adventure or third-person level, play-test runs a deterministic bot walk-through from the player start to every reachable thing and reports where the bot got stuck and which things it couldn't reach. The same call answers the same every time.
When you want someone else to walk around in it, gamebuilder publish 1 "Everglade Glade" publishes a playable web link that stays stable across versions.
Step 5: Where GameBuilder ends and the engine begins
As Everglade grows from a bare glade into an MMORPG, you will hit a clear three-way boundary:
- The level (GameBuilder CLI). What is in the world, where it stands, how big it is, and how it is laid out. Solved with
add,set-field,apply-editsandplay-test. - The game (GameBuilder app). Built-in templates, palette kinds and editor tools.
- The engine (Coax + OpenAgents Metaverse Engine). Terrain tiles, procedural forest planting, custom lighting profiles, rock hulls, room networking and SRD combat rules.
Before writing engine code, check what the pinned engine already has:
gamebuilder enginegamebuilder engine-listgamebuilder engine-read 4When Everglade needs a new engine primitive—something any world can reuse—run gamebuilder engine-ready to check your fork and tools, build the primitive with #test checks in OpenAgentsInc/openagents, and open a pull request.
Part II of this book is where Everglade drops down to Coax and the Metaverse Engine to build the glade's ground tiles (everglade/world/ground.coax), procedural forest (everglade/world/forest.coax, plant.coax), lighting (everglade/world/environment.coax) and exact colliders (everglade/shared/move.coax), checking each with coax/bin/coax test:
coax/build.shcoax/bin/coax test --library everglade/world/forest.coaxcoax/bin/coax test --library everglade/world/plant.coaxcoax/bin/coax test --library everglade/shared/move.coaxMistakes
- Editing on disk while the level is open in the app. Without
--attach, the CLI writes to the level file on disk. If the app has that level open, its next save overwrites your batch. Either pass--attachor close the level in the app first. - Skipping
--dry-run. A typo in a field order or a coordinate past20000cm refuses the batch. Running--dry-runfirst validates the whole plan with zero side effects. - Ignoring a
stalerevision. If you tweaked something in the UI and then re-ran an old batch file,apply-editsrefuses it asstale. Runread-levelagain, inspect the newrev, and re-plan. - Fighting the palette instead of checking the engine. If you find yourself stacking 50 blocks to fake terrain or lighting, check
gamebuilder engine-list—you have crossed from level layout into engine primitives.
Expected output & broken case
- Expected output: Running
gamebuilder apply-edits --dry-run <batch.json>on a validworld.edit.v1batch prints the validated entity count and exits0without mutating the level file. - Broken case (refusal): Submitting a
world.edit.v1batch with an unknown palette shape ID or out-of-bounds transform fails--dry-runwith a structured validation error and applies zero partial edits.
What comes next
Part II builds the glade below the level layer. Chapter 4 starts with the ground.