Build and export your game
Start with a working host build, then choose one delivery target. A target recipe describes a build/package path; it does not prove that your game's controls, graphics, audio and lifecycle are ready on that platform.
Build for development
From the tutorial's original working folder:
AIGameEngine build --project ./first-game
For the generated First Game project in this Linux tutorial, the host artifact is copied into first-game/dist/first_game. The current host-copy recipe assumes an extensionless executable; do not assume it handles a Windows-host .exe automatically. This development build still uses development asset lookup.
To run through Cargo in the project directory:
AIGameEngine run --project ./first-game
The run command is a development Cargo-run path. Do not assume adding --release to it selects or launches the packaged release. Build release explicitly and run the artifact you intend to test.
Make a release
AIGameEngine build --project ./first-game --release
The CLI collects the packed directories, enables the game's embedding feature and copies the host executable to dist inside the game. Subsequent builds can replace earlier outputs; preserve a release you need to keep before building into the same destination.
Embedding makes included asset bytes available without the source tree. It does not remove native system-library requirements, supply every missing decoder or fix direct filesystem reads in game code.
Expected check. In an authorized runtime environment, launch the release from a separate working directory and exercise a visible scene, input, sound, content and saves. Building successfully is only the compilation/package part of this check. No engine build or runtime check was performed while writing this guide.
Select a target
AIGameEngine build --project ./first-game --target web --release
The supported target names in this source snapshot are:
| Target | Output inside the game | Prerequisites and limits |
|---|---|---|
host |
dist/first_game |
Host toolchain and native dependencies; copy recipe assumes an extensionless executable, not a verified Windows-host packaging path |
linux |
dist/first_game-linux |
x86-64 GNU/Linux target; cross-builds need Zig and cargo-zigbuild |
windows |
dist/first_game-windows.exe |
x86-64 GNU Windows target, working cross/native compiler and dlltool |
mac |
dist/first_game.app, optionally dist/first_game.dmg |
Apple targets; native universal build or cross-build prerequisites including an SDK; packaging is not code signing/notarization |
appimage |
dist/first_game-x86_64.AppImage |
Linux, appimagetool and the expected icon; verify runtime contents on the destination system |
android |
dist/first_game.apk |
Android target, cargo-apk, SDK and NDK; application entry/lifecycle integration remains a separate concern |
ios |
dist/first_game.ipa |
macOS, Xcode, Apple target and zip; output is unsigned, not an App Store-ready application |
web |
dist/web/index.html, first_game.js, first_game_bg.wasm |
wasm target and wasm-bindgen; wasm-opt is optional |
These are source-defined recipes, not a certification matrix. Apple/mobile paths are not a substitute for actual platform testing, signing, permissions, lifecycle handling or distribution requirements. The current Android packaging path also assumes a release APK location; do not rely on an unverified debug Android flow.
The macOS bundle, its executable and optional DMG use the project's normalized slug. For the tutorial's First Game, that slug is first_game.
Treat all as an attempt, not a guarantee
--target all attempts the named non-host targets. On one machine, many may be unavailable because their toolchains or host requirements differ.
A multi-target operation can succeed overall when at least one target succeeds. Read each target's messages and inspect each expected artifact; an exit status alone does not prove you produced every package. Prefer one explicit target while bringing up a new platform.
Prepare a web build
A web build embeds assets even without release mode. The generated folder contains the wrapper page, JavaScript bindings and WebAssembly. Serve them together through an appropriate HTTP host; opening a wrapper directly as a local file is not an equivalent deployment test.
The CLI does not supply a general serve subcommand. Use your separately chosen development host rather than copying an unimplemented command from planning notes.
Check these browser-specific behaviors:
- Graphics adapter/backend availability and initialization errors.
- Focus and pointer-lock requirements after a real user gesture.
- Audio start/resume after interaction.
- Save-storage availability and quota.
- Escape and page navigation: setting a native exit flag is not a browser close operation.
- Behavior when the tab is hidden or throttled.
The generated wrapper has its own inline styling and module script. A hosting site's Content Security Policy or embedding headers can prevent it from working unchanged. Publishing a web folder and embedding it in another website are separate integrations; do not assume either is authorized or automatic.
Keep game exports separate from engine-site publishing
You do not need AIGameEngine site or AIGameEngine deploy to package an ordinary game. Those commands belong to an engine website/operator workflow with additional local writes and external project dependencies.
In particular, a deployment run without --push still writes/builds local website material and runs checks. It is not a read-only preview. Actual publication needs separate authorization and a configured destination. This manual does not deploy a game or the engine website.
Release checklist
- Keep the game's name, version and intended platform explicit.
- Build the selected release target and read all errors.
- Verify that required assets are embedded and licensed for distribution.
- Test the resulting artifact away from the development checkout.
- Check platform input, audio, saves and startup/shutdown behavior.
- Confirm signing/package/host policy requirements separately.
- Preserve the artifact and record which source revision produced it.
If compilation fails, begin with target-specific troubleshooting, not by assuming every failing target is a game-code problem.