Settings
Assets
Textures
For web exports, use either Lossless or Lossy compression modes, as the others don't work and the texture will show up as a black square at runtime, even when used as sprites. VRAM Uncompressed and Basis Universal are pending tests. Also, be mindful that enabling mipmaps will increase the RAM usage.
Audio
Convert all long music tracks to Ogg Vorbis (preferred) or MP3 if you absolutely must. Godot will import common audio formats into .ogg by default for web. Use streaming for background music (set the AudioStream resource to “stream” from disk) so that it doesn’t decode fully into RAM all at once. This prevents large audio files from consuming too much memory. Sound effects can be WAV if they are very short, but otherwise also use Ogg. Keep the sample rate reasonable, 44.1 kHz is usually fine; 48 kHz might be overkill unless you need it.
Meshes
For 3D models, remove any unused parts, and simplify collision meshes as much as possible. Use instancing in Godot scenes rather than duplicating the same mesh in multiple scene files – instanced scenes share the mesh resource and save memory. If you have huge scene files, you might break them into smaller chunks and load additively. Godot’s PackedScene files are compressed, but the difference in load time is mostly about how many objects and how complex the scene is.
Code
Make your code statically typed as much as possible. The performance overhead of trying to infer variable and return types adds up to a noticeable drop in performance the bigger the codebase is.
GDScript and other code doesn’t add much to download size usually, but be mindful if you embed large JSON datasets or big arrays in your scripts – those will be part of the package. If you have large data assets (like a big dictionary of items, or a long dialogue script), consider storing them in an external JSON file that you load at runtime. That way the main PCK isn’t bloated, and it might be cached more effectively. Additionally, external files could potentially be updated or downloaded only when needed.
Project Settings
Rendering > Renderer > Rendering Method
gl_compatibility, no ifs, no buts.
Export Settings
Variant > Thread Support
Enable thread support only if it's critical for the game functions, and test thoroughly before publishing. Be aware that threading requires SharedArrayBuffer support from the browser, as explained in [[#Threading]]
Updated about 1 month ago
