Recipe: export to the web, desktop, iPhone and Android#
Note. The command is
venin today's builds and becomesfrostat launch, and so do the names built from it.
Note. Coldwave is in private development: there is no public download yet. These steps apply from the first public release.
Goal: a game that plays outside frost, proved to be the same game: the exported player, fed the recording, stands at the same checksum frost run prints.
First, the game itself#
frost check --costs game.toml # what the download costs, by kind, and what could be smaller
frost test game.toml # the recorded run holds
frost run --headless --steps 600 game.toml # note its `world checksum`The web#
Nothing to install: frost copies the web players that came in its download and compiles nothing. Only --slim, which builds a player with just what the game uses, needs the Emscripten SDK (E0509 without it).
frost export web game.toml --out web --recording
frost play web --port 8080frost export web writes index.html, the game's files under game/ and two players, gpu/ (WebGPU) and gl/ (WebGL2); the page picks the one the browser can run, and the command prints what each kind of browser downloads. Open http://127.0.0.1:8080/?hold=600: the page plays the recording 600 steps and prints frost_player: holding at step 600 checksum X to the console, where X must be the world checksum of frost run --headless --steps 600. &backend=gl or &backend=gpu picks a build, &size=WxH the canvas, &report=/path posts the held frame as a PNG. Leave out --recording for the build you ship: players play live input.
The desktop#
frost export desktop game.toml --out desktop --recording
desktop/NAME --hold 600 # prints the same holding lineThe player, named after the game, with its files in game/ beside it, for the system frost runs on. No installer and no signing. A game in C# has its scripts compiled ahead of time into a library beside it (a frost with C#; --fetch lets the one package it may need be fetched).
iPhone and Android#
The first downloads will not have the phone players: both need a build that has them.
frost export ios game.toml --out ios # NAME.app for the simulator; --device: unsigned, for an iPhone
frost export android game.toml --out android # NAME.apk, arm64, Android 8.0 and later, a debug keyiOS needs Xcode (E0500) and rustup target add aarch64-apple-ios-sim; xcrun simctl launch --console-pty SIM ID --hold N prints the holding line. Android needs the Android SDK and NDK (E0535) and rustup target add aarch64-linux-android; the player prints to adb logcat -s frost_player and takes --hold N from adb shell setprop debug.ven.args.APP_ID "'--hold N'". Phones are tested in the simulator and the emulator only: no real device yet, and signing for a device or a store is yours to do (platforms and export says what it takes). C# does not run on phones yet.
Checks#
- The holding line's checksum equals
frost run'sworld checksumat that step, on each target you export to. - Look at the held frame (
&report=, or a screenshot): checksums cover the world, not the picture. frost checkwarns of what a browser will struggle with: a model picture over 2048 on a side (W0455), a ground over 512 samples (W0459), a sound over three minutes in a game with a[web]table (W0437).