Agent skill
optimization
Optimization techniques for Nethercore WASM games. Covers WASM binary size reduction (LTO, wasm-opt), texture and mesh compression, audio optimization, and state size minimization. Use when a ROM exceeds size limits or when reducing build output size.
Install this agent skill to your Project
npx add-skill https://github.com/nethercore-systems/nethercore-ai-plugins/tree/main/nethercore/skills/optimization
Metadata
Additional technical details for this skill
- author
- nethercore-systems
- version
- 1.0.0
SKILL.md
Nethercore Optimization
WASM Optimization
Cargo.toml Settings
[profile.release]
lto = true # Link-time optimization
opt-level = "z" # Optimize for size
codegen-units = 1 # Better optimization
panic = "abort" # Smaller than unwind
strip = true # Strip symbols
Post-Build
wasm-opt -Oz game.wasm -o game.wasm
Typical savings: 20-40%
Texture Optimization
All textures use BC7 compression (4:1 ratio):
| Original | Compressed |
|---|---|
| 256x256 RGBA (256 KB) | 64 KB |
| 512x512 RGBA (1 MB) | 256 KB |
Resolution targets:
- UI elements: 256x256
- Characters: 256-512
- Environment: 128-256
Mesh Optimization
| Format | Size/Vertex |
|---|---|
| Position only | 12 bytes |
| Pos + UV | 20 bytes |
| Pos + UV + Normal | 32 bytes |
| Full | 40 bytes |
Poly targets:
- Background props: 50-200
- Interactive props: 100-500
- Characters: 500-2000
Audio Optimization
- Sample rate: 22050 Hz (engine limit)
- Channels: Mono only
- Use XM modules for music (95% savings vs WAV)
State Size Reduction
// Use compact types
struct Position { x: f32, y: f32 } // 8 bytes
struct Position { x: i16, y: i16 } // 4 bytes (fixed-point)
// Fixed arrays, not Vec
entities: [Entity; 64], // Known size
Quick Wins Checklist
- LTO and opt-level = "z" in Cargo.toml
- wasm-opt -Oz on final binary
- Texture resolutions at 256x256 default
- Music as XM format
- Fixed arrays instead of Vec
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ffi-reference
ZX fantasy console FFI bindings reference. Documents 250+ functions for rendering, input, audio, camera, transforms, textures, materials, and debug. Includes init-only vs render-only call rules and the coordinate system. Use when writing or debugging ZX FFI calls in game code.
console-specs
ZX fantasy console hardware specifications and resource budgets. Covers resolution (960x540), memory limits (4 MB RAM/VRAM, 16 MB ROM), render modes, audio system (22 kHz, 16 channels), and input layout. Use when planning resource budgets or checking console capabilities.
rendering
ZX rendering techniques and patterns. Covers camera systems (follow, orbit), stencil buffer effects (portals, masks), billboard particles, custom fonts, and render pass management. Use when implementing cameras, visual effects, particle systems, or choosing between 2D and 3D rendering approaches.
debugging
Runtime debugging tools for Nethercore games on all consoles. Covers the F4 Debug Inspector, live value editing, watch variables, frame stepping, and time-scale controls. Use when tuning game parameters at runtime, tracking state over time, or stepping through frames to find bugs.
testing
Testing Nethercore games for determinism and correctness. Covers sync testing, replay recording and playback, debug actions, and desync diagnosis. Use when running sync tests, setting up replay-based regression tests, or diagnosing determinism failures.
publishing
Publishing Nethercore games to nethercore.systems. Covers ROM packaging with nether pack, release builds, platform upload requirements, versioning, and CI/CD pipeline setup with GitHub Actions. Use when preparing a game for release or setting up automated builds.
Didn't find tool you were looking for?