Log inGet started

Worlds & ZeroMind

Updated December 6, 2026

What a world is

Everything under /zero/source belongs to the world: it persists and is shared live with everyone connected (the engine guide covers the persistence model). A world has an identity, a branch, and a set of participants:

world.guid()                                 -- the current world's id (nil if none)
world.branch()                               -- the branch, e.g. "main"
world.name()                                 -- the handle it answers to
world.title()                                -- the display name ZeroMind shows
world.participants()                         -- who's currently connected
world.on("player_join", function(p) end)     -- react to joins / leaves

Creating and switching worlds

world.create(name, title)        -- create a new world; returns a promise resolving to its guid
world.swap(worldGuid)            -- point the engine at another world (all vfs/zm calls retarget)

How a new world starts

A world is made empty and seeded by the first editor that opens it: its settings, its entrypoint, the game menu tab, and a startup scene copied from a starter. The start a world is made with picks the starter:

StartStartup scenePackages installed
clearing (the default)a campfire clearing: terrain with a path and a pond, a sky that runs through the day, weather that opens fair, trees, rocks, a fire, seats and a lantern, everything under one clearing entityTidewater, as the library @tidewater, Cloudburst, as the library @cloudburst, and Controllers, as the library @controllers, each pinned at one version; the pond is Tidewater's water, the weather is Cloudburst's, and the player walks with Controllers' character controller and its camera follows with Controllers' orbital_follow
emptya blank scene with a cameranone
playera flat lit ground with the default playerControllers, as the library @controllers, pinned at one version; the player walks with its character controller and its camera follows with its third_person_follow
tools.use("zeromind", "create", "Kart Racer", { start = "empty" })   -- a world that opens empty

The launcher's Create view offers Start empty beside Make it, and the MCP world.create tool takes start for the engine start_instance boots on that world. The packages a start installs are the ones its starter scene declares in its .metadata (packages); scene.create with the clearing or player template installs the same ones into a world that lacks them. A package the start installs that cannot be installed (no network, a refusal) leaves no pin and is named in a notice; the world is seeded without it. A world that holds the clearing is cleared to its player setup in one step: tools.use("scene", "clean"), or Clear the scene in the Entities panel's menu.

An engine that waits for a world

An engine can boot with no world and wait for one: --await-world on the desktop, awaitWorld=1 in a browser launch, and the world chooser a desktop or Android app opens when it is started with no world. It runs its world-independent boot to the end (renderer, built-in library, scripting, the profile's shell), marks world_awaited on its boot timeline, and holds /zero/source closed: world.syncStatus().binding.state reads waiting, and a /source write is refused by name (scratch under /source/tmp/ is taken). A world is then bound and left in the same process:

world.waitState()                               -- nil on an engine booted with its world; { waiting, chooser, next, bound?, binds, leaves, ... } on one that waits
world.bind(worldGuid, { profile = "editor" })   -- load a world here: "editor" edits it (mode "edit"), "runtime" plays it (mode "play")
world.leave()                                   -- unload it and wait again; the next world.bind binds another

While it waits, the state block of every execute response says so as well: world.state is waiting, and world.waiting carries chooser (true while the world chooser is on screen) and next (what binds a world from here), the same two world.waitState() answers. A capture from a camera source (main, editor, screen) whose camera is missing on a waiting engine is refused with the same next.

Each answers at once with whether it started. The bind's load is the newest load on the boot timeline, from load_started to visually_complete, and world.waitState().waiting reads true again once a leave has finished. A leave made in play ends the play session, as world.swap and world.checkout made in play do: while the session holds unaccepted changes the call is refused with the accounting engine.mode = "edit" gives, and engine.discardPlayChanges() arms the next one past it.

An app opened with no world shows the app menu's ZeroMind tab first, on the screen the device's earlier opens and the account choose: the world of a first game on the first open, the editor of the world opened last in the editor, or the Create screen. A launch names the view it opens on instead with launcherView=<view> in a browser launch or --launcher-view <view> on the desktop (create, home, mine or explore): a page that exists to make a game boots with launcherView=create and lands on the Create screen's idea bubbles whatever the device opened before. Such a boot is a chooser boot and waits for the world chosen in it, and a launch that also names a world, a pack or an offline session boots that and opens no tab. A page that shows the engine below its own top bar adds hostNavigation=1 (--host-navigation on the desktop): while no world runs, the ZeroMind tab then stands in the whole window with no app menu frame and no navigation row of its own, so the page's navigation is the only one on screen, and a step back (Escape) ends on the view the tab opened on; once a world runs, the menu over it keeps its frame and the tab its navigation.

Deleting a world, the trash, and restoring one

A world you made for a check, such as a scratch or throwaway world that proves a fresh install, is deleted once the check is done. The zeromind toolbox deletes, lists and restores worlds:

tools.use("zeromind", "deleteWorld", guid)    -- delete a world you own into ZeroMind's trash
tools.use("zeromind", "trashedWorlds")        -- the deleted worlds, with when each is purged
tools.use("zeromind", "restoreWorld", guid)   -- bring a deleted world back before its purge

In the shell the same calls are zero zeromind deleteWorld <guid>, zero zeromind trashedWorlds and zero zeromind restoreWorld <guid>. A deleted world leaves every listing at once and stays in ZeroMind's trash for its retention window (30 days); the delete answer names when it is purged for good (purge_at) and the restore call. Only the world's owner deletes or restores it (an agent account acts for the person who owns the worlds it creates), and the world this engine is bound to is refused until the engine swaps to another world (zeromind.swap). The world a swap left stays refused until ZeroMind routes this engine's calls to the new world, once that world has loaded and the call that carried the swap has been answered, so the delete goes in a later call than the swap. world.trash() and zm trash are a different trash: the files and commits removed inside the current world.

What players see while the world loads

Every boot of a world shows a loading screen from the moment the engine knows which world it is loading until the world draws its first frame. A world brands it with a loadingScreen asset (its title, a line of text or rotating tips, a background picture, a logo, its colours and how progress is drawn) named in the world's settings:

local screen = asset.create("loadingScreen", "title", { folder = "branding" })
vfs.write(screen.path .. "/screen.yaml", 'title: "Skyward"\ntext: "The islands are waking up"\n')
world.loading_screen = screen    -- [world] loading_screen in .world_settings

screen:preview() draws it over the window the way a boot does, so it can be looked at and captured. It is world content, published with the world, and a world that names none shows the engine's own screen. types/loadingScreen is the full reference.

ZeroMind

ZeroMind isn't only the backend: it holds everything published, the worlds and assets other people and agents have made. All of it is open to install, change and build on, the way open-source code is: what you bring in from it is worked on like the rest of this world's code, and changing it and sending the change back is what keeps it working and lets it grow.

You search, install, run and extend published content with the zeromind toolbox. zeromind.search is ZeroMind's search engine and knowledge base. Installing is how a hit is tried: zeromind.installAsset lays an asset and everything it depends on into your /source/, and you put it to the job there. Where it first fails is what it still lacks, and you change and finish it like the rest of this world's code; zm pr create <install root> sends the change back to where it came from, so everyone who uses it gets it. zm ls-tree @<guid>, zm grep <pattern> @<guid>, zm show @<guid>:<path> and zm log @<guid> read a hit's files in the shell, zeromind.inspect reads its record and thumbnail, and zeromind.preview shows what an install would write without writing anything: where it lands, each dependency it brings, how many files of each kind and their size (files = true lists every file). Rate what you used with zeromind.rate, file a defect you found in it as an issue its owner reads with zeromind.fileIssue, and say what you found with zeromind.comment; the core/collaborating guide covers rating, commenting, issues, sending fixes upstream, reviewing what others send and staying in sync. Searching surfaces candidates; installing brings the content into your world, where you reference it by its identity. Libraries available in the current world are listed with library.list(), and library content lives under /zero/source/libs/@<namespace>/, referenced as @<namespace>::... (just like @builtin::...).

zeromind.installAsset's path option is the destination directory to install into, not a rename: the asset keeps its own name and category suffix, so path = "/source/combat" lands a sea.material at /source/combat/sea.material (a .material folder the registry recognizes). It defaults to /source; dependencies land under /source/deps/<owner_world>/.

An install is one entry in the world and in Source Control: the asset at its root path, which every engine materializes the files from; installed files appear as changes only when you edit them. The installed files are ordinary files: read, edit, move and rename them in place with the usual tools, and the edit runs. zeromind.installs (world.installs()) lists each install with its version, file count, dependencies, deleted paths and how many of its files you changed (changed), names an asset installed at two places in also_at, and names under releases each dependency it runs as a second copy beside the one the asset's name reaches.

An install you edited is a modified install: zm status lists it under "Installed content ahead of upstream", zm diff <root> upstream shows what you changed against the version you installed, and zm pr create <root> offers the changes back to the world the asset was published from, as one pull request there that carries your edits to the asset and to the dependencies it brought, each found by its guid wherever you moved it. A root inside a package (zm pr create kit.package/geo.module) takes the package's package.yaml with it when you changed it, because the pull request publishes a new version of the package under the version that file states: state a new version: there, and a version the origin already published is refused naming the file to change. An edit you keep in an installed asset is this world's own version of that file: it runs here, zm push publishes it with the rest of the world's content, and zm pr create <root> offers it to the world the asset came from when you want that world to carry it too. A push publishes each folder asset of the install that holds an edited, added or deleted file as a version of its own under this world: the checksum its files add up to, with every unedited file of it carried at the version its origin world published. Content of this world that references the edited asset names that version, so an install of the content brings your edit with the content, and an install of the asset itself brings the origin world's version, or the exact version a guid and checksum name.

After your pull request merges. zm pr create --merge pulls the install again at the release that carries your edits. Each file you edited that the release now holds as you wrote it is the install's again: its row of the world's own leaves, so the next commit lists that row removed beside the change to the install's <root>.pull record, the record carries the file at the release, and zm status reads clean. A file under an install that zm status lists as untracked while its bytes are the ones the install's record states is a row of the world's own standing over the install's file: zm checkout --theirs <path> takes that row out, the install's file stands at the path, and zm status no longer lists it. The same step takes out such a row that a commit already holds: the install's file stands at the path with the same bytes, zm status then lists the path under "Dirty", and zm add <path> && zm commit records the row removed while the install's record carries the file.

Removing an install, and leftover dependencies. world.uninstall(root) (the uninstall tool of the zeromind toolbox, or the remove button on the install's row in the ZeroMind panel) takes the install's record out together with every dependency under /source/deps/ it placed or used that nothing else in the world uses. A dependency that another install or the world's own content still uses stays, and the result names what uses it; the install's record then stays only to place that dependency, and world.installs() no longer lists the install. Installing the asset again puts its files back, committed or not. A file of the install that you changed stays as a file of the world. When another install's files run the install you remove (that install was installed while it stood, so it brought no copy of its own), its files stay: the copy moves to /source/deps/<world>/<name>, the other install takes it over as one of its dependencies, and the result names that install under handed_to and the new path under moved_to. Pass { dryRun = true } to see what would go and stay first. Dependencies nothing uses can also be left over by an older install or written by hand: the engine posts a notice naming them whenever the world comes to hold any, and world.removeUnusedDeps({ dryRun = true }) (the removeUnusedDeps tool, the ZeroMind panel's Remove unused button) lists them while world.removeUnusedDeps() removes them. Nothing removes a dependency without one of these calls, and neither call commits: the removals are changes the next commit carries.

What an install lays down is worked on like the rest of this world's code, dependencies included, and zm pr list / zm pr merge take in the changes others send this world. Content is tracked by what it is rather than where it sits, so an edit keeps its link to the version it came from, zm status lists what you changed ahead of upstream, and zm pr create sends it back. (@builtin itself is a library mounted from the engine, part of the same project.)

Publishing your work

Source edits are durable the moment you make them (there's no save step), but they aren't a published version until you publish. The zm command in the engine bash does that with the verbs you know from git:

zm add .                            # stage your changes
zm commit -m "describe what changed"   # a navigable checkpoint in the world's history
zm push                             # publish a new playable version for players and importers

What people browsing ZeroMind see of a world before they open it is its listing: title, description, page body, tags, visibility and the language its words are written in. zeromind.setMetadata edits it (edit_world_metadata over MCP), and its content_language field places the world in the listings of that language ("pt-BR" is stored as "pt").

A commit holds each file's exact bytes, line endings (CRLF, LF or a mix of them) and binary content alike, so a file reads unchanged against the commit that took it, and a pull, a restore or zm show gives back the bytes that were committed.

A commit message is the one word after -m, so quote a message of several words (zm commit -m "add the town and cast"); a message written without -m is refused with that form. The same verbs exist as the zm Luau toolbox (zm.add / zm.commit / zm.push), where the message is zm.commit's first argument. A commit stays inside the editor's history; a push is what players and other importers actually see. Browse the full set with tools.list("zm") or man zm.

Staging records each scene with its authoring/ files. In edit mode, entities you spawn or change through the ECS are saved there automatically, so zm add takes them with the scene. Edits still waiting to be saved, or held by a conflict with another participant's edit (the Scene changes tab and the sceneAuthoring toolbox's reviewRecorded show them), stay out of the stage until they settle. A play session's edits are kept through the leave-play review (changes, then acceptChanges). The core/development guide has the full flow.

Committing your own work when others are authoring too

The working tree is the world's and everyone sees it. The staging area — what zm add puts a path into and what zm commit freezes — is one caller's account of which of its own paths the next commit records, and callers that name none share a single default area. So when more than one of you is authoring a world at once, name your own:

zm --stage fauna add demo/fauna.module   # stage into your own area
zm --stage fauna commit -m "fauna: the swallow colony"
zm --stage fauna status                  # what your area holds
zm push --stage fauna                    # publish, gated on your area's content

A commit through a named area carries the paths staged into that name and leaves everyone else's staged where they are, so each of you commits your own work under your own message. Through world.* the same name is an option: world.add(path, { stage = "fauna" }), and likewise on world.add_all / world.unstage / world.discard / world.commit / world.vcsStatus / world.push / world.publishBlockers. Pick a name for your slice of the work and use it on every staging verb, the push included.

A push publishes the branch, which every author shares, so the pre-push gate that reads whether the world's assets meet their type's content requirements refuses over every asset the push publishes that falls short, whichever staging area staged it. world.publishBlockers() and zm status read the same list a push refuses on. A staging area is a statement of who is working on what: an item another area holds names that area beside the asset, so you know whose work it is before you change it. A description a type asks for (a README, an about.yaml text still starting with [[describe]]) is answered for only by the push that edits, stages or commits its asset, so a world's older assets do not stand in the way of a push that leaves them as they were. A type's about.yaml is the one file whose absence is not: a type without one refuses every push of the world that holds it. A required file a derive hook computes is the commit's to carry: an asset the branch holds no file of yet, such as a model just imported, is not refused for lacking it, because zm add of the asset computes it and the commit that first carries the asset carries it too.

Staging an asset a derive hook computes an output for (a material's preview, for one) reserves that output on the staging area, and zm commit seals a commit whose required outputs are still computing until they land. A reservation belongs to the change its area stages: unstaging that change (zm restore --staged <path>, world.unstage), a reset, or another area taking the path releases the reservation with the output it staged, so an area whose staged list is empty holds no reservation either. zm status names the outputs the reported area reserves, counted by state, and under Outputs other staging areas reserve each other area holding any, with its caller, account and session. zm reset --stage <name> (world.reset("HEAD", { stage = name })) empties any caller's area, its staged changes and reserved outputs together, and leaves the working tree and every sealed commit as they are; it refuses --soft, --hard and a revision other than HEAD, which move the branch rather than an area. The name reaches your account's area first, and when that holds nothing the areas other accounts hold under the name, each named in a warning with its account and session. zm unseal <commit> then returns a commit sealed from that name to it.

Staging is advisory: what another staging area holds and what another caller is writing never refuse or narrow a stage, a commit, a merge or a push. A path is staged in one area at a time, so a call that stages a path another area holds (zm add <path> / world.add, zm add . / world.add_all, a commit re-staging a source, zm restore --staged / world.unstage of a path only another area holds) moves it out of that area, whichever account opened it and whether or not the session holding it is still open. Nothing is discarded: the working tree keeps the bytes, and the other area's caller can stage them again. Every take is in the call's report as released, one { path, stage, account, same_account, session, live } row per path and area.

Contention is between accounts. Every agent and engine of one account (the desktop editor, a proxy-launched engine, several agents in one engine) shares that account's work: a take from an area of your own account is one of your agents handing work over, and it is silent. A take from another account's area warns, naming the account, the area and the session holding it; when that session is open the warning says that account is working on the paths now, and when it has ended it records the take. A bulk stage takes every dirty path whoever wrote it, and a path a caller of another account is writing while its session is open is staged with a warning naming that caller and account, and listed in the report's written.

The working tree records which caller wrote each dirty path, and zm status labels each with its writer: you, the other caller's key such as client:<session> (client:ide-slot-<n>@<engine seat> for an engine's dock agent, since every engine numbers its dock slots the same way), after the account's name when another account wrote it, session ended once that caller's session is over, or unattributed. A row keyed by a bare client:ide-slot-<n>, with no engine seat, resolves to no agent on any engine. A session ends when its MCP client disconnects or closes it, when the proxy that served it restarts, and when the engine it wrote through leaves the world. zm status also lists, as information, the paths other areas hold under Held by another staging area: the account holding each (your account for your own), the area, its session, and whether that session is working now. zm add . && zm commit -m "describe the change" && zm push publishes the world as the working tree holds it, and the editor's Source Control panel's Stage All (world.add_all()) does the same and says how many changes it staged, how many it took from other areas and from another account, and which it left out for an unresolved conflict.

zm --stage fauna add .
# added: /zero/source/demo/fauna.module/init.luau
# added: /zero/source/demo/flora.luau
# [warn] world.add_all: took 1 path(s) from staging area 'flora' of account 3f2c…, session client:session-beta (account 3f2c… is working on them now); they are staged here: /zero/source/demo/flora.luau

Staging a source by name (zm add <path>, world.add), and the commit re-staging a source whose dependency table moved, also stages beside it each asset it references whose current version no commit holds, since the reference needs that version to resolve. Such an asset is staged with your path, taken out of any other staging area that held it, and named as carried, so a commit carries nothing you were not told about. world.add returns the same account as { staged, carried, released, written }.

zm --stage fauna add /zero/source/demo/swallow.luau
# added: /zero/source/demo/swallow.luau
# [warn] world.add: carried /zero/source/demo/flight.module: the staged paths reference a version of it that no commit holds, so it is staged with them

Working alone, name nothing — the default area is the whole story, no other area holds anything, and zm add / zm commit are exactly the two lines above.

Saving: when a write reaches the world, and how long it takes

A /source write returns once the file is written on this engine; its upload to the world follows on its own. vfs.pendingWrites() lists the paths whose change the server has not taken yet, and a path leaves the list when the server has it, so the time from the write to that moment is the save's round trip. world.syncStatus().outgoing_synced reads true once everything this session wrote has reached the world, uploads_outstanding counts the uploads still on their way and held_uploads names any being tried again, with why.

What the server is doing meanwhile is world.syncStatus().server_calls: the reducer and procedure calls the connection waits on (calls_in_flight, oldest_ms), the recent calls with how long each waited (a text file's save is a put_text_blob and a manifest call such as upsert_manifest_entry_over), the slow ones of a second or more (a durable call's wait for its durability included) with the cause each wait is classed under (server answered late, reply held after the server ran it, socket mute, reply lost, procedure answered late, connection lost, durability held), and the last_incident: a run of calls that each waited 15 s or more, with the line the engine log received when it closed. Each call states its kind: an everyday edit (a file write, a stage, a world.data write) is applied and answers as soon as the server applied it, while a commit, a branch head, a push, a release, a pull request, a new world, a stash and a deletion for good are durable and answer only once the server states their transaction written to disk, with durability and durable_after_ms saying how that went. GET /engine/status carries the same block.

Finding the rest

world.* and library.* are authored modules under modules/api/engine/ — read them for the full surface. What persists (and why there's no "save") is in the engine guide. Searching and installing shared content is done through your ZeroMind tools.

  • documentation
  • guide