Unity web builds: export settings for Ravensight
A cloud playtest opens your game in a browser, so a Unity game is played as a WebGL build. This page lists the Player Settings that pass the build check, how the run serves compressed files, and how to package and upload the build. The same build also plays locally with the playtest CLI.
Player Settings for the Web platform
Switch the build target to Web, then set these in Player Settings, under Publishing Settings.
| Setting | Use | Why |
|---|---|---|
| Compression Format | Disabled, or Gzip | The run serves a file named x.wasm.gz or x.data.gz with a gzip content encoding and the type of the file inside, so both work. Disabled has the fewest moving parts. Brotli files (.br) are served the same way, but a Brotli Unity export has not been checked end to end. |
| Decompression Fallback | Off | The run sets the encoding headers itself, so the browser decodes the files and the fallback loader, which writes .unityweb files, is not needed. The run does allow scripts from blob: addresses, which that loader uses, so a build with it on is not refused for it. |
| Data Caching | Off | Nothing in the check or the run needs the browser to keep a copy of the build, and off means every run reads the files you uploaded. |
| WebGL Template | Default or Minimal | The page you name as the entry file must be an HTML file with a doctype or an html tag, at most 64 MB, with no <base> tag, no meta refresh and no srcset. Both stock templates produce index.html. |
| Initial Memory Size and Maximum Memory Size | As your game needs | Ravensight does not read or check them. Set them the way you would for any browser release, and keep the unpacked build inside the limits below. |
| Run In Background | On | The game keeps running when the page loses focus. |
| Resolution | A canvas near 960 by 600 | It fits the 1280 by 800 browser window the playtester uses. |
Everything inside the build
A cloud run has no network, and the page may load only files from its own build. The archive check refuses a build whose HTML, script or style sheet names a web address to load, or refers to a file that is not in the archive. A plain link a player could follow out of the game is allowed; a script or a file that fetches from another site is not. Remove analytics snippets, web fonts and remote asset URLs from a custom template before you export.
To report a win from inside the canvas, see the Unity section of the playtest guide.
The Unity SDK in a web build
The Unity SDK is listed as untested on WebGL in the platform support table: its tests ran in the Editor and a macOS player, not in a browser. Two things to plan for in a browser tab:
PlayerPrefsis stored in the browser's IndexedDB and some browsers clear it, so a returning player may look new.- Quit is unreliable in a tab. Flush at points you control, such as the end of a level. The
healthevent the SDK sends on quit may never be sent in WebGL.
Zip and upload
- Build to a folder, for example
Builds/WebGL. - Zip the folder's contents, not the folder, so
index.htmlis at the top of the zip. Use a standard zip with no encryption and no ZIP64. - Check it for free. Nothing is uploaded and no playtest is charged.
Check the zip
ravensight-playtest build preflight ./my-game-web.zip --format web
Or play the exported folder locally first
ravensight-playtest run --driver playwright_web --build-dir ./Builds/WebGL
Then upload with ravensight-playtest build upload or from
the dashboard, and start a run as in
Cloud playtests.
What the build check enforces
- One zip, under 4 GiB, up to 4 GiB unpacked, at most 5,000 files and folders, at most 16 folders deep.
- No file may expand to more than 100 times its zipped size.
- File names use letters, digits and a few symbols (
_ . / + @ ( ) = -and spaces), with no two names that differ only by letter case. - Only web files: a native program in the zip, such as
.exeor.dll, is refused. - A desktop, Android or iOS Unity build is refused with a message naming what to export instead. No playtest is charged for a refused build.
Tier sizes, the dashboard upload limit and the other cloud limits are in Playtest a Unity game.