Getting to the first frame fast
Getting to the first frame fast
Most players who leave never saw your game. Every second before the first playable frame costs plays, and the portal measures it: initial download size and time to the first gameplayStart both feed your basic launch metrics.
Set a budget#
- Initial download under 20 MB if you want mobile placement, under 50 MB at the very most. See technical requirements.
- Time to gameplay under 10 seconds on a mid-range laptop and a typical home connection.
Measure with the browser's network panel on a cold cache and with throttling set to "Fast 4G".
Split what you load#
- Boot (a few hundred KB): a small page with your logo and a progress bar. Show it as fast as possible.
- Level 1: only what the first minute of play needs.
- Everything else: after the player is playing.
async function start() {
await SDK.init();
await SDK.game.loadingStart();
await loadCoreAssets(); // level 1 only
await SDK.game.loadingStop();
showMainMenu(); // or go straight into play
loadRestInBackground(); // levels, music, extra skins
}loadingStart and loadingStop let the portal separate loading from play in its reports.
Cut bytes#
- Textures. Use atlases, power-of-two sizes where your engine needs them, and a compressed format (WebP, or Basis/KTX2 where supported). Halve texture sizes that are only shown small.
- Audio. Use Opus or AAC, mono for effects, and a lower bitrate for music. Stream music instead of preloading it.
- Code. Minify, tree-shake, drop unused engine modules and dependencies, and compress with Brotli or Gzip.
- Fonts. Subset to the glyphs you use.
- Video. Do not ship video intros.
Cut waiting#
- Do not make the player click through a splash screen, a language picker and a menu before they play. For full launch new players must reach gameplay in at most one click.
- Start downloading the next scene while the player reads the current one.
- Defer analytics and non-essential scripts until after
gameplayStart. - Avoid synchronous work in the boot path; a long task freezes the progress bar and looks like a hang.
Show progress honestly#
A bar that moves smoothly is better than one that jumps. If a stage cannot report progress, animate to a stage boundary and wait there.
Check for regressions#
Re-measure on each release. A "small" new asset pack can double the initial download without anyone noticing.