Organize, name, load and track a game's assets (images, sprite sheets, audio, music, fonts, models, levels, data). Folder layout, naming rules that survive case-sensitive hosts, a manifest and preloader with progress, atlases, formats and size targets, placeholder-to-final swaps, licenses and CREDITS.md, finding unused or missing files, and versioning big binaries. Includes a tested asset-audit...
Download skill (.zip) Files on GitHubGame asset management
Layout and naming
assets/
img/ sprites/ tiles/ ui/ bg/ (atlases: img/atlas.png + atlas.json)
sfx/ jump.mp3 coin-01.mp3 coin-02.mp3
music/ title-loop.mp3 level-loop.mp3
fonts/ press-start-2p.woff2
models/ ship.glb
data/ levels/level-01.json enemies.json
CREDITS.md every asset not made by you: title, author, source URL, license
- lowercase-kebab-case, no spaces, ASCII only. Case must match the code exactly: Bash and itch.io servers are case-sensitive
(
Hero.png≠hero.png). Number variants with two digits (coin-01). - Relative paths (
assets/img/hero.png, never/assets/...), so the game works in subfolders and on itch.io. - Source files (
.psd,.aseprite,.blend, raw.wav) go insource-assets/, outside the shipped folder.
Manifest + preloader
Keep one list of what to load, in code or assets/manifest.json:
export const MANIFEST = {
images: { hero: "assets/img/sprites/hero.png", tiles: "assets/img/tiles/forest.png" },
audio: { jump: "assets/sfx/jump.mp3", music: "assets/music/level-loop.mp3" },
json: { level1: "assets/data/levels/level-01.json" },
};
export async function loadAll(m, onProgress) {
const jobs = [
...Object.entries(m.images || {}).map(([k, u]) => [k, () => new Promise((res, rej) => { const i = new Image(); i.onload = () => i.decode().then(() => res(i), () => res(i)); i.onerror = () => rej(new Error("image " + u)); i.src = u; })]),
...Object.entries(m.json || {}).map(([k, u]) => [k, () => fetch(u).then((r) => { if (!r.ok) throw new Error(r.status + " " + u); return r.json(); })]),
...Object.entries(m.audio || {}).map(([k, u]) => [k, () => fetch(u).then((r) => { if (!r.ok) throw new Error(r.status + " " + u); return r.arrayBuffer(); })]),
];
const out = {}; let done = 0;
await Promise.all(jobs.map(async ([k, job]) => { out[k] = await job(); onProgress?.(++done / jobs.length); }));
return out; // audio buffers: decode with your AudioContext once unlocked
}
Show a progress bar. On error, show “Couldn’t load
Formats and budgets
| Type | Format | Budget |
|---|---|---|
| Sprites / UI | PNG (pixel art, transparency), WebP (photos, painted art) | Atlases ≤ 2048×2048 |
| Backgrounds | WebP / JPEG | ≤ 2× the game resolution |
| Sound effects | MP3 or OGG (+ fallback), mono, short | 5–50 KB each |
| Music | MP3/OGG 96–128 kbps | 1–3 MB per track |
| Fonts | WOFF2, subset if possible | < 100 KB |
| 3D | GLB with Draco/meshopt, KTX2 textures | < 5 MB per model |
Shrinking existing files: bash-web-asset-shrinker. Making covers and screenshots: bash-store-page-kit.
Placeholders → final
Use colored shapes or synth sounds first (game-prototyping). Give placeholders their final names and sizes, so swapping is
just replacing the file. Keep a checklist in docs/HANDOFF.md of what’s still placeholder.
Audit: missing, unused, case problems, oversize
python3 <skill>/scripts/asset-audit.py <game-folder> # report
python3 <skill>/scripts/asset-audit.py <game-folder> --json
It finds files the code references that don’t exist (including wrong case), asset files nothing references, files over
the size budgets, names with spaces or capitals, and assets missing from CREDITS.md (if it exists).
Licenses
Only use assets with a license that allows it (CC0, CC-BY with credit, or bought with a game license). Record every one in
CREDITS.md when you add it. bash-game-audio-credits finds free sounds and writes the credit lines.