Skip to content

Export Game (folder, for hosting) ​

Export Game (folder, for hosting) writes game.html plus a scene.fg scene sidecar (and, with App Settings, a web app manifest and icons) into a folder you pick. It is the smallest web output Awaken produces, built for uploading to a static host.

The single-file game.html export inlines your scene as base64 text, which is a third larger than the bytes it encodes. The folder export skips that: it keeps the compressed scene as a raw binary sidecar the game fetches at boot. The trade-off is that the game must be served; it will not run when double-clicked.

What you get ​

FileWhat it holds
game.htmlThe player template with your compiled scripts injected, but no inline scene. On boot it fetches ./scene.fg from the same folder.
scene.fgThe same Zstd-compressed binary scene container as the single-file export, written raw. Most of the size is here.
manifest.webmanifestWith App Settings only: the name, short name, display: fullscreen (falling back to standalone), orientation, start_url: "./", and the launch colour as background_color and theme_color. Linked from game.html, so a hosted game can be installed from the browser.
favicon.ico, apple-touch-icon.png, icon-192.png, icon-512.pngWith an App Settings icon only: the favicon at 16, 32 and 48 px, the 180 px home-screen icon, and the manifest's two icons.

Both main files come out of the same buildShipPayload pipeline as game.html and Preview: used-asset collection, scene compaction, geometry quantization and Zstd level-19 compression. The physics WASM is left out when nothing uses physics, by the same rule as game.html. Only the delivery differs: a sidecar file instead of inline base64.

Why it must be served ​

A double-clicked file:// page is a unique opaque origin, and browsers block reading sibling files from it. Since game.html loads its scene with fetch("./scene.fg"), opening it from disk leaves the game with no scene: it shows "The game could not start. Some of its files are missing or damaged." with Try again, and the Console says "No game scene found." (see When the game cannot run).

Serve the folder over http and the fetch succeeds. On boot the player tries its inline scene globals first, then ./scene.fg (and, for legacy hosted builds, ./scene.awaken.json). See how the player boots a scene.

WARNING

The folder export will not run double-clicked. For a file you can open from disk, use Export game.html, which inlines the scene so no fetch is needed. Use the folder export only when you are hosting.

Using it ​

  1. Open File ▾ → Export Game (folder, for hosting)… in the Toolbar.
  2. Confirm the Export game options dialog (script obfuscation and the Debug overlay; see Export game.html).
  3. Pick (or create) a destination folder in the directory picker.
  4. Awaken writes the files and the Console says "Exported game.html + scene.fg - SERVE the folder (upload it / run a local server). Won't run double-clicked (file:// blocks the fetch)." The progress dialog ends on the size chart, whose last bar is Files and whose line splits them, for example "Folder 5.70 MB = scene.fg 4.98 MB (the compressed scene, as it is) + game.html 0.72 MB (engine 0.66 MB + scripts 0.06 MB)".

The File ▾ menu with Export Game (folder, for hosting)… highlighted.

Requirements ​

  • Chromium browser. The folder export uses the File System Access directory picker (showDirectoryPicker), which Firefox and Safari do not implement. On those browsers the Console reports "Folder export needs a Chromium browser (directory picker)." Use Export game.html there instead.
  • A built player template. Like the single-file export, it stamps your scene into the pre-built template. Without one the Console says "Folder export needs the player template - run pnpm build:player-template." See the stale-template gotcha.
  • Valid App Settings. An invalid value refuses the export before the folder picker opens (see Invalid values).

Hosting notes ​

Any static host works: the files are plain static assets with no server-side logic.

  • Vercel / Netlify / Cloudflare Pages / S3 + CloudFront. Put the folder's files in the served directory (or a subfolder) and open game.html's URL. Keep scene.fg next to game.html, since the fetch is relative (./scene.fg).
  • A single-page-app rewrite. A host that answers a missing ./scene.fg with its index.html and a 200 status does not fool the player: it checks that the response is a compressed scene before using it.
  • Local check before uploading. Run any static server in the folder (for example npx serve or python3 -m http.server) and open the served URL.
  • MIME type. scene.fg is read as bytes, so its content type does not matter; application/octet-stream is fine.
  • Compression. The scene is already Zstd-compressed inside scene.fg, so host-level gzip or Brotli on it gains little.
  • Store test mode. A page opened anywhere but your own computer, a file or an automated browser sells nothing, whatever the Store tab's test mode (see In-app purchases). The export logs a line when a test mode ships.

For a single URL with nothing to keep in sync, the inline game.html is often simpler to host too; the folder export wins when download size matters.

See also ​

Awaken: browser-native WebGPU game engine.