Optimization
Funox players quit if your game takes too long to load or runs poorly. Treat performance as a feature.
Loading
- Target first interactive frame in under 10 seconds on broadband.
- Lazy-load anything that isn't needed in the first 30 seconds of play.
- Show real progress during loading (downloaded bytes, not a spinner).
- Avoid synchronous decoding of large assets — stream where possible.
Asset budget
| Asset type | Target |
|---|---|
| Initial bundle | ≤ 50 MB (≤ 20 MB for mobile feature) |
| Textures | Compressed (WebP/AVIF or engine-native ASTC/ETC) |
| Audio | OGG / MP3 with reasonable bitrate (96–128 kbps for music) |
| Fonts | Subset to the characters you actually use |
Code
- Tree-shake unused dependencies.
- Minify and gzip/brotli your JS bundle.
- Use
requestAnimationFramefor game loops, notsetInterval. - Avoid allocating in the hot path (
new,[],{}per frame). - Pause heavy work when the tab is hidden (
document.hidden).
Rendering
- Batch draw calls — atlases over individual sprites.
- Avoid full-screen post-processing on mobile.
- Cap shadow resolution and reflection quality on lower-end devices.
- Target 60 fps; drop to 30 only if you've exhausted other options.
Memory
- Free unused assets between scenes.
- Avoid leaking event listeners — unregister on teardown.
- Profile heap growth over a 30-minute session.
- On iOS WebGL especially, stay below 512 MB peak memory.
Network
- Don't ship a CDN-loaded font (Google Fonts etc.). Self-host.
- Use HTTP/2 or HTTP/3 for parallel fetching.
- Cache aggressively with long-lived URLs.
Engine-specific
- Unity: Brotli compression, IL2CPP, code stripping, ASTC textures, Addressables.
- Godot: gzip compression, disable threads if not needed, preload critical scenes.
- Construct: Avoid per-tick scripts on every object; use families.
- Cocos: Use subpackages, prefer
cc.assetManagerovercc.resources.