@opengamehq/skills 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +12 -4
- package/dist/.claude-plugin/marketplace.json +26 -0
- package/dist/skills/manifest.json +1409 -145
- package/dist/skills/opengame-accessibility/CHANGELOG.md +4 -0
- package/dist/skills/opengame-accessibility/SKILL.md +48 -32
- package/dist/skills/opengame-all-in-one/CHANGELOG.md +21 -0
- package/dist/skills/opengame-all-in-one/SKILL.md +195 -0
- package/dist/skills/opengame-all-in-one/references/opengame-accessibility/README.md +102 -0
- package/dist/skills/opengame-all-in-one/references/opengame-api/README.md +107 -0
- package/dist/skills/opengame-all-in-one/references/opengame-assets/README.md +168 -0
- package/dist/skills/opengame-all-in-one/references/opengame-assets/references/pipeline.md +164 -0
- package/dist/skills/opengame-all-in-one/references/opengame-audio/README.md +238 -0
- package/dist/skills/opengame-all-in-one/references/opengame-audio/helpers/audio-chain.js +325 -0
- package/dist/skills/opengame-all-in-one/references/opengame-audio/references/mix-notes.md +125 -0
- package/dist/skills/opengame-all-in-one/references/opengame-audio/references/qa-without-ears.md +177 -0
- package/dist/skills/opengame-all-in-one/references/opengame-capture/README.md +128 -0
- package/dist/skills/opengame-all-in-one/references/opengame-capture/references/pipeline.md +114 -0
- package/dist/skills/opengame-all-in-one/references/opengame-capture/references/threejs.md +161 -0
- package/dist/skills/opengame-all-in-one/references/opengame-characters/README.md +180 -0
- package/dist/skills/opengame-all-in-one/references/opengame-characters/references/first-person-body.md +108 -0
- package/dist/skills/opengame-all-in-one/references/opengame-characters/references/integration.md +144 -0
- package/dist/skills/opengame-all-in-one/references/opengame-characters/references/player-og.md +160 -0
- package/dist/skills/opengame-all-in-one/references/opengame-cli/README.md +189 -0
- package/dist/skills/opengame-all-in-one/references/opengame-deploy/README.md +223 -0
- package/dist/skills/opengame-all-in-one/references/opengame-deploy/references/json-events.md +63 -0
- package/dist/skills/opengame-all-in-one/references/opengame-deploy/references/manifest.md +89 -0
- package/dist/skills/opengame-all-in-one/references/opengame-deploy/references/packaging.md +119 -0
- package/dist/skills/opengame-all-in-one/references/opengame-depth/README.md +154 -0
- package/dist/skills/opengame-all-in-one/references/opengame-enemies/README.md +155 -0
- package/dist/skills/opengame-all-in-one/references/opengame-enemies/references/pacing-and-bots.md +108 -0
- package/dist/skills/opengame-all-in-one/references/opengame-enemies/references/threejs.md +193 -0
- package/dist/skills/opengame-all-in-one/references/opengame-front-end/README.md +185 -0
- package/dist/skills/opengame-all-in-one/references/opengame-front-end/references/launch.md +50 -0
- package/dist/skills/opengame-all-in-one/references/opengame-front-end/references/menus.md +81 -0
- package/dist/skills/opengame-all-in-one/references/opengame-game-feel/README.md +181 -0
- package/dist/skills/opengame-all-in-one/references/opengame-game-feel/helpers/spring.js +146 -0
- package/dist/skills/opengame-all-in-one/references/opengame-game-feel/references/feel-numbers.md +142 -0
- package/dist/skills/opengame-all-in-one/references/opengame-game-feel/references/killcam.md +88 -0
- package/dist/skills/opengame-all-in-one/references/opengame-jam/README.md +114 -0
- package/dist/skills/opengame-all-in-one/references/opengame-lighting/README.md +141 -0
- package/dist/skills/opengame-all-in-one/references/opengame-lighting/helpers/light-pool.js +185 -0
- package/dist/skills/opengame-all-in-one/references/opengame-loading/README.md +135 -0
- package/dist/skills/opengame-all-in-one/references/opengame-loading/helpers/loading-count.mjs +115 -0
- package/dist/skills/opengame-all-in-one/references/opengame-loading/references/threejs.md +141 -0
- package/dist/skills/opengame-all-in-one/references/opengame-look/README.md +181 -0
- package/dist/skills/opengame-all-in-one/references/opengame-look/references/matching-a-reference.md +73 -0
- package/dist/skills/opengame-all-in-one/references/opengame-look/references/painterly.md +69 -0
- package/dist/skills/opengame-all-in-one/references/opengame-look/references/post-and-lens.md +73 -0
- package/dist/skills/opengame-all-in-one/references/opengame-maps/README.md +74 -0
- package/dist/skills/opengame-all-in-one/references/opengame-maps/references/map-spec.md +77 -0
- package/dist/skills/opengame-all-in-one/references/opengame-mobile/README.md +86 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/README.md +183 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/briefs.md +293 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/day-one-questions.md +46 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/edge-cases.md +27 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/filmable.md +244 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/finishing.md +126 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/measure.md +282 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-capture.md +151 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-gates.md +84 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-genres.md +198 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-grammar.md +320 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-ops.md +127 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/og-snipers-record.md +110 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/owner-eye.md +214 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/reference-study.md +293 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/song.md +64 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/README.md +193 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/briefs.md +293 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/day-one-questions.md +46 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/filmable.md +244 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/measure.md +282 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-capture.md +151 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-gates.md +84 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-genres.md +198 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-grammar.md +320 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-ops.md +127 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/og-snipers-record.md +110 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/owner-eye.md +214 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/reference-study.md +293 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/song.md +64 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/README.md +174 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/briefs.md +293 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/day-one-questions.md +46 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/filmable.md +244 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/finishing.md +126 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/measure.md +282 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-capture.md +151 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-gates.md +84 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-genres.md +198 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-grammar.md +320 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-ops.md +127 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/og-snipers-record.md +110 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/owner-eye.md +214 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/reference-study.md +293 -0
- package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/song.md +64 -0
- package/dist/skills/opengame-all-in-one/references/opengame-multiplayer/README.md +139 -0
- package/dist/skills/opengame-all-in-one/references/opengame-multiplayer/references/bot-lobbies.md +71 -0
- package/dist/skills/opengame-all-in-one/references/opengame-multiplayer/references/netcode.md +165 -0
- package/dist/skills/opengame-all-in-one/references/opengame-performance/README.md +177 -0
- package/dist/skills/opengame-all-in-one/references/opengame-performance/helpers/landing-pacer.mjs +86 -0
- package/dist/skills/opengame-all-in-one/references/opengame-performance/references/measuring.md +123 -0
- package/dist/skills/opengame-all-in-one/references/opengame-performance/references/webgpu.md +86 -0
- package/dist/skills/opengame-all-in-one/references/opengame-production/README.md +192 -0
- package/dist/skills/opengame-all-in-one/references/opengame-production/references/team.md +107 -0
- package/dist/skills/opengame-all-in-one/references/opengame-production/references/templates.md +153 -0
- package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/README.md +170 -0
- package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/references/cheap-tells.md +43 -0
- package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/references/judges.md +95 -0
- package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/references/review-prompt.md +32 -0
- package/dist/skills/opengame-all-in-one/references/opengame-rhythm/README.md +134 -0
- package/dist/skills/opengame-all-in-one/references/opengame-rhythm/references/charting.md +109 -0
- package/dist/skills/opengame-all-in-one/references/opengame-rhythm/references/timing.md +92 -0
- package/dist/skills/opengame-all-in-one/references/opengame-router/README.md +54 -0
- package/dist/skills/opengame-all-in-one/references/opengame-router/references/process.md +38 -0
- package/dist/skills/opengame-all-in-one/references/opengame-scene-audit/README.md +136 -0
- package/dist/skills/opengame-all-in-one/references/opengame-scene-audit/helpers/scene-audit.js +677 -0
- package/dist/skills/opengame-all-in-one/references/opengame-sdk/README.md +283 -0
- package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/engines.md +93 -0
- package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/frame.md +107 -0
- package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/identity.md +111 -0
- package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/leaderboards.md +115 -0
- package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/radio.md +71 -0
- package/dist/skills/opengame-all-in-one/references/opengame-stability/README.md +112 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/README.md +160 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/archetypes.md +113 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/briefs.md +273 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/core.md +129 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/craft.md +299 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/edge-cases.md +27 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/filmable.md +244 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/finishing.md +126 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/gates.md +184 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/measure.md +282 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/music.md +148 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/og-clash-record.md +133 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/ops.md +154 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/owner-eye.md +214 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/review.md +141 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/title.md +92 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/README.md +172 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/archetypes.md +113 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/briefs.md +273 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/core.md +129 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/craft.md +299 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/edge-cases.md +27 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/filmable.md +244 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/finishing.md +126 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/gates.md +184 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/measure.md +282 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/music.md +148 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/og-clash-record.md +133 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/ops.md +154 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/owner-eye.md +214 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/reference-set.md +92 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/review.md +141 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/title.md +92 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/README.md +141 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/archetypes.md +113 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/briefs.md +273 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/core.md +129 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/craft.md +299 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/edge-cases.md +27 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/filmable.md +244 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/finishing.md +126 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/gates.md +184 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/measure.md +282 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/music.md +148 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/og-clash-record.md +133 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/ops.md +154 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/owner-eye.md +214 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/review.md +141 -0
- package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/title.md +92 -0
- package/dist/skills/opengame-all-in-one/references/opengame-verification/README.md +197 -0
- package/dist/skills/opengame-all-in-one/references/opengame-verification/helpers/browser-evidence.mjs +74 -0
- package/dist/skills/opengame-all-in-one/references/opengame-weapons/README.md +179 -0
- package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/handling-numbers.md +114 -0
- package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/reloads-and-hands.md +96 -0
- package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/sights-and-scopes.md +98 -0
- package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/threejs.md +240 -0
- package/dist/skills/opengame-all-in-one/references/opengame-world-physics/README.md +141 -0
- package/dist/skills/opengame-all-in-one/references/opengame-world-physics/references/measured-failures.md +79 -0
- package/dist/skills/opengame-api/CHANGELOG.md +12 -0
- package/dist/skills/opengame-api/SKILL.md +39 -13
- package/dist/skills/opengame-assets/CHANGELOG.md +11 -0
- package/dist/skills/opengame-assets/SKILL.md +79 -31
- package/dist/skills/opengame-assets/references/pipeline.md +67 -0
- package/dist/skills/opengame-audio/CHANGELOG.md +11 -0
- package/dist/skills/opengame-audio/SKILL.md +129 -41
- package/dist/skills/opengame-audio/references/mix-notes.md +44 -1
- package/dist/skills/opengame-audio/references/qa-without-ears.md +177 -0
- package/dist/skills/opengame-capture/CHANGELOG.md +10 -0
- package/dist/skills/opengame-capture/SKILL.md +44 -20
- package/dist/skills/opengame-capture/references/pipeline.md +33 -1
- package/dist/skills/opengame-capture/references/threejs.md +17 -1
- package/dist/skills/opengame-characters/CHANGELOG.md +15 -0
- package/dist/skills/opengame-characters/SKILL.md +94 -39
- package/dist/skills/opengame-characters/references/first-person-body.md +108 -0
- package/dist/skills/opengame-characters/references/player-og.md +1 -1
- package/dist/skills/opengame-cli/CHANGELOG.md +20 -0
- package/dist/skills/opengame-cli/SKILL.md +12 -11
- package/dist/skills/opengame-deploy/CHANGELOG.md +30 -0
- package/dist/skills/opengame-deploy/SKILL.md +43 -23
- package/dist/skills/opengame-deploy/references/json-events.md +6 -5
- package/dist/skills/opengame-deploy/references/manifest.md +9 -3
- package/dist/skills/opengame-deploy/references/packaging.md +32 -30
- package/dist/skills/opengame-depth/CHANGELOG.md +8 -0
- package/dist/skills/opengame-depth/SKILL.md +61 -33
- package/dist/skills/opengame-enemies/CHANGELOG.md +10 -0
- package/dist/skills/opengame-enemies/SKILL.md +96 -40
- package/dist/skills/opengame-enemies/references/pacing-and-bots.md +108 -0
- package/dist/skills/opengame-enemies/references/threejs.md +59 -0
- package/dist/skills/opengame-front-end/CHANGELOG.md +4 -0
- package/dist/skills/opengame-front-end/SKILL.md +85 -39
- package/dist/skills/opengame-front-end/references/menus.md +42 -8
- package/dist/skills/opengame-game-feel/CHANGELOG.md +11 -0
- package/dist/skills/opengame-game-feel/SKILL.md +95 -47
- package/dist/skills/opengame-game-feel/references/feel-numbers.md +59 -0
- package/dist/skills/opengame-game-feel/references/killcam.md +88 -0
- package/dist/skills/opengame-jam/CHANGELOG.md +12 -0
- package/dist/skills/opengame-jam/SKILL.md +48 -33
- package/dist/skills/opengame-lighting/CHANGELOG.md +9 -0
- package/dist/skills/opengame-lighting/SKILL.md +85 -34
- package/dist/skills/opengame-loading/CHANGELOG.md +4 -0
- package/dist/skills/opengame-loading/SKILL.md +78 -38
- package/dist/skills/opengame-loading/helpers/loading-count.mjs +115 -0
- package/dist/skills/opengame-loading/references/threejs.md +32 -7
- package/dist/skills/opengame-look/CHANGELOG.md +9 -0
- package/dist/skills/opengame-look/SKILL.md +122 -51
- package/dist/skills/opengame-look/references/matching-a-reference.md +73 -0
- package/dist/skills/opengame-look/references/painterly.md +69 -0
- package/dist/skills/opengame-look/references/post-and-lens.md +10 -3
- package/dist/skills/opengame-maps/CHANGELOG.md +9 -0
- package/dist/skills/opengame-maps/SKILL.md +78 -0
- package/dist/skills/opengame-maps/references/map-spec.md +77 -0
- package/dist/skills/opengame-mobile/CHANGELOG.md +4 -0
- package/dist/skills/opengame-mobile/SKILL.md +18 -18
- package/dist/skills/opengame-montage-make/CHANGELOG.md +5 -0
- package/dist/skills/opengame-montage-make/SKILL.md +187 -0
- package/dist/skills/opengame-montage-make/references/briefs.md +293 -0
- package/dist/skills/opengame-montage-make/references/day-one-questions.md +46 -0
- package/dist/skills/opengame-montage-make/references/edge-cases.md +27 -0
- package/dist/skills/opengame-montage-make/references/filmable.md +244 -0
- package/dist/skills/opengame-montage-make/references/finishing.md +126 -0
- package/dist/skills/opengame-montage-make/references/measure.md +282 -0
- package/dist/skills/opengame-montage-make/references/montage-capture.md +151 -0
- package/dist/skills/opengame-montage-make/references/montage-gates.md +84 -0
- package/dist/skills/opengame-montage-make/references/montage-genres.md +198 -0
- package/dist/skills/opengame-montage-make/references/montage-grammar.md +320 -0
- package/dist/skills/opengame-montage-make/references/montage-ops.md +127 -0
- package/dist/skills/opengame-montage-make/references/og-snipers-record.md +110 -0
- package/dist/skills/opengame-montage-make/references/owner-eye.md +214 -0
- package/dist/skills/opengame-montage-make/references/reference-study.md +293 -0
- package/dist/skills/opengame-montage-make/references/song.md +64 -0
- package/dist/skills/opengame-montage-plan/CHANGELOG.md +5 -0
- package/dist/skills/opengame-montage-plan/SKILL.md +197 -0
- package/dist/skills/opengame-montage-plan/references/briefs.md +293 -0
- package/dist/skills/opengame-montage-plan/references/day-one-questions.md +46 -0
- package/dist/skills/opengame-montage-plan/references/filmable.md +244 -0
- package/dist/skills/opengame-montage-plan/references/measure.md +282 -0
- package/dist/skills/opengame-montage-plan/references/montage-capture.md +151 -0
- package/dist/skills/opengame-montage-plan/references/montage-gates.md +84 -0
- package/dist/skills/opengame-montage-plan/references/montage-genres.md +198 -0
- package/dist/skills/opengame-montage-plan/references/montage-grammar.md +320 -0
- package/dist/skills/opengame-montage-plan/references/montage-ops.md +127 -0
- package/dist/skills/opengame-montage-plan/references/og-snipers-record.md +110 -0
- package/dist/skills/opengame-montage-plan/references/owner-eye.md +214 -0
- package/dist/skills/opengame-montage-plan/references/reference-study.md +293 -0
- package/dist/skills/opengame-montage-plan/references/song.md +64 -0
- package/dist/skills/opengame-montage-review-and-improve/CHANGELOG.md +5 -0
- package/dist/skills/opengame-montage-review-and-improve/SKILL.md +178 -0
- package/dist/skills/opengame-montage-review-and-improve/references/briefs.md +293 -0
- package/dist/skills/opengame-montage-review-and-improve/references/day-one-questions.md +46 -0
- package/dist/skills/opengame-montage-review-and-improve/references/filmable.md +244 -0
- package/dist/skills/opengame-montage-review-and-improve/references/finishing.md +126 -0
- package/dist/skills/opengame-montage-review-and-improve/references/measure.md +282 -0
- package/dist/skills/opengame-montage-review-and-improve/references/montage-capture.md +151 -0
- package/dist/skills/opengame-montage-review-and-improve/references/montage-gates.md +84 -0
- package/dist/skills/opengame-montage-review-and-improve/references/montage-genres.md +198 -0
- package/dist/skills/opengame-montage-review-and-improve/references/montage-grammar.md +320 -0
- package/dist/skills/opengame-montage-review-and-improve/references/montage-ops.md +127 -0
- package/dist/skills/opengame-montage-review-and-improve/references/og-snipers-record.md +110 -0
- package/dist/skills/opengame-montage-review-and-improve/references/owner-eye.md +214 -0
- package/dist/skills/opengame-montage-review-and-improve/references/reference-study.md +293 -0
- package/dist/skills/opengame-montage-review-and-improve/references/song.md +64 -0
- package/dist/skills/opengame-multiplayer/CHANGELOG.md +15 -0
- package/dist/skills/opengame-multiplayer/SKILL.md +143 -0
- package/dist/skills/opengame-multiplayer/references/bot-lobbies.md +71 -0
- package/dist/skills/opengame-multiplayer/references/netcode.md +165 -0
- package/dist/skills/opengame-performance/CHANGELOG.md +8 -0
- package/dist/skills/opengame-performance/SKILL.md +106 -65
- package/dist/skills/opengame-performance/helpers/landing-pacer.mjs +86 -0
- package/dist/skills/opengame-performance/references/measuring.md +51 -0
- package/dist/skills/opengame-performance/references/webgpu.md +86 -0
- package/dist/skills/opengame-production/CHANGELOG.md +13 -0
- package/dist/skills/opengame-production/SKILL.md +119 -54
- package/dist/skills/opengame-production/references/team.md +107 -0
- package/dist/skills/opengame-production/references/templates.md +106 -16
- package/dist/skills/opengame-quality-bar/CHANGELOG.md +10 -0
- package/dist/skills/opengame-quality-bar/SKILL.md +94 -42
- package/dist/skills/opengame-quality-bar/references/cheap-tells.md +14 -7
- package/dist/skills/opengame-quality-bar/references/judges.md +95 -0
- package/dist/skills/opengame-quality-bar/references/review-prompt.md +10 -5
- package/dist/skills/opengame-rhythm/CHANGELOG.md +5 -0
- package/dist/skills/opengame-rhythm/SKILL.md +138 -0
- package/dist/skills/opengame-rhythm/references/charting.md +109 -0
- package/dist/skills/opengame-rhythm/references/timing.md +92 -0
- package/dist/skills/opengame-router/CHANGELOG.md +12 -0
- package/dist/skills/opengame-router/SKILL.md +14 -7
- package/dist/skills/opengame-scene-audit/CHANGELOG.md +15 -0
- package/dist/skills/opengame-scene-audit/SKILL.md +64 -47
- package/dist/skills/opengame-scene-audit/helpers/scene-audit.js +97 -19
- package/dist/skills/opengame-sdk/CHANGELOG.md +16 -0
- package/dist/skills/opengame-sdk/SKILL.md +27 -10
- package/dist/skills/opengame-sdk/references/engines.md +2 -2
- package/dist/skills/opengame-sdk/references/identity.md +10 -11
- package/dist/skills/opengame-sdk/references/leaderboards.md +11 -1
- package/dist/skills/opengame-sdk/references/radio.md +1 -1
- package/dist/skills/opengame-stability/CHANGELOG.md +4 -0
- package/dist/skills/opengame-stability/SKILL.md +59 -27
- package/dist/skills/opengame-trailer-make/CHANGELOG.md +5 -0
- package/dist/skills/opengame-trailer-make/SKILL.md +164 -0
- package/dist/skills/opengame-trailer-make/references/archetypes.md +113 -0
- package/dist/skills/opengame-trailer-make/references/briefs.md +273 -0
- package/dist/skills/opengame-trailer-make/references/core.md +129 -0
- package/dist/skills/opengame-trailer-make/references/craft.md +299 -0
- package/dist/skills/opengame-trailer-make/references/edge-cases.md +27 -0
- package/dist/skills/opengame-trailer-make/references/filmable.md +244 -0
- package/dist/skills/opengame-trailer-make/references/finishing.md +126 -0
- package/dist/skills/opengame-trailer-make/references/gates.md +184 -0
- package/dist/skills/opengame-trailer-make/references/measure.md +282 -0
- package/dist/skills/opengame-trailer-make/references/music.md +148 -0
- package/dist/skills/opengame-trailer-make/references/og-clash-record.md +133 -0
- package/dist/skills/opengame-trailer-make/references/ops.md +154 -0
- package/dist/skills/opengame-trailer-make/references/owner-eye.md +214 -0
- package/dist/skills/opengame-trailer-make/references/review.md +141 -0
- package/dist/skills/opengame-trailer-make/references/title.md +92 -0
- package/dist/skills/opengame-trailer-plan/CHANGELOG.md +5 -0
- package/dist/skills/opengame-trailer-plan/SKILL.md +176 -0
- package/dist/skills/opengame-trailer-plan/references/archetypes.md +113 -0
- package/dist/skills/opengame-trailer-plan/references/briefs.md +273 -0
- package/dist/skills/opengame-trailer-plan/references/core.md +129 -0
- package/dist/skills/opengame-trailer-plan/references/craft.md +299 -0
- package/dist/skills/opengame-trailer-plan/references/edge-cases.md +27 -0
- package/dist/skills/opengame-trailer-plan/references/filmable.md +244 -0
- package/dist/skills/opengame-trailer-plan/references/finishing.md +126 -0
- package/dist/skills/opengame-trailer-plan/references/gates.md +184 -0
- package/dist/skills/opengame-trailer-plan/references/measure.md +282 -0
- package/dist/skills/opengame-trailer-plan/references/music.md +148 -0
- package/dist/skills/opengame-trailer-plan/references/og-clash-record.md +133 -0
- package/dist/skills/opengame-trailer-plan/references/ops.md +154 -0
- package/dist/skills/opengame-trailer-plan/references/owner-eye.md +214 -0
- package/dist/skills/opengame-trailer-plan/references/reference-set.md +92 -0
- package/dist/skills/opengame-trailer-plan/references/review.md +141 -0
- package/dist/skills/opengame-trailer-plan/references/title.md +92 -0
- package/dist/skills/opengame-trailer-review-and-improve/CHANGELOG.md +5 -0
- package/dist/skills/opengame-trailer-review-and-improve/SKILL.md +145 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/archetypes.md +113 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/briefs.md +273 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/core.md +129 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/craft.md +299 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/edge-cases.md +27 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/filmable.md +244 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/finishing.md +126 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/gates.md +184 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/measure.md +282 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/music.md +148 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/og-clash-record.md +133 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/ops.md +154 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/owner-eye.md +214 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/review.md +141 -0
- package/dist/skills/opengame-trailer-review-and-improve/references/title.md +92 -0
- package/dist/skills/opengame-verification/CHANGELOG.md +11 -0
- package/dist/skills/opengame-verification/SKILL.md +113 -48
- package/dist/skills/opengame-weapons/CHANGELOG.md +11 -0
- package/dist/skills/opengame-weapons/SKILL.md +129 -55
- package/dist/skills/opengame-weapons/references/handling-numbers.md +42 -0
- package/dist/skills/opengame-weapons/references/reloads-and-hands.md +96 -0
- package/dist/skills/opengame-weapons/references/sights-and-scopes.md +98 -0
- package/dist/skills/opengame-weapons/references/threejs.md +71 -0
- package/dist/skills/opengame-world-physics/CHANGELOG.md +9 -0
- package/dist/skills/opengame-world-physics/SKILL.md +55 -24
- package/dist/skills/opengame-world-physics/references/measured-failures.md +28 -1
- package/package.json +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
> Carried from `opengame-loading` 1.1.0. Read it when: Get a browser game from link to playable fast, with a near-instant second visit. Covers a first frame that needs no fetch, one loading screen before a menu that means ready, cold visits measured with empty caches, request waves before bytes, budgets that only fall, hashed caching, retries and stall deadlines, a count that reads 100 only at play, the lobby as the loading screen, and textures decoded off the main thread. Use when loading is slow, the bar sticks, or a menu or return visit is slow.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Loading
|
|
5
|
+
|
|
6
|
+
A player decides whether to stay before the game has finished downloading. They need a
|
|
7
|
+
working title screen with sound in a second or two, an honest count while the world
|
|
8
|
+
streams behind it, a menu that answers the moment it shows, and nothing on screen that
|
|
9
|
+
is a stand-in for the real thing. A returning player should download nothing. OC (OG
|
|
10
|
+
Clash) asked for load speed about 12 times and reached its 15 s target only for returning
|
|
11
|
+
players. OS measured a fast boot that turned out to be warm, LC tested first visits on a
|
|
12
|
+
fast line while its owner played over a real one, and LC found that the wait was the
|
|
13
|
+
main thread more than the megabytes, so the first rules here are the ones that move a
|
|
14
|
+
first visit most.
|
|
15
|
+
|
|
16
|
+
Rules carry five tags; `opengame-quality-bar` explains them and the game codes. Three.js
|
|
17
|
+
loaders, compression, Vite and service-worker detail is in
|
|
18
|
+
[references/threejs.md](references/threejs.md). An honest count, weighted by the last
|
|
19
|
+
visit's timings, is in [helpers/loading-count.mjs](helpers/loading-count.mjs). Frame-time
|
|
20
|
+
cost of loading belongs to `opengame-performance`; phone memory and texture caps to
|
|
21
|
+
`opengame-mobile`; the visible bar and the press that starts play to `opengame-front-end`.
|
|
22
|
+
|
|
23
|
+
## Rules
|
|
24
|
+
|
|
25
|
+
### The title comes first, one boot loading screen comes before the menu, and the menu means ready
|
|
26
|
+
- **Invariant:** The first screen a player sees is interactive over key art before the world has downloaded, boot has one loading screen and it comes before the menu, and once the menu shows, starting play answers at once with no second wait.
|
|
27
|
+
- **Technique:** Split the download into tiers. The boot tier holds the shell, the key art, the title UI, its music and the input that unlocks audio. The next tier holds what the player will use first (their character, the equipped loadout, the spawn area). The rest loads by need, behind the menu and behind play. The menu waits for each system's first-ready set (what the title and a run's first minute draw), not for everything. Draw the title from a still or a light scene, and swap in the live scene only once it is fully ready. Compile shaders behind the loading screen and menus, not after Play. In a match-based game with many maps, the lobby and countdown are the chosen map's loading screen (the lobby rule below).
|
|
28
|
+
- **Reference configuration:** OC's targets: key art on frame one, press-start under 1 s, title under 2 s on a first visit and under 1 s after. OC's 3D title needed the arena (135 MB) and the boss (15 MB) before it could show, and a key-art title estimated at "15x faster first load" was deferred as a 1-2 day build. Loading the arena behind the menus made Play take 0.12-0.15 s. LC's owner: "we jshould just have the lading screen before the main menu... and then main menua nd hitting new run automatically starts game.. no more loading... and optimzie the fuck out of load time so its super fucking fast". LC's title now shows in about 1.0 s with 4.4 MB fetched (it had been 6-7 s and 82.7 MB), the menu waits for each stream's first-ready set, and New run reaches the first frame in 12-23 ms; its 8 s menu at 50 Mbit was never met (15-24 s). OS's owner: "everything nedes to load in under 3s p95 ... (1-2s ideally)" and "how do we get boot to title to a mere seconds? 14s is very high"; it was never met, with boot at 10-14 s and a 22.8 s median from map pick to control.
|
|
29
|
+
- **Applies when:** Every game whose world is larger than a few megabytes.
|
|
30
|
+
- **Verify:** On a cold cache at the stated bandwidth, record time and bytes to an interactive title, then press Play as soon as the menu shows and record the wait to the first frame of play.
|
|
31
|
+
|
|
32
|
+
### The first frame is the game's own picture and needs no fetch
|
|
33
|
+
- **Invariant:** The first frame the browser paints shows the game's own picture and type, without waiting on any request, and the scene arrives after it at an even pace.
|
|
34
|
+
- **Technique:** Inline a tiny blurred still (or a CSS rendering of the first frame) and the title font into the entry document, so first paint needs nothing from the network; swap the full key art and the live content in as they arrive. Publish a first-play budget: requests and bytes to the title, and to the first moment of play. Keep hashed assets immutable and lists revalidated (see the caching rule).
|
|
35
|
+
- **Reference configuration:** OH's bare paper showed for 2.9 s before its first picture, 7.3 s at 400 KB/s; a CSS still made the first painted frame instant (0.0 s, 0.1 s at 400 KB/s). Its place paints in 2.2-6 s; the title takes 11 requests and 2.00 MB, and the first note of a linked song 19 requests and 6.86 MB. LC inlines a 19 KB font and a 594 B blurred still.
|
|
36
|
+
- **Applies when:** Any game whose scene needs seconds to build.
|
|
37
|
+
- **Verify:** Film the page from navigation at 10 fps on a throttled link and measure saturation per frame: no blank frame after the first paint. Count bytes and requests to the title at the server, not only in the browser.
|
|
38
|
+
|
|
39
|
+
### Cold first visits are fast: few request waves and parallel compiles, measured with empty caches
|
|
40
|
+
- **Invariant:** A first-time player reaches the title in seconds, every cold number is measured with an empty browser cache and an empty GPU driver shader cache, and no frame the player sees waits on a compile.
|
|
41
|
+
- **Technique:** For each cold run, use a fresh browser profile and point the driver's shader disk cache at a new empty directory, because that cache lives outside the browser profile. Compile boot pipelines in parallel (asynchronous pipeline creation for all of them at once, never one after another), and prewarm heavy variants behind the title, keyed per device and renderer profile. Cut requests before bytes: keep a ledger of which code asks for each file, pack small files into boot packs fetched as the engine starts, and rebuild the boot list from a measured cold boot on every release. When the engine fetches from workers, shape the link at a proxy or the server, because browser network throttling may not reach worker fetches. Time the main thread too: shader graph builds and CPU work can be the whole wait.
|
|
42
|
+
- **Reference configuration:** OS's "fresh profile" boot of 5-9 s was warm; truly cold it took 45.6 s, with weapon shaders compiling one after another at 15-18 s each, and compiling them in parallel took it from 42 to 23 s. A prewarm keyed per device and renderer profile cut OS's cold title from 53.2 to 19.9 s. A who-asks ledger took OS's pre-title set from 152 MB in 1,842 requests to 5.40 MB in 180; packs took boot network time from 12-14 s to 8.7 s, and a stale boot list cost 27.2 s against 3.2 s for one rebuilt from a measured cold boot. On OS's link, 22.5 MB arrived in 8-10 s while 80 MB in more files took 12.5-18.7 s: requests, not bytes. OS found that browser throttling skipped its engine's worker fetches. LC: "The wait is the main thread, not the megabytes"; a cached return visit was as slow as a first (11-17 s), and cutting 59 to 39 MB barely moved it.
|
|
43
|
+
- **Applies when:** WebGPU or WebGL games with compiled pipelines, and any game that streams many files.
|
|
44
|
+
- **Verify:** Back-to-back cold and warm boots, each cold one with a fresh profile and an empty driver cache, print seconds to title for both. A request replay on each release prints requests, bytes and seconds.
|
|
45
|
+
|
|
46
|
+
### Ship what the runtime requests, listed in a manifest
|
|
47
|
+
- **Invariant:** The deployed build contains only files the game requests, and a manifest generated from real runs lists each one with its size and the tier that needs it.
|
|
48
|
+
- **Technique:** Log every request during scripted runs through every screen, mode, weapon and device class. Diff the log against the build folder, move unrequested files out, and fail the build when a large file has no entry. Keep a tier and a device class on each manifest entry, and gate the size of each tier. Generate the preload list from a boot with preloading off, so the build writes it rather than a person, and have every capture check it.
|
|
49
|
+
- **Reference configuration:** OC's build folder grew to about 6.3 GB in 25,600 files, "mostly files the game never loads"; its deploy worker logged real requests to prune it, and the CDN set came to 3.07 GB. Boot loads grew from 225 MB in 590 files to 833 MB in 6,124 files over a few days, and models from 222 to 490 MB over R74-R77, with no gate to stop them. LC's hand-kept preload list went stale three times in a day and cost about 12 MB, until it was generated from a boot with preloading off.
|
|
50
|
+
- **Applies when:** Every game with a build step or an asset pipeline. It matters most when an exporter writes every asset in the project.
|
|
51
|
+
- **Verify:** A full scripted run requests every manifest entry, and the build folder holds nothing outside the manifest.
|
|
52
|
+
|
|
53
|
+
### Bytes before the menu have a budget at a stated bandwidth, and the budget only moves down
|
|
54
|
+
- **Invariant:** The bytes needed before the title and the menu, and the time they take on a named connection, are written budgets measured on every build with a cold cache and a throttled network, and no system's share grows without a named decision.
|
|
55
|
+
- **Technique:** State the target as time at a bandwidth, convert it to bytes, and gate each build on the bytes each tier actually transfers. Measure with network throttling in a real browser rather than on localhost at full speed, and record the transfer size the browser reports. Keep a record per system that only moves down: each boot records its megabytes before the menu, fails on growth past a small margin, lowers the figure automatically, and raises it only by name from an unflagged boot. Hold each menu code chunk to a fixed compressed byte count, measured on the old and new trees in the same minute, and pay for new bytes by deleting retired flags or moving code into chunks loaded later. Find bytes by source with the source map before trimming by hand.
|
|
56
|
+
- **Reference configuration:** OC's target was 15 s or less at 25 Mbps, which is about 47 MB at roughly 3.1 MB/s. Before the title it sent 309 MB in 1,788 files; 291-304 MB took 119.6-123.2 s at 25 Mbps. Compression took that to 181 MB (R164), still about 58 s. LC fails a boot at 3% plus 0.15 MB over a system's record; before the menu LC went from 121.5 MB to 29.66 MB, then to 35.7 MB after multiplayer and new finishes, against a 25 MB target. LC's weapons menu chunk is fixed at 137,501 gzip bytes; raw bytes can fall while compressed bytes rise; rounding 17-digit floats in one JSON register saved 7,711 bytes, and a source map found one misplaced 16,737-byte file after 40 minutes of trims had found 306 bytes.
|
|
57
|
+
- **Applies when:** Every web game. Pick the bandwidth with the owner; a phone on mobile data is slower than a desk.
|
|
58
|
+
- **Verify:** A cold-cache run under the stated throttle prints bytes transferred and seconds to an interactive title and menu, and fails above budget. A boot that adds a megabyte to one system fails, and the commit message carries the before and after figures.
|
|
59
|
+
|
|
60
|
+
### Every file is precompressed and typed
|
|
61
|
+
- **Invariant:** Every compressible file is served precompressed with the right `Content-Type` and `Content-Encoding`, the server picks the encoding from `Accept-Encoding`, and nothing is compressed twice.
|
|
62
|
+
- **Technique:** Write Brotli and gzip siblings at build time and have the host serve them; set types for `.wasm` (`application/wasm`, which streaming compilation needs), `.glb` (`model/gltf-binary`), `.ktx2` (`image/ktx2`) and every custom format. GPU-compressed textures shrink little, so measure each class before spending build time on it.
|
|
63
|
+
- **Reference configuration:** OC served its packed model files, asset index and audio with no `Content-Type` and no compression, and its shell ignored a Brotli copy of the wasm (12.6 MB raw against 2.56 MB). Earlier the game binary downloaded uncompressed (10.6 MB instead of 2.1 MB). Measured deflate ratios: GPU textures 1.28x, model files 2.27x, the asset catalog 7.2x. A claim that gzip "saves 20 s" failed audit.
|
|
64
|
+
- **Applies when:** Every game served over HTTP. The static host may do this for you; check rather than assume.
|
|
65
|
+
- **Verify:** For one file of each type, request it with `Accept-Encoding: br, gzip` and read the response headers; in the network log, the transfer size of each text, wasm and model file is well under its resource size.
|
|
66
|
+
|
|
67
|
+
### Hashed names and long-lived caching
|
|
68
|
+
- **Invariant:** A returning player on an unchanged build downloads only the small entry document, after a deploy downloads only the files that changed, and a page that booted on one build never mixes in files from the next.
|
|
69
|
+
- **Technique:** Put a content hash in every asset's file name. Serve hashed files as `Cache-Control: public, max-age=31536000, immutable`, and the entry document as `no-cache` with an ETag. Avoid per-build path prefixes, which change every URL on every deploy. Keep the previous build's hashed files on the host for some hours after a deploy and switch the entry document atomically, so a page booting across a swap still finds its files. A service worker that keeps hashed files in Cache Storage helps where the HTTP cache is evicted.
|
|
70
|
+
- **Reference configuration:** OC's content-hash cache (R193) took a returning player from 150 s to 14.7 s. Before it, per-build paths made every deploy a full download. An earlier server rewrite took repeat visits from 714 MB to 5.1 MB. LC's return visit went from 825 requests to 9; pages that booted across a preview swap had 404'd and drew an old model all session, so LC keeps the previous build's files for 3 hours. OS once served 79 newer-build files to an old page; with each publish under its own stamped path, 3,568 of 3,568 requests matched the page's build.
|
|
71
|
+
- **Applies when:** Every game that is played more than once or deployed more than once.
|
|
72
|
+
- **Verify:** Load, close, load again: the second load transfers only the entry document. Change one asset, deploy, reload: only that file and the entry document transfer. Deploy while a page is mid-boot: it finishes on its own build.
|
|
73
|
+
|
|
74
|
+
### Fetches retry, and a stalled load is caught by a byte deadline
|
|
75
|
+
- **Invariant:** Every fetch can time out and retry, a load that stops receiving bytes is detected and reported, a slow load that is still receiving bytes continues, and a failed load ends on a retry button rather than an automatic page reload.
|
|
76
|
+
- **Technique:** Wrap every fetch with an idle timeout reset on each chunk received, retries with backoff and jitter, and a size or hash check on the result. Tell slow from stalled by bytes over time. Show a "slow connection" notice after a stretch with no bytes, keep retrying, and give up only after a long deadline with a button to try again. Cap concurrent requests, and measure the cap against an uncapped cold boot, since a cap can be the stall. Check that a wrapper keeps the platform's own checks, such as range-response handling.
|
|
77
|
+
- **Reference configuration:** OC's runtime never retried a failed file, so a load waited on it forever, stuck at 97% (fixed R185). An earlier loader sat at 2% for 74 s after 244 failed requests with no timeout or error path. The page-side guard took 5 revisions over about 2 h, because a first wrapper bypassed range-response checks, and a later version's give-up turned into an "arena stalled" crash. The settings that shipped: the notice only after 20 s with zero bytes, retry with backoff while bytes arrive, and phone requests capped from 128 at a time to 24. OS's cap of 16 reads slowed one load from 5.7 to 24 s ("The biggest recovery and load-time lever is one I caused"). A stall watchdog that frees what a failed load reserved is in `opengame-stability`.
|
|
78
|
+
- **Applies when:** Every game that fetches assets after the first document.
|
|
79
|
+
- **Verify:** Fail one asset's first three requests (Playwright `page.route` aborting them): the load completes. Fail it every time: the notice appears, the page does not reload, and the error names the file. Throttle to a slow but steady link: no notice.
|
|
80
|
+
|
|
81
|
+
### The count reads 100 only when play can start, and never goes back
|
|
82
|
+
- **Invariant:** The loading count follows bytes received plus weighted non-network work, climbs in small even steps, never goes backward or stands still for long, and reaches 100 only when a run can start; any time-left estimate shown has proved itself accurate.
|
|
83
|
+
- **Technique:** Take each file's size from the manifest, count bytes as response chunks arrive, and give shader compiles, environment maps and scene builds their own weights. On a return visit, weight each stage by the seconds it took last time, since time is what the player waits through. Count to the moment play can start, not to the title. Advance the shown number toward the true one at a capped rate so it moves in small steps, and drive it with compositor-only transforms so it keeps moving while shaders compile. Split any stage that holds the number still. Show a time-left estimate only if it held close through whole boots in testing. Hide the count on loads short enough to finish before it would be read. [helpers/loading-count.mjs](helpers/loading-count.mjs) does the counting and reports the longest hold.
|
|
84
|
+
- **Reference configuration:** OC's bar stuck at 60% and jumped to 100% ("Baking light" was hard-coded at 60% for about 8 s of work), and stuck at 97% for 20 s before a reload. Fixed, it climbs 1% at a time, holds no number for more than about 0.75 s (0.68-0.73 s measured) and shows only after 0.6 s. A shader warm-up curtain had added 2.5 s of blank screen. The owner asked 3 times. LC's first count read 91% at 0.8 s with play 17-21 s away; weighted by the last visit and counted to play, it reached 100% at 22.1 s with play ready at 21.8 s, rising at most 30 points a second and standing no more than about 1.5-2 s. LC's time-left estimate was 2.8-10.3 s off and was turned off. OS's count hung at 22% on a hard-coded 0.22, first "fixed" with a moving band that measured nothing.
|
|
85
|
+
- **Applies when:** Every load the player waits through, first boot and match entry alike.
|
|
86
|
+
- **Verify:** Under the stated throttle with a load of 8 s or more, film the count and read it from the pixels every frame: it only rises, holds no value past the cap, and reaches 100 within a frame of play accepting input. The helper's `longestHold()` stays under the cap.
|
|
87
|
+
|
|
88
|
+
### The menu answers the moment it shows
|
|
89
|
+
- **Invariant:** When the menu appears, every row opens its page at once, nothing hidden is still uploading, and the GPU has caught up, so a press on the menu is answered in the same moment.
|
|
90
|
+
- **Technique:** Request the menu pages' code chunk when the interface is built, before any world asset, because fetches at the same priority are served first come first served and script cannot be raised above high. Upload nothing hidden before the menu: an engine that builds a geometry's buffers on its first draw will build every hidden mesh in one frame of a warm-up, so trickle them nearest-first in small batches as the GPU answers. Show the menu after the GPU has finished its submitted work (`device.queue.onSubmittedWorkDone()` in WebGPU), with a cap. If a page's code is still late, open its frame at once and fill it on arrival. Find idle stretches of the network line and fill them.
|
|
91
|
+
- **Reference configuration:** LC's owner: "buttons are unresponsive on main menu ... and they take like 10s after i hit button for it to open the pag?". The menu pages' 21 KB script was queued behind 170 MB of world fetches; requested when the interface was built, Settings opened in 0.10 s at 5 Mbit instead of 23.0 s, and a late page opens its frame ("OPENING") in 26 ms. LC's 346 hidden litter meshes made 72-134 MB of buffers in one second before the menu; trickled, the menu's wait on a busy card went from 15.7 s to 0.28 s. Showing the menu only after the GPU drained (capped at 12 s) took Enter to a fresh frame from 4.2-9.9 s to 0.54-0.86 s, at a cost of 0.35 s on a quiet card and 1.7-9.6 s on a shared one. At 5 Mbit, 12-13 s of LC's boot had nothing on the line.
|
|
92
|
+
- **Applies when:** Every web game that streams after the first screen.
|
|
93
|
+
- **Verify:** On a cold boot at a slow link, click every menu row by a real pointer at 1, 3, 6 and 12 s after it appears: each page opens at once. The network log shows the menu chunk before the first world asset.
|
|
94
|
+
|
|
95
|
+
### What the player sees first is loaded first, and never as a stand-in
|
|
96
|
+
- **Invariant:** The equipped weapon, the player's own character and their sounds load at top priority and are resident before the screen that shows them, so no partial, mixed or generic stand-in and no empty hand appears; a complete light copy shows only where `opengame-weapons` allows one, and anything else late shows the previous complete asset or a designed loading state.
|
|
97
|
+
- **Technique:** Run fetches through a ranked queue with a few files in flight (measured against an uncapped boot), and order requests by need. Request the chosen loadout from the title as soon as it is chosen, and after the press that starts play let nothing else start while those files fly. Gate screens, purchases and pickups on the asset being ready. Load the equipped weapon's sounds with its model. Keep the old complete model on screen until the new one is fully ready. Stream variety by seconds of play, one texture per task with idle time after it.
|
|
98
|
+
- **Reference configuration:** OC's runtime had no priority control, so request order was the only control it had. Weapons the player was given arrived 2.5-7 s late (about 40 s for the heaviest) as mitten hands or black shapes, which spoiled captures in 3 streams and caused a false regression. One lazy-load change put low-poly guns in 6 places; the owner: "dont show the low poly versions anywhere anytime for any weapon anywhere in the game". Gun sounds were silent for 11-16 s, queued behind 35 MB of audio banks. LC keeps at most 4 files in flight (8 in a run); asking for the chosen weapons from the title took Enter to play at 5 Mbit from 3.99-5.32 s to 0.49-0.65 s. OS's rival models waited over 20 s behind a queue full of audio, and backpressure brought 31 posed rivals from 24.4 s to 2.0 s. OS's owner met the opposite failure: "we cant have a situatoinw here not all the gun models load..."; its weapon cards now wait and fade in together (10-25 s became 0.1-0.24 s), and the trade between a complete light model and bare hands is in `opengame-weapons`.
|
|
99
|
+
- **Applies when:** Every game with a loadout, a character select or items that appear mid-game.
|
|
100
|
+
- **Verify:** On a cold cache under throttle, go straight to play and fire: the first frame of the weapon is the full model and the first shot is heard. Capture every path that hands over an item. The network log shows the loadout first.
|
|
101
|
+
|
|
102
|
+
### The lobby is the loading screen: count down only on a shown map, and fetch nothing in play
|
|
103
|
+
- **Invariant:** In a match-based game, the chosen map streams and compiles during the lobby and countdown, the countdown starts only on a fully shown map and runs straight into play, and the first minute of play downloads nothing new.
|
|
104
|
+
- **Technique:** One "shown" gate: the build is done, spawns are validated, pipelines have been ready for two frames, no reads are in flight, and textures are on the GPU. Only after the map is shown, warm the sets the first match draws (killstreak art, rivals' weapons) during the countdown. Slice map building into resumable jobs with a per-frame time budget that guarantees at least one unit of progress a frame and has a hard cap.
|
|
105
|
+
- **Reference configuration:** OS's owner: "it says 10 seconds, then 5, 4 and then nothing happens and the game just keeps loading?...". Before the gate, one map showed props over a blue void; after it, ten maps were shown in 1.0-3.1 s. Downloads in the first 60 s of play went from 41.5 MB to 0.0-0.2 MB; warming at the reveal instead had stretched the hold from 21.3 to 41.7 s. A build budget of 6 ms a frame (4 ms on weak machines) took seen frames over 16.7 ms from 24 of 26 to none, and a split without guaranteed progress held the title for 671 s. OS's largest first-match download was 19.6 MB of streak art, now warmed in the countdown. This narrows AW's rule in `opengame-performance`: a countdown may warm, but only what the first match draws, and only once the map is shown.
|
|
106
|
+
- **Applies when:** Match-based games with lobbies or countdowns.
|
|
107
|
+
- **Verify:** A request log bucketed by phase from a fresh boot through the real lobby shows nothing in the first minute of play. On a throttled run, the countdown waits for the shown gate.
|
|
108
|
+
|
|
109
|
+
### Images decode off the main thread, and textures ship by role
|
|
110
|
+
- **Invariant:** No image decode or texture upload blocks a frame the player sees, and each texture's GPU format is chosen for its role by measurement, so the card holds what the frame draws and no more.
|
|
111
|
+
- **Technique:** Decode images with `fetch` and `createImageBitmap` (or `ImageBitmapLoader`), never through an `<img>` element on the main thread. Ship KTX2: ETC1S where colour is seen at a distance, UASTC for normal and data maps unless measurement says ETC1S is enough, and mips stored smallest first so a file's prefix is a smaller valid texture that can be fetched first and sharpened in place. Upload one large texture per task with idle time after it. The measuring is in `opengame-performance`; per-class texture caps for phones are in `opengame-mobile`.
|
|
112
|
+
- **Reference configuration:** LC's world textures on the card went from 800.7 MB to 172 MB with ETC1S colour and UASTC data; its in-browser encoder took about 100 s per 2048 map. Decoding through `<img>` had cost 2.5 s of main thread, and a 2048 upload is a 130-650 ms long task. LC's 88 first-set KTX2 files are 22.6 MB whole, 8.0 MB without the top level and 4.1 MB without two, and each prefix transcodes to exactly the bytes of the full file's smaller mips. AW measured ETC1S good enough for its normals at a sixth of UASTC's bytes.
|
|
113
|
+
- **Applies when:** Every textured game.
|
|
114
|
+
- **Verify:** A boot trace shows no image decode on the main thread and no upload task over the frame budget in play. KTX2 statistics list each texture's codec by role.
|
|
115
|
+
|
|
116
|
+
### Changing quality never reloads the page
|
|
117
|
+
- **Invariant:** Tier and pixel ratio change at runtime without navigation, and a capability probe's result is stored for the next visit instead of applied by reloading.
|
|
118
|
+
- **Technique:** Read the stored tier or run a quick probe before creating the renderer (choosing tier and pixel ratio before the first frame is in `opengame-mobile`). Switch passes, resolution and texture sets at runtime. Prewarm only the active tier, and warm another tier when the player picks it.
|
|
119
|
+
- **Reference configuration:** An OC probe stored a higher tier 12 s after the title and reloaded the page, which matched the owner's report: "once it got near 100% it just restarted the game". Warming 4 tiers made the last 3-5% of phone loading take 1-3 min.
|
|
120
|
+
- **Applies when:** Every game with quality tiers.
|
|
121
|
+
- **Verify:** Change the tier in settings during a run: the page fires no `beforeunload`, the run continues, and the log shows one tier prewarmed at boot.
|
|
122
|
+
|
|
123
|
+
### Loading keeps going in a background tab
|
|
124
|
+
- **Invariant:** A player who switches away during the download comes back to a load that kept going.
|
|
125
|
+
- **Technique:** Drive loading from fetch promises and message events, not from animation frames. Slice long CPU work with `MessageChannel` or `scheduler.postTask`. Count stall timeouts in visible time only.
|
|
126
|
+
- **Reference configuration:** OC's runtime drove loading from its animation-frame loop, so loading halted in hidden tabs. Browsers stop `requestAnimationFrame` in a hidden tab and slow `setTimeout` to about once a second, then once a minute.
|
|
127
|
+
- **Applies when:** Every load long enough that a player might switch tabs.
|
|
128
|
+
- **Verify:** Start a cold load, switch to another tab for 60 s, return: the progress advanced while hidden, and no stall notice fired.
|
|
129
|
+
|
|
130
|
+
### A self-hosted build keeps code off the asset path
|
|
131
|
+
- **Invariant:** When the game is hosted outside a game platform, heavy assets come from a static host or CDN with no per-request code, with the headers the runtime needs and range requests where the runtime uses them.
|
|
132
|
+
- **Technique:** Put the page shell and the heavy assets on separate hosts if one host's limits are smaller than the game. Serve assets as plain static files under content-hash keys. If the game uses threads (`SharedArrayBuffer`), send `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` on the page and `Cross-Origin-Resource-Policy` on the asset host. Check the served build after each deploy (see `opengame-stability`).
|
|
133
|
+
- **Reference configuration:** OC split a 106 MB page shell from 3.07 GB of assets on a CDN under per-build paths. A worker function on every asset request billed about 5,000 requests per load. OS put its page on a static host and its assets in a public object bucket under keys of a 12-character content hash plus size, immutable and Brotli, with no code in front, and called a deploy done only when production showed 3,168 requests, 0 failed, 0 console errors and a running match.
|
|
134
|
+
- **Applies when:** Games deployed to your own hosting. On OpenGame, `opengame-deploy` covers packaging and the platform serves the files.
|
|
135
|
+
- **Verify:** One cold load's request log shows no function invocations for asset files, the isolation headers on the page and the asset responses, and `206` responses where the runtime sends `Range`.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A loading count that tells the truth. Copy this file into the game; it imports nothing
|
|
3
|
+
* and touches no page element. It turns the stages of a boot into one number that only
|
|
4
|
+
* rises, rises in small steps, never reads 100 until the game says play can start, and
|
|
5
|
+
* reports how long it ever stood still, so a stage that needs splitting is found by a
|
|
6
|
+
* number rather than by a player.
|
|
7
|
+
*
|
|
8
|
+
* import { createLoadingCount } from "./loading-count.mjs";
|
|
9
|
+
*
|
|
10
|
+
* const saved = JSON.parse(localStorage.getItem("boot-times") ?? "{}");
|
|
11
|
+
* const count = createLoadingCount({
|
|
12
|
+
* stages: [{ name: "shell", weight: 2e6 }, { name: "world", weight: 40e6 }, { name: "shaders", weight: 8e6 }],
|
|
13
|
+
* previous: saved, // last visit's seconds per stage, if any
|
|
14
|
+
* });
|
|
15
|
+
* count.report("world", bytesSoFar / worldBytes); // as chunks arrive
|
|
16
|
+
* count.begin("shaders"); // a stage with nothing to report until done
|
|
17
|
+
* count.report("shaders", 1);
|
|
18
|
+
* count.ready(); // only when a run can start
|
|
19
|
+
* const shown = count.step(dt); // each frame; draw this number
|
|
20
|
+
* localStorage.setItem("boot-times", JSON.stringify(count.durations()));
|
|
21
|
+
*
|
|
22
|
+
* Weights are bytes (or any cost) on a first visit. When the previous visit timed every
|
|
23
|
+
* stage, its seconds become the weights, because the wait a player sits through is time,
|
|
24
|
+
* and a compile that downloads nothing can be most of it.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export function createLoadingCount({
|
|
28
|
+
stages,
|
|
29
|
+
previous = {},
|
|
30
|
+
maxRate = 30,
|
|
31
|
+
now = () => (typeof performance !== "undefined" ? performance.now() : Date.now()) / 1000,
|
|
32
|
+
} = {}) {
|
|
33
|
+
if (!Array.isArray(stages) || stages.length === 0) throw new Error("createLoadingCount needs at least one stage");
|
|
34
|
+
const timed = stages.every((stage) => Number(previous[stage.name]) > 0);
|
|
35
|
+
const weights = new Map(stages.map((stage) => [stage.name, Math.max(0, timed ? Number(previous[stage.name]) : Number(stage.weight ?? 1))]));
|
|
36
|
+
const total = [...weights.values()].reduce((sum, weight) => sum + weight, 0) || 1;
|
|
37
|
+
const fraction = new Map(stages.map((stage) => [stage.name, 0]));
|
|
38
|
+
const started = new Map();
|
|
39
|
+
const finished = new Map();
|
|
40
|
+
const created = now();
|
|
41
|
+
let isReady = false;
|
|
42
|
+
let shownExact = 0;
|
|
43
|
+
let shown = 0;
|
|
44
|
+
let still = 0;
|
|
45
|
+
let longest = 0;
|
|
46
|
+
|
|
47
|
+
function known(name) {
|
|
48
|
+
if (!fraction.has(name)) throw new Error(`unknown loading stage "${name}"`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Start a stage's clock before it has progress to report (a compile, a scene build). */
|
|
52
|
+
function begin(name) {
|
|
53
|
+
known(name);
|
|
54
|
+
if (!started.has(name)) started.set(name, now());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function report(name, value) {
|
|
58
|
+
known(name);
|
|
59
|
+
const clamped = Math.min(1, Math.max(0, Number(value) || 0));
|
|
60
|
+
if (!started.has(name)) {
|
|
61
|
+
// A stage whose first report is its completion did its work unseen. Time it from the
|
|
62
|
+
// last stage that finished before it (or from the start of the boot), never from
|
|
63
|
+
// now, or it would weigh nothing next visit and the count would stand still through it.
|
|
64
|
+
const before = [...finished.values()].reduce((latest, end) => Math.max(latest, end), created);
|
|
65
|
+
started.set(name, clamped >= 1 ? before : now());
|
|
66
|
+
}
|
|
67
|
+
// A stage never goes back: a retry that restarts a download keeps the count where it was.
|
|
68
|
+
if (clamped > fraction.get(name)) fraction.set(name, clamped);
|
|
69
|
+
if (fraction.get(name) >= 1 && !finished.has(name)) finished.set(name, now());
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** The true share of the work done, as a percentage; 99 at most until ready(). */
|
|
73
|
+
function truth() {
|
|
74
|
+
if (isReady) return 100;
|
|
75
|
+
let done = 0;
|
|
76
|
+
for (const [name, weight] of weights) done += weight * fraction.get(name);
|
|
77
|
+
return Math.min(99, (100 * done) / total);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Advance the shown number toward the truth by at most maxRate points a second. */
|
|
81
|
+
function step(dt) {
|
|
82
|
+
const seconds = Math.max(0, Number(dt) || 0);
|
|
83
|
+
const target = truth();
|
|
84
|
+
const before = shown;
|
|
85
|
+
if (shownExact < target) shownExact = Math.min(target, shownExact + maxRate * seconds);
|
|
86
|
+
shown = Math.max(shown, Math.floor(shownExact + 1e-9));
|
|
87
|
+
if (shown === before && !isReady) {
|
|
88
|
+
still += seconds;
|
|
89
|
+
longest = Math.max(longest, still);
|
|
90
|
+
} else {
|
|
91
|
+
still = 0;
|
|
92
|
+
}
|
|
93
|
+
return shown;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Seconds each finished stage took, to pass back as `previous` on the next visit. */
|
|
97
|
+
function durations() {
|
|
98
|
+
const out = {};
|
|
99
|
+
for (const [name, end] of finished) out[name] = Math.max(1e-3, end - started.get(name));
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
begin,
|
|
105
|
+
report,
|
|
106
|
+
ready() { isReady = true; },
|
|
107
|
+
truth,
|
|
108
|
+
step,
|
|
109
|
+
shown: () => shown,
|
|
110
|
+
durations,
|
|
111
|
+
/** The longest the shown number stood still before ready(), in seconds. */
|
|
112
|
+
longestHold: () => longest,
|
|
113
|
+
weightedBy: timed ? "previous visit" : "given weights",
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Loading in three.js
|
|
2
|
+
|
|
3
|
+
How the rules in `SKILL.md` map onto three.js and a Vite build. Class names are from
|
|
4
|
+
three.js addons (`three/addons/...`). Check them against the three.js version in your
|
|
5
|
+
`package.json`, since loader options move between releases.
|
|
6
|
+
|
|
7
|
+
## Compressed textures: KTX2 and Basis
|
|
8
|
+
|
|
9
|
+
Encode textures as KTX2 with Basis Universal supercompression, and load them with
|
|
10
|
+
`KTX2Loader`. The loader transcodes to whatever the GPU supports (BC on desktop, ASTC or
|
|
11
|
+
ETC on phones), so one file serves every device class.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
|
|
15
|
+
|
|
16
|
+
const ktx2 = new KTX2Loader()
|
|
17
|
+
.setTranscoderPath('/basis/') // copy node_modules/three/examples/jsm/libs/basis/ here
|
|
18
|
+
.detectSupport(renderer); // for WebGPURenderer, after `await renderer.init()`
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- ETC1S is small and soft; UASTC is larger and sharp. Choose by the map's role, then
|
|
22
|
+
measure: LC ships colour seen at a distance as ETC1S and normal and data maps as
|
|
23
|
+
UASTC (world textures on the card went from 800.7 MB to 172 MB), while AW measured
|
|
24
|
+
ETC1S good enough for its normals at a sixth of UASTC's bytes (see
|
|
25
|
+
`opengame-performance`).
|
|
26
|
+
- Store mips smallest first. The file's prefix is then a smaller valid texture: fetch it
|
|
27
|
+
first, draw it, and sharpen in place when the rest arrives. LC's 88 first-set files are
|
|
28
|
+
22.6 MB whole and 8.0 MB without their top level, and a test proved the dropped-mip
|
|
29
|
+
prefix transcodes to exactly the same bytes through the real transcoder.
|
|
30
|
+
- In LC's WebGPU build, compressed array textures flagged `isArrayTexture` drew black.
|
|
31
|
+
Look at one on screen before converting a whole set.
|
|
32
|
+
- Phones need lower top mips as well as a different transcode target. Ship a mip-trimmed
|
|
33
|
+
file per device class and pick it from the manifest, so a phone does not download mips
|
|
34
|
+
it will throw away (see `opengame-mobile`).
|
|
35
|
+
- Encode with `gltf-transform` (`--texture-compress ktx2`) or KTX-Software's `toktx`. An
|
|
36
|
+
in-browser WASM encoder works with no binary install, at about 100 s per 2048 map (LC).
|
|
37
|
+
|
|
38
|
+
## Geometry: meshopt or Draco
|
|
39
|
+
|
|
40
|
+
Both shrink glTF geometry. Meshopt decodes faster and also compresses animation and
|
|
41
|
+
morph targets; Draco often makes smaller static meshes. Pick by measuring your models.
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
45
|
+
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
46
|
+
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
|
|
47
|
+
|
|
48
|
+
const draco = new DRACOLoader().setDecoderPath('/draco/');
|
|
49
|
+
const gltf = new GLTFLoader()
|
|
50
|
+
.setKTX2Loader(ktx2)
|
|
51
|
+
.setDRACOLoader(draco)
|
|
52
|
+
.setMeshoptDecoder(MeshoptDecoder);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`gltf-transform optimize in.glb out.glb --compress meshopt --texture-compress ktx2` does
|
|
56
|
+
both passes in one command. Compare the result side by side with the source under the
|
|
57
|
+
same light before shipping it; quantisation can move vertices on thin parts.
|
|
58
|
+
|
|
59
|
+
## LoadingManager, staged
|
|
60
|
+
|
|
61
|
+
`LoadingManager.onProgress(url, itemsLoaded, itemsTotal)` counts files, not bytes. One
|
|
62
|
+
large model and fifty icons then weigh the same, which is how a bar stops at 60% and jumps
|
|
63
|
+
to 100%. Use one manager per tier (boot, first use, rest) so each tier has its own
|
|
64
|
+
`onLoad`, and drive the bar from bytes:
|
|
65
|
+
|
|
66
|
+
- Take each file's size from your manifest. The per-file `onProgress` event from
|
|
67
|
+
`GLTFLoader.load` reports `loaded` and `total`, but with Brotli or gzip on the wire
|
|
68
|
+
`total` is the compressed `Content-Length` while `loaded` counts decoded bytes, and
|
|
69
|
+
`total` is 0 when the header is missing. Recent `FileLoader` versions read an
|
|
70
|
+
`X-File-Size` header first when the server sends one. Manifest sizes avoid all of it.
|
|
71
|
+
- Add fixed weights for work that is not a download: `renderer.compileAsync(scene,
|
|
72
|
+
camera)` for shaders, PMREM environment maps, building instanced scenes. On a return
|
|
73
|
+
visit, weight each stage by its seconds last time (`helpers/loading-count.mjs`).
|
|
74
|
+
- With `WebGPURenderer`, `compileAsync` covers only the pass that draws to the canvas.
|
|
75
|
+
Passes into render targets (shadows, post, a scope) need their own warm draw, or they
|
|
76
|
+
compile in play (see `opengame-performance`).
|
|
77
|
+
- `manager.setURLModifier` maps logical names to hashed URLs from the manifest.
|
|
78
|
+
- `manager.onError` fires per failed URL. Retry from there (or from your own fetch
|
|
79
|
+
wrapper) instead of letting the tier wait forever.
|
|
80
|
+
|
|
81
|
+
Three.js loaders do not retry. For retries, timeouts and a priority order, fetch the
|
|
82
|
+
bytes yourself and hand them to `GLTFLoader.parse(arrayBuffer, path, onLoad, onError)`.
|
|
83
|
+
|
|
84
|
+
## Vite: hashed assets
|
|
85
|
+
|
|
86
|
+
Vite puts a content hash in the name of every asset it processes: files imported from
|
|
87
|
+
JavaScript, referenced from CSS or HTML, or imported with `?url`.
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
import gunUrl from './assets/guns/rifle.glb?url'; // -> /assets/rifle-3f9a1c2b.glb
|
|
91
|
+
gltf.load(gunUrl, onLoad);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- Files in `public/` are copied as they are, with no hash. Move cacheable assets out of
|
|
95
|
+
`public/`, or hash them in your own build step, or the long cache rule cannot apply.
|
|
96
|
+
- `build.manifest: true` writes `.vite/manifest.json`, which maps source paths to hashed
|
|
97
|
+
output. Join it with your request log to build the runtime manifest.
|
|
98
|
+
- Vite inlines small assets as data URLs below `build.assetsInlineLimit`. Set it to 0 for
|
|
99
|
+
game assets so each one is cached on its own.
|
|
100
|
+
- Vite does not write Brotli or gzip siblings. A post-build script with Node's
|
|
101
|
+
`zlib.brotliCompressSync` and `zlib.gzipSync` over `dist/` does; skip files that are
|
|
102
|
+
already compressed (KTX2, images, audio) unless measuring shows a gain.
|
|
103
|
+
- Vite adds `<link rel="modulepreload">` for the entry's imports. Add `<link
|
|
104
|
+
rel="preload">` by hand for the boot-tier key art and title music.
|
|
105
|
+
|
|
106
|
+
## Service worker
|
|
107
|
+
|
|
108
|
+
The HTTP cache can be evicted. A service worker that keeps hashed files in Cache Storage
|
|
109
|
+
makes a return visit nearly free:
|
|
110
|
+
|
|
111
|
+
- Cache first for hashed URLs, since a hashed file never changes.
|
|
112
|
+
- Network first for the entry document, so a deploy is picked up on the next visit.
|
|
113
|
+
- On `activate`, delete caches from older builds.
|
|
114
|
+
- `vite-plugin-pwa` (Workbox) generates the precache list from the build; a short
|
|
115
|
+
worker of your own works as well.
|
|
116
|
+
|
|
117
|
+
Watch memory when writing to the cache from the page, which matters on a phone. One
|
|
118
|
+
common way to double it: `response.clone()` splits the body into two streams, and if the game reads its
|
|
119
|
+
copy into an `ArrayBuffer` while the cache copy is still being written, both copies sit
|
|
120
|
+
in memory. Let the service worker do the caching from its own fetch handler, and measure
|
|
121
|
+
tab memory with the cache on and off.
|
|
122
|
+
|
|
123
|
+
## Upload and memory
|
|
124
|
+
|
|
125
|
+
- `ImageBitmapLoader` decodes images off the main thread, as does `fetch` plus
|
|
126
|
+
`createImageBitmap(blob)` handed to a `Texture`. `TextureLoader` goes through an
|
|
127
|
+
`<img>` element; LC measured that path at 2.5 s of decode on the main thread. After the
|
|
128
|
+
GPU upload, close the bitmap so its CPU copy is freed (see `opengame-mobile` for when
|
|
129
|
+
that is safe).
|
|
130
|
+
- three.js builds a geometry's GPU buffers on the frame that first draws it. A warm-up that
|
|
131
|
+
draws every hidden mesh at once builds them all in one frame (LC: 346 hidden meshes,
|
|
132
|
+
72-134 MB of buffers in one second before the menu). Warm in slices, nearest first.
|
|
133
|
+
- To show the menu only when the GPU has caught up, await
|
|
134
|
+
`renderer.backend.device.queue.onSubmittedWorkDone()` after the warm frames (check the
|
|
135
|
+
property path against your three.js version), with a timeout so a busy GPU cannot hold
|
|
136
|
+
the menu for ever.
|
|
137
|
+
- Call `dispose()` on geometries, materials and textures you unload, and watch
|
|
138
|
+
`renderer.info.memory` fall.
|
|
139
|
+
- `renderer.compileAsync` before the menu lifts keeps the canvas pass's shader links out
|
|
140
|
+
of play; draw once through every render-target pass as well (see
|
|
141
|
+
`opengame-performance`).
|