gamedev-skills/awesome-gamedev-agent-skills / skills/unity/unity-build-size
unity-build-size
VerifiedFinds and shrinks what makes a Unity 6.3 LTS build too big: Build Report reading, uncompressed textures, glTFast models, PCM audio and per-platform levers. Use when an APK, AAB, WebGL build or Steam depot is over a size limit or the download is too big. Not for frame rate (`performance-optimization`), build scripts or stripping (`unity-build-pipeline`) or store uploads (`steam-publish`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.3 KB |
| agents/openai.yaml | config | 229 B |
| references/gltf-textures.md | markdown | 6.1 KB |
| references/platform-android.md | markdown | 4.6 KB |
| references/platform-desktop-steam.md | markdown | 4.7 KB |
| references/platform-ios.md | markdown | 3.1 KB |
| references/platform-web.md | markdown | 4.7 KB |
| scripts/build_report.py | script | 8.7 KB |
| scripts/check_unity_build_size.py | script | 33.8 KB |
references/platform-web.md
View on GitHub# Web (WebGL / WebGPU) builds
Read this when the target is a browser: itch.io, a game portal, your own site. Pass
`--platform WebGL` to the checker. Checked against the Unity 6000.3 manual (2026-11).
## What is limited
- **The host's per-file and total limits.** itch.io HTML5 uploads: at most 1,000 files, 500 MB
extracted, **200 MB per file**, 240 characters per path
([itch.io HTML5 docs](https://itch.io/docs/creators/html5)). The `Build/*.data` file is the one
that usually hits the per-file limit, so check each file, not only the total.
- **What the player downloads**: the compressed files (`*.data.br`, `*.wasm.br`, or `.gz`). These
are also the files a host's per-file limit applies to, so compression counts against it.
The Build Report sizes are before Web compression, so they overstate the download. Measure the
`Build/` folder itself:
```bash
ls -l path/to/WebBuild/Build/
```
## First moves, in order
1. **Build a release build.** Compression Format applies only to release builds; development builds
are not compressed at all
([Deploy a Web application](https://docs.unity.com/en-us/engine/6000.3/manual/platform-specific/webgl/building-distribution/deploying)).
A development build measured against a limit looks several times too big.
2. **Compression Format = Brotli** (Player Settings → Publishing Settings). The default is gzip.
Brotli files are smaller, but Chrome and Firefox decode Brotli only over HTTPS, and the server
must send `Content-Encoding: br` for `.br` files. itch.io does that for files ending in `.br`.
Turn on Decompression Fallback only for a host that cannot set the header: it makes startup
slower.
3. **Code Optimization = Disk Size with LTO** (Build Profiles → Web). Unity recommends it for
shipping builds; it builds slower
([Web build settings](https://docs.unity.com/en-us/engine/6000.3/manual/platform-specific/webgl/building-distribution/web-build-settings)).
In a script it is `UnityEditor.WebGL.UserBuildSettings.codeOptimization =
UnityEditor.WebGL.WasmCodeOptimization.DiskSizeLTO`
([Optimize Web for mobile](https://docs.unity.com/engine/6000.5/manual/platform-specific/webgl/building-distribution/web-optimization-mobile)).
It is a user build setting kept under `Library/`, not in `ProjectSettings/` (Unity's own
`optimize-web` skill notes the same), so a CI machine does not inherit it from your Editor: set
it in the build script that makes the release.
4. **Code size**: Strip Engine Code on and API Compatibility Level = .NET Standard. Enable
Exceptions = None saves the most, but then any thrown exception aborts the player, so use it
only when the game and its plugins never rely on catching exceptions; otherwise keep
Explicitly Thrown Exceptions Only (or Target WebAssembly 2023 for exceptions without the
overhead)
([Recommended Player settings](https://docs.unity.com/en-us/engine/6000.3/manual/platform-specific/webgl/building-distribution/web-optimization/player)).
Managed Stripping Level and `link.xml` breakage belong to `unity-build-pipeline`.
5. **Assets**: the main workflow (checker, glTF, textures, audio) applies, with one audio
difference: Web encodes every clip to AAC whatever format you pick, and supports only the
Compressed In Memory and Decompress On Load load types, not Streaming
([Audio in Web](https://docs.unity.com/en-us/engine/6000.3/manual/platform-specific/webgl/develop/audio)).
Lower the Quality slider for music to shrink it. Texture
compression on Web has a per-build subtarget (DXT for desktop browsers, ASTC or ETC2 for mobile;
Build Profiles → Texture Compression). A build for mobile browsers with DXT textures ships them
decompressed at runtime, so pick the subtarget for your audience
([Texture compression in Web](https://docs.unity3d.com/6000.3/Documentation/Manual/webgl-texture-compression.html)).
6. **One file over the per-file limit after all that**: move content out of the `.data` file into
Addressables groups (each bundle is its own file, local or remote), and load levels on demand.
Addressables setup itself belongs to `unity-build-pipeline`.
## Prove it
Open the build through a web server, never from `index.html` on disk. A plain static server that
does not send `Content-Encoding` fails to start a Brotli build unless Decompression Fallback is on.
Use one of:
- the Editor's **Build And Run**;
- `unity build run` when the Unity CLI is installed (it serves a recorded Web build from a
loopback-only local server);
- an itch.io draft page (the real host).
In the browser's developer tools, Network tab, confirm the `.br` files come back with
`content-encoding: br`, and note the transferred size. Then play to gameplay and look at the
assets you shrank.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |