E

Expert Game Bot

Streamline your workflow with this agent, implementing, game, systems. Includes structured workflows, validation checks, and reusable patterns for game development.

AgentClipticsgame developmentv1.0.0MIT
0 views0 copies

Expert Game Bot

Your agent for game programming and development — covering game engine usage, gameplay systems implementation, game physics, AI behavior, and performance optimization for games.

When to Use This Agent

Choose Expert Game Bot when:

  • Implementing gameplay systems (combat, inventory, quest, dialogue)
  • Programming game AI (behavior trees, state machines, pathfinding)
  • Working with game physics (collision detection, rigid body, particle systems)
  • Optimizing game performance (rendering, memory, load times)
  • Debugging game-specific issues (frame drops, physics glitches, desync)

Consider alternatives when:

  • You need game design (mechanics, balance) — use a Game Designer agent
  • You need 3D web applications — use a 3D Navigator agent
  • You need Unity-specific help — use a Unity agent

Quick Start

# .claude/agents/game-bot.yml name: Expert Game Bot model: claude-sonnet tools: - Read - Write - Edit - Bash - Glob - Grep description: Game programming agent for gameplay systems, AI, physics, and performance optimization

Example invocation:

claude "Implement a behavior tree-based enemy AI system — patrol, chase, attack, and flee behaviors with smooth state transitions and line-of-sight detection"

Core Concepts

Game Architecture Patterns

PatternUse CaseImplementation
Entity Component System (ECS)Performance-critical gamesData-oriented, cache-friendly
Game Object HierarchyUnity-style, scene-basedObject-oriented, component-based
State MachineCharacter/AI statesFinite states with transitions
Behavior TreeComplex AI decisionsTree of selector/sequence/action nodes
Observer/EventDecoupled game eventsPublish-subscribe for game events

Game Loop Structure

while (running) {
    // 1. Process input
    input.poll();

    // 2. Fixed timestep update (physics, game logic)
    while (accumulator >= fixedDelta) {
        physics.step(fixedDelta);
        gameLogic.update(fixedDelta);
        accumulator -= fixedDelta;
    }

    // 3. Variable timestep update (animations, particles)
    animations.update(deltaTime);
    particles.update(deltaTime);

    // 4. Render
    renderer.draw(scene, camera);
}

Configuration

ParameterDescriptionDefault
engineGame engine (unity, unreal, godot, custom)auto-detect
languageProgramming language (csharp, cpp, gdscript, rust)auto-detect
target_fpsTarget frame rate60
physics_enginePhysics system (built-in, custom, rapier)built-in
optimization_focusPriority (cpu, gpu, memory, load-time)balanced

Best Practices

  1. Use fixed timestep for game logic, variable for rendering. Physics and game logic should update at a fixed rate (e.g., 60 Hz) regardless of frame rate for deterministic behavior. Rendering should use variable timestep for smooth display at any refresh rate.

  2. Pool frequently created and destroyed objects. Instantiating and destroying objects (bullets, particles, enemies) every frame causes garbage collection spikes. Pre-allocate object pools and recycle instances instead of creating new ones.

  3. Implement state machines for character and AI behavior. Explicit state machines (Idle, Walk, Run, Attack, Die) with defined transitions prevent bugs from impossible state combinations and make behavior debuggable and visualizable.

  4. Profile before optimizing. Don't guess where the bottleneck is. Use the engine's profiler (Unity Profiler, Unreal Insights, Godot Debugger) to identify actual hotspots. Optimizing code that runs once per frame while ignoring code that runs 10,000 times wastes effort.

  5. Separate game state from presentation. The logical game state (positions, health, scores) should be independent of visual representation. This enables headless testing, replay systems, and network synchronization.

Common Issues

Frame rate drops in specific game scenarios. Usually caused by: too many draw calls (batch similar meshes), physics running on too many objects (use layers and spatial partitioning), or garbage collection pauses (pool objects, avoid allocations in hot loops).

Physics behavior is inconsistent at different frame rates. Using deltaTime in physics calculations causes inconsistency. Use a fixed timestep with interpolation for rendering. FixedUpdate in Unity or _physics_process in Godot handle this automatically.

Game state desyncs in multiplayer. Caused by non-deterministic physics, floating-point inconsistency across platforms, or missed network events. Use server-authoritative state for critical gameplay, and client-side prediction with server reconciliation for responsive controls.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates