perf(assets): ship key art as webp and drop unreferenced media
Fifty-seven percent of the built output was reachable by nothing but a manifest that is never fetched at runtime. The key art documented as the menu background was never wired up; a 1.2KB placeholder was loaded instead. - wire key art into the menu, ending screen and act four to six intros - re-encode key art to webp: 1.63MB to 556KB at DSSIM around 0.012 - move 3.9MB of unwired voice lines and authoring sources out of the bundle into unshipped-assets, still tracked rather than deleted - add 192 and 512 icons, the sizes an install prompt requires
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 192 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 216 KiB |
@@ -55,7 +55,31 @@ export const GENERATED_SCENES = [
|
||||
`${BASE}scene-chamber.png`,
|
||||
];
|
||||
|
||||
// Hand-authored 1280x720 key art, stored as webp (the source pngs were ~3x the
|
||||
// size at no visible gain on a backdrop rendered under a gradient).
|
||||
const KEYART_BASE = 'assets/images/';
|
||||
|
||||
export const KEYART = {
|
||||
garden: `${KEYART_BASE}keyart-garden.webp`,
|
||||
gameover: `${KEYART_BASE}keyart-gameover.webp`,
|
||||
underground: `${KEYART_BASE}keyart-underground.webp`,
|
||||
palace: `${KEYART_BASE}keyart-palace.webp`,
|
||||
throne: `${KEYART_BASE}keyart-throne.webp`,
|
||||
};
|
||||
|
||||
// Level-intro backdrops. Acts 4-6 use the detailed key art; earlier acts use the
|
||||
// generated scene tiles, which suit the simpler outdoor levels.
|
||||
const KEYART_BY_LEVEL = {
|
||||
7: KEYART.underground,
|
||||
8: KEYART.underground,
|
||||
9: KEYART.palace,
|
||||
10: KEYART.palace,
|
||||
11: KEYART.palace,
|
||||
12: KEYART.throne,
|
||||
};
|
||||
|
||||
export function generatedSceneForLevel(level) {
|
||||
if (KEYART_BY_LEVEL[level]) return KEYART_BY_LEVEL[level];
|
||||
const idx = Math.max(0, Math.min(GENERATED_SCENES.length - 1, level - 1));
|
||||
return GENERATED_SCENES[idx];
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 190 KiB After Width: | Height: | Size: 190 KiB |
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 492 KiB After Width: | Height: | Size: 492 KiB |
|
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 285 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 669 B After Width: | Height: | Size: 669 B |
|
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |