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 = "./build.sh"
deploy_dir = "dist"
See workflow for details, and Runtime for the environment your game runs in.
Starter templates
Each starter is a complete project that deploys as it is, once npm install has run in an engine starter:
| 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 is the same structure, in its engine: a full-screen canvas, its loop, and the Arcadible SDK's start and pause, with a slot marked wherever your code goes, and a greeting for whoever's playing, so it shows something as it is. Its main.js opens with a list of recipes, small complete examples of what games add next, such as a save or live play, each one's code a link away. The engine starters use the package, @arcadible/sdk, and the blank starter the hosted script.
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 Vite's output: dist by default, while the starters set Vite's outDir to .arcadible-public, the default deploy_dir, so they set no deploy_dir. package.json's build script runs on its own, with your package manager (build):
export default { base: "./" };
[workflow]
deploy_dir = "dist"
The engine starters' Vite servers also send Arcadible's isolation headers, so arc serve --url can frame npm run dev, cross-origin isolated as on Arcadible.
| 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.