Skip to content

Exporting a standalone build ​

Besides publishing to the Galatrix servers for multiplayer, you can export your map as a standalone build — a self-contained game you can host anywhere or open in a browser. Think of it as a local build: it runs your scene with the same engine and the same scripts, just single-player and offline rather than networked.

Build it ​

From the editor's top menu choose Map → Build Standalone. A dialog collects the options:

OptionWhat it does
Game NameThe title shown on the start screen and used for the downloaded file.
FormatSingle HTML — one self-contained .html file with Three.js, Rapier, the engine, and your scene all embedded inline. No external dependencies; opens directly in any browser, even offline. ZIP Bundle — the same game split into separate files (index.html + standalone.js + scene.json). Also fully self-contained, but it needs a local static server to run (e.g. npx serve .), because a browser won't fetch the side files over file://.
Compress scene dataGzip the embedded scene; the build decompresses it in the browser at load.
Compress dependenciesGzip the embedded Three.js + Rapier bundle (~8 MB → ~1.5 MB), decompressed in the browser at load.
MinifyOff by default. Single HTML: compacts the page itself (comments and whitespace stripped) along with your script sources. ZIP: minifies script sources and writes scene.json compact instead of pretty-printed — index.html stays readable so you can still open and tweak it. Scripts keep every name; nothing is renamed.
Obfuscate scriptsOff by default. Strips comments and renames local names in your script sources, so the export does not ship readable code. Harder to read, not unbreakable. With it on, it takes the place of Minify's script pass.
Show "Click to play" start screenOff by default. A full-screen card the player clicks before the game starts. A game that opens on a menu does not need it: a click on the game still captures the mouse when the scene wants it.
Batch static geometryOn by default. Objects ticked Static in the Inspector are merged into shared draw calls when the game is built, so the export draws fewer meshes. A map that marks nothing is unaffected.
BrandingThe brand line on the loading screen, the Click to play card and the in-game watermark: GALATRIX.com (the default), Custom text, or Hidden. The last two need a Pro plan; without one they show locked.
Page config (JSON)A JSON object written into the exported page, where whoever hosts it can edit it after the build. Scripts read it with game.getPageConfig(). The same setting as in Game Settings, saved with the map.
Engine modulesLeave optional engine subsystems out of the export to shrink it (see below).
Render APIWhich graphics API the exported game draws with (see below).

Click Build HTML (or Build ZIP) and the file downloads. The dialog then switches to its Logs tab, which lists what the build did: its steps, sizes and warnings.

The Web tab builds the game itself. Desktop, Android and iOS download a project instead — your game plus a native wrapper — that you build into an app with that platform's own tools; they ask for an Application ID and a Version, and the Logs tab lists the commands that finish the build.

Render API ​

Browsers offer two graphics APIs, and an exported game embeds the engine built for the one you pick:

SettingWhat it does
AutomaticThe default, and it builds a WebGL 2 game. On the kind of scenes made here — many separate objects rather than a few large ones — WebGL 2 measured faster, so an export that expresses no preference gets it.
WebGL 2Always WebGL 2. The conservative choice, and the one that keeps GLSL-only shaders working.
WebGPUAsks for WebGPU specifically. Because it is a choice rather than a result, it is loud when it cannot be honoured: pick it and the dialog lists what would pin your game to WebGL 2, and the build log repeats it. Where a player's browser has no WebGPU, the game still starts on a compatibility layer.

One thing decides whether a game can draw on WebGPU: whether its custom shaders have a WebGPU version. A game with no custom shaders, or whose shaders all carry one, is drawable on either API. A game with a shader that is GLSL only is a WebGL 2 game, and picking WebGPU for it resolves back to WebGL 2 rather than shipping something that cannot compile — the dialog and the build log both say so.

Nothing else about your game changes with this setting — the same scene, scripts, physics and audio run either way.

Engine modules ​

The engine ships a few optional subsystems that a given game may not use. Under Engine modules in the Build dialog you can leave the ones you don't need out of the export:

  • Terrain renderer, Tilemap renderer and Block grid renderer are auto-detected. The editor scans your main map and every sub-map; if none of them contain a terrain (or tilemap, or block-grid) object, that renderer is pre-checked to be stripped, so a game that never uses it simply doesn't ship it. (A stripped block grid renderer still collides; it just does not draw.) If a map does use it, it's marked "used by this game" and left in.
  • Particle system, Animator and math.geo / math.curve are marked advanced and left in by default. Each is reachable from scripts (particles.*, animation.*, math.geo.*) as well as (for particles/animator) a component, so a scan can't prove a game never uses them — stripping them is an explicit opt-in rather than something the editor decides for you. Only strip one if you're sure your game never uses it.

Stripping is safe by construction: if you strip a module a map actually needs, the game fails loudly at load with a clear message — "The … engine module was stripped from this build. Re-enable it in Build ▸ Engine modules and re-export the game." — never a silent broken scene. It's a per-export choice; your editable project always keeps everything, so you can re-export with the module back in at any time.

In practice this trims a small slice off the download (a renderer is tens of KB against a multi-MB engine), so treat it as a nice-to-have for size-sensitive hosting rather than a big win.

Offline multiplayer room ​

One module works the other way round: it is off unless you ask for it, and it adds code rather than removing it. Offline multiplayer room ships the multiplayer runtime itself and runs it with no network: the same room code a published game's server runs, and the same client a player's browser runs, both in the one page, for one player. Turn it on for a map written for rooms that should also play alone exactly as it does online. Room-side hooks (onPlayerJoined, onClientEvent, players.getAll and the rest), client scripts, server-driven entities, spawn protection, sub-map hops through players.teleportToScene and per-player HUDs all run as they do in a room, because it is that code. An export has no accounts, so the player's save stays in their browser; the map's own records (world data, leaderboards, badges) are kept in the browser as well.

Scripts can tell the game plays on its own, with no server: game.offlineMode is true here, in an ordinary standalone build and in the editor play-test, and false in a room on a server, which is every game published on Galatrix (one with a single seat too) and Test Online. A map that waits for two players before a round, for example, can start it with one when game.offlineMode is true, with the rest of its code unchanged. Read it when it matters, such as when a round starts.

It costs about 3 MB more in the export (under 1 MB compressed): the room, its physics, and a second copy of the renderer, since the room and the play-test runtime are separate builds. A map that does not need the multiplayer runtime should leave it off and use the ordinary local build, which is the default.

What you get ​

A standalone build is a local build, not a multiplayer client. It runs the exact same runtime the editor's Play Mode uses, so behavior matches what you tested:

  • your scene, lighting, audio, particles, and weather;
  • every entity script, the input/camera/cursor/character-controller APIs, spawn/destroy, and player verbs;
  • render-to-texture cameras and multi-camera viewports;
  • an optional click-to-play start screen.

Because it isn't networked, the player-vs-player and server-authoritative pieces don't apply — it's one local player (or a fully scripted one).

A map with Run scripts unguarded on exports its scripts as written, and the build runs them without the script guard. Such a build refuses to start on a Galatrix site: galatrix.com and its subdomains, and localhost or an IP address on ports 3000 to 3039, where the Galatrix development servers run. npx serve picks port 3000 by default, so give it another: npx serve -l 5000. It also refuses a site where the player is signed in to Galatrix: one that serves Galatrix under a path of its own shares its storage with every other page on it.

Branding ​

Standalone builds carry a small GALATRIX.com mark: the loading screen (and the Click to play card, when it is on) reads "GALATRIX.com Engine", and an in-game watermark sits in the top-left corner. The watermark is part of the game UI and stays above the scene, so it is not removed by the running game. On a Pro plan, the Build dialog's Branding row replaces the mark with your own text (up to 40 characters) or hides it.

When to use which ​

  • Publish (multiplayer, hosted on Galatrix) — for a shared, server-authoritative game others join.
  • Standalone build — for a single-player game, an offline demo, a portfolio piece, or hosting the game yourself.

See also ​

  • Quality & performance — the render ceilings an exported build carries with it. Worth a pass before shipping, since you don't know what hardware the page will open on.