game-development

Core game development principles applicable to all platforms. Game loop, design patterns, optimization, and AI fundamentals.

$ Installer

git clone https://github.com/xenitV1/claude-code-maestro /tmp/claude-code-maestro && cp -r /tmp/claude-code-maestro/skills/game-development ~/.claude/skills/claude-code-maestro

// tip: Run this command in your terminal to install the skill


name: game-development description: Core game development principles applicable to all platforms. Game loop, design patterns, optimization, and AI fundamentals.

Game Development Fundamentals

Core principles for game development across all platforms. Learn to THINK, not memorize engine APIs.


1. Game Loop Principles

The Universal Pattern

Every game has:
1. INPUT → Read player actions
2. UPDATE → Process game logic (fixed timestep)
3. RENDER → Draw the frame (interpolated)

Fixed Timestep Principle

  • Physics/logic updates at fixed rate (e.g., 50Hz)
  • Rendering runs as fast as possible
  • Interpolate between states for smooth visuals

2. Design Pattern Selection

When to Use Each Pattern

PatternUse WhenExample
State MachineDiscrete states with transitionsPlayer: Idle→Walk→Jump→Attack
Object PoolingFrequent create/destroyBullets, particles, enemies
Observer/EventsDecoupled communicationHealth→UI, Death→Audio
ECSMany similar entitiesThousands of units
CommandReplay, undo, networkingInput recording, multiplayer
Behavior TreeComplex AI decisionsEnemy AI

Selection Principles

  • Start simple (State Machine)
  • Add ECS only if performance demands
  • Use Events for cross-system communication
  • Pool anything spawned frequently

3. Core Systems Design

Input Abstraction

Abstract input into ACTIONS, not keys:
- "jump" → Space, Gamepad A, Touch tap
- "move" → WASD, Left stick, Virtual joystick

Benefits: Multi-platform, rebindable

Collision Strategy

TypeBest For
AABBRectangles, fast
CircleRound objects, cheap
Spatial HashMany objects, same size
QuadtreeLarge worlds, varying sizes

Save System

PlatformStorage
WebLocalStorage, IndexedDB
MobilePlayerPrefs, FileAccess
PCJSON/Binary files

4. Performance Principles

Frame Budget (60 FPS = 16.67ms)

SystemBudget
Input1ms
Physics3ms
AI2ms
Game Logic4ms
Rendering5ms
Buffer1.67ms

Optimization Priority

  1. Algorithm - O(n²) to O(n log n)
  2. Batching - Reduce draw calls
  3. Pooling - Avoid GC spikes
  4. LOD - Detail at distance
  5. Culling - Don't render invisible

Memory Management

  • Pool frequently spawned objects
  • Use sprite atlases
  • Stream large assets
  • Unload unused resources

5. AI Fundamentals

Selection by Complexity

AI TypeComplexityUse Case
FSMSimple3-5 states, predictable
Behavior TreeMediumModular, designer-friendly
GOAPHighEmergent, planning
Utility AIHighScoring-based decisions

Common AI Behaviors

  • Patrol → Move between waypoints
  • Chase → Follow player
  • Attack → Engage when in range
  • Flee → Escape when low health

6. Audio Principles

Audio Categories

CategoryBehavior
MusicLoop, crossfade
SFXOne-shot, 3D positioned
UIImmediate, no 3D
VoicePriority, ducking

Best Practices

  • Pool audio sources
  • 3D audio for immersion
  • Duck music during dialogue
  • Preload frequently used sounds

7. Anti-Patterns

❌ Don't✅ Do
Update everything every frameUse events, dirty flags
Create objects in hot loopsObject pooling
SELECT * in game logicCache references
Optimize without profilingProfile first
Mix input with logicAbstract input layer

8. Sub-Skills Reference

Platform-specific guidance:

  • PC Games → Engine selection, Steam
  • Web Games → Phaser, Three.js, WebGPU
  • Mobile Games → Touch, battery, stores
  • Game Design → GDD, balancing
  • Multiplayer → Networking patterns
  • VR/AR → Immersion, comfort
  • 2D Games → Sprites, tilemaps
  • 3D Games → Meshes, shaders

Remember: Great games come from iteration, not perfection. Prototype fast, then polish.