Making a small web build
Every megabyte is a wait before anyone can play. A build under 50 MB starts in seconds on most connections and works on phones. Past about 150 MB, many players give up before the game loads.
The rules
- Upload a .zip of the folder that contains your index.html. A single folder inside the zip is fine.
- Up to 300 MB zipped and 1 GB unzipped.
- Only web files: no programs (.exe, .dll, .so and the like).
- Games run in a frame without special server headers, so multi-threaded builds won't start. Export single-threaded.
- We compress engine files (.wasm), scripts and pages automatically, and players' browsers keep each version, so returning players don't download it again. You don't need to compress anything yourself.
What usually makes a build big
Almost always it's content, not code. Look at the biggest folders in your project before you export:
- Images you don't need in the demo: alternate portraits, unused tilesets, store art, concept art and source files (.psd, .kra, .aseprite).
- Uncompressed audio: a minute of WAV music is about 10 MB; the same as Ogg Vorbis is about 1 MB.
- Oversized textures: a 4096 px image shown at 512 px wastes most of its size.
- Video files, test scenes, old builds and backup folders sitting inside the project.
A demo doesn't need everything. Leaving out content the demo never shows is usually the biggest single saving.
Godot 4
- Add a Web export preset (Project → Export → Add → Web) and install the export templates for your Godot version if asked.
- Turn Thread Support off and leave Extensions Support off. C# projects can't export to the web in Godot 4, and GDExtension plugins need a web build of their own.
- Keep files out of the export. On the preset's Resources tab, add folders and patterns to Filters to exclude files, for example:
art_source/*, docs/*, tests/*, builds/*, *.psd, *.md. A pattern likeassets/portraits/*angry.webpdrops one variant of a large image set. - Make a demo-only cut with feature tags. Add a custom feature such as
web_demoto the preset and checkOS.has_feature("web_demo")in code to hide content the demo doesn't include, so missing files never break a scene. - Import music as Ogg Vorbis and short sound effects as WAV or Ogg. In the Import dock, lower the size of big textures and use lossy compression for photos and painted art.
- Check the result. Export to an empty folder and look at the size of the
.pckfile: that's your content. The.wasmfile is the engine (about 35 MB, about 9 MB once we compress it) and you can't shrink it much. - Test before uploading. Opening index.html directly doesn't work; run a small local server in the export folder, for example
python -m http.server, and openhttp://localhost:8000.
Unity
- Switch the platform to WebGL (Build Settings).
- In Player Settings → Publishing Settings, set Compression Format to Brotli (or Gzip). We serve Unity's .br and .gz files with the right headers, so Decompression Fallback isn't needed.
- Set Managed Stripping Level to Medium or High and turn on Strip Engine Code.
- Use texture compression and lower Max Size on large textures; set long music clips to Streaming with Vorbis compression.
- Remove unused packages and keep unused assets out of the Resources folder: everything in Resources ships, whether it's used or not.
Other engines
- GameMaker: use the HTML5 (or GX.games) export and zip the output folder.
- Construct, Phaser, PixiJS, Defold, Bevy and other web exports: zip the folder with index.html. Compress images (WebP) and audio (Ogg or MP3) before building.
Before you upload
- The zip opens to your index.html (or one folder containing it).
- The game starts from a local web server, with no errors in the browser console.
- If it's still big, say so in your description and tag it honestly. Games over 50 MB show their download size, and phone players are asked before the download starts unless the game is tagged Mobile Friendly.