Game Engines on Arcadible
Arcadible runs any game that builds to a folder of static files with an index.html. Whatever you build with, the setup is in arcadible.toml: the command that builds the game, if any, and the folder it builds into.
[workflow]
build = "npm run build"
deploy_dir = "dist"
See workflow for details, and Runtime Limitations for the environment your game runs in.
Starter templates
Each starter is a complete project that deploys as it is:
| Template | Stack | Create it |
|---|---|---|
arcadible/starters/blank | Blank canvas | arc init star-drift -y |
arcadible/starters/threejs | Three.js | arc init star-drift -t arcadible/starters/threejs |
arcadible/starters/phaser | Phaser | arc init star-drift -t arcadible/starters/phaser |
arcadible/starters/pixijs | PixiJS | arc init star-drift -t arcadible/starters/pixijs |
arcadible/starters/babylonjs | Babylon.js | arc init star-drift -t arcadible/starters/babylonjs |
Each keeps the direction its mark spins in as a save, so it carries over to the next version: the engine starters through the package, @arcadible/sdk, and the blank starter through the hosted script. Remove it if your game has nothing to save.
For anything else, create the project with its own tools, then run arc init in it. See Bring an Existing Game.
JavaScript and TypeScript
The engine starters build with Vite. Set its base to "./" so the build uses relative paths, and point deploy_dir at the folder it writes, dist by default. package.json's build script runs as npm run build, or pnpm run build or yarn run build by your lockfile:
export default { base: "./" };
[workflow]
deploy_dir = "dist"
The engine starters set Vite's outDir to .arcadible-public instead, the default deploy_dir, so a new project keeps the same layout as the blank starter. Their Vite servers also send Arcadible's isolation headers, so npm run dev is cross-origin isolated, as on Arcadible, and arc serve --url can frame it.
| Library | What it is | Docs |
|---|---|---|
| Three.js | A 3D renderer, with WebGL 2 or WebGPU. Physics, audio, and game structure are up to you. MIT. | Manual |
| Phaser | A 2D framework, with scenes, physics, tilemaps, input, and audio. MIT. | Docs |
| PixiJS | A 2D renderer, with WebGL and WebGPU. Game structure, physics, and audio are up to you. MIT. | Guides |
| Babylon.js | A 3D engine, with physics, a GUI, animation, and audio, on WebGL 2 or WebGPU. Apache 2.0. | Docs |
With Babylon.js, import each module from its own path, such as @babylonjs/core/Engines/engine, as the starter does. Importing from @babylonjs/core itself pulls in the whole engine, several megabytes, however little the game uses.
Engines with web exports
Export a web build into a folder in your project, and point deploy_dir at it. An engine that compresses its export and expects the server to label the files, as Unity does by default, needs that turned off; see Compressed engine builds.
These engines' saves don't carry over to your next version. The Arcadible SDK doesn't currently have a plugin for them, so their saves stay in browser storage, which starts empty in each version.
For example, Godot, with its export templates installed and a Web export preset:
[workflow]
build = "godot --headless --export-release Web build/web/index.html"
deploy_dir = "build/web"
Its exports with threads work too, since Arcadible is cross-origin isolated. Godot 4 doesn't currently export C# projects to the web (Godot).
Native code and WebAssembly
Code in C, C++, or Rust compiles to WebAssembly, with an HTML page and JavaScript glue code. Name the page index.html, and point deploy_dir at its folder.
For example, a Bevy game in Rust, built with Trunk:
[workflow]
build = "trunk build --release --public-url ./"
deploy_dir = "dist"
WebAssembly from Rust is large before optimization: build with opt-level = "z" or "s", enable LTO, and run wasm-opt.
Your own engine
An engine is optional. The blank starter is a canvas and a script, with Canvas 2D, WebGL 2, and WebGPU for graphics, Web Audio for sound, and the Gamepad and Pointer Events APIs for input. It's the smallest download.
Next steps
- Runtime Limitations: the environment your game runs in.
- Saves: keep players' progress across versions.
- Testing: try your game locally and on staging.