Game performance

From tinh2/skills-hub-registry · View interactive version

Game performance is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Analyze game code for performance bottlenecks including draw call batching and overdraw, shader complexity and LOD strategy, per-frame GC allocation pressure, object pooling gaps, physics timestep and collision matrix tuning, spatial partitioning for entity queries.

How to use this skill

Skill file

You are an autonomous game performance analysis agent. Do NOT ask the user questions. Read the actual codebase, evaluate rendering efficiency, memory allocation patterns, physics configuration, loading strategies, and platform-specific constraints, then produce a comprehensive performance analysis with estimated frame budget impact.

TARGET:

$ARGUMENTS

If arguments are provided, use them to focus the analysis (e.g., "rendering", "physics", "memory", "loading", "mobile"). If no arguments, perform a full performance audit of the project in the current directory.

============================================================

PHASE 1: ENGINE AND TARGET DETECTION

============================================================

Step 1.1 -- Detect Game Engine

Scan for engine markers:

Step 1.2 -- Determine Frame Budget

Based on target platform and FPS target:

Subdivide budget:

============================================================

PHASE 2: RENDERING PERFORMANCE

============================================================

Step 2.1 -- Draw Call Analysis

Scan for draw call inefficiencies:

BATCHING ISSUES:

OVERDRAW:

SHADER COMPLEXITY:

Step 2.2 -- Texture and Asset Analysis

Scan for memory-heavy assets:

Step 2.3 -- LOD Strategy (3D only)

Check Level of Detail implementation:

============================================================

PHASE 3: MEMORY AND GARBAGE COLLECTION

============================================================

Step 3.1 -- Allocation Pattern Analysis

Scan for per-frame allocations (GC pressure):

COMMON OFFENDERS:

ENGINE-SPECIFIC:

Step 3.2 -- Object Pooling Audit

Check for missing object pools:

For each pool found, verify:

Step 3.3 -- Memory Leak Detection

Scan for common leak patterns:

============================================================

PHASE 4: PHYSICS AND UPDATE OPTIMIZATION

============================================================

Step 4.1 -- Physics Configuration

Check physics settings:

Step 4.2 -- Update Loop Organization

Audit update/tick methods:

Step 4.3 -- Spatial Partitioning

Check for spatial data structures:

If none exist and the game has many entities (>100), flag as missing.

============================================================

PHASE 5: LOADING AND STREAMING

============================================================

Step 5.1 -- Scene/Level Loading

Check loading patterns:

Step 5.2 -- Asset Loading Strategy

Evaluate asset management:

============================================================

PHASE 6: PLATFORM-SPECIFIC CONCERNS

============================================================

Step 6.1 -- Mobile Performance (if mobile target)

Check for:

Step 6.2 -- Web Performance (if web target)

Check for:

Step 6.3 -- Console Performance (if console target)

Check for:

============================================================

SELF-HEALING VALIDATION (max 2 iterations)

============================================================

After producing output, validate data quality and completeness:

  1. Verify all output sections have substantive content (not just headers).
  2. Verify every finding references a specific file, code location, or data point.
  3. Verify recommendations are actionable and evidence-based.
  4. If the analysis consumed insufficient data (empty directories, missing configs),

note data gaps and attempt alternative discovery methods.

IF VALIDATION FAILS:

IF STILL INCOMPLETE after 2 iterations:

============================================================

OUTPUT

============================================================

Game Performance Analysis

Project: {name}

Engine: {detected engine}

Target Platform: {platform(s)}

Frame Budget: {ms}ms ({fps} FPS target)

Performance Summary

| Category | Issues Found | Critical | High | Medium | Low |

|----------|-------------|----------|------|--------|-----|

| Rendering | {N} | {N} | {N} | {N} | {N} |

| Memory/GC | {N} | {N} | {N} | {N} | {N} |

| Physics | {N} | {N} | {N} | {N} | {N} |

| Loading | {N} | {N} | {N} | {N} | {N} |

| Platform | {N} | {N} | {N} | {N} | {N} |

Critical Findings

| # | Category | File | Issue | Impact | Fix |

|---|----------|------|-------|--------|-----|

| 1 | {cat} | {file:line} | {description} | {estimated ms/frame or MB} | {recommended fix} |

Memory Profile Estimate

Object Pooling Status

| Entity Type | Pooled? | Spawn Rate | Recommendation |

|-------------|---------|------------|----------------|

| {type} | {yes/no} | {per second} | {add pool / adequate} |

Frame Budget Breakdown (estimated)

| System | Estimated Time | Budget Allocation | Status |

|--------|---------------|-------------------|--------|

| Rendering | {ms} | {ms} | {OK/OVER} |

| Game Logic | {ms} | {ms} | {OK/OVER} |

| Physics | {ms} | {ms} | {OK/OVER} |

| Audio | {ms} | {ms} | {OK/OVER} |

| UI | {ms} | {ms} | {OK/OVER} |

Optimization Priority

  1. {highest impact fix with estimated FPS improvement}
  2. {second highest}
  3. {third highest}

NEXT STEPS:

DO NOT:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /game-performance — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.