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

What usually makes a build big

Almost always it's content, not code. Look at the biggest folders in your project before you export:

A demo doesn't need everything. Leaving out content the demo never shows is usually the biggest single saving.

Godot 4

  1. Add a Web export preset (Project → Export → Add → Web) and install the export templates for your Godot version if asked.
  2. 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.
  3. 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 like assets/portraits/*angry.webp drops one variant of a large image set.
  4. Make a demo-only cut with feature tags. Add a custom feature such as web_demo to the preset and check OS.has_feature("web_demo") in code to hide content the demo doesn't include, so missing files never break a scene.
  5. 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.
  6. Check the result. Export to an empty folder and look at the size of the .pck file: that's your content. The .wasm file is the engine (about 35 MB, about 9 MB once we compress it) and you can't shrink it much.
  7. 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 open http://localhost:8000.

Unity

  1. Switch the platform to WebGL (Build Settings).
  2. 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.
  3. Set Managed Stripping Level to Medium or High and turn on Strip Engine Code.
  4. Use texture compression and lower Max Size on large textures; set long music clips to Streaming with Vorbis compression.
  5. Remove unused packages and keep unused assets out of the Resources folder: everything in Resources ships, whether it's used or not.

Other engines

Before you upload

Post your game More for developers