Expert Game Bot
Streamline your workflow with this agent, implementing, game, systems. Includes structured workflows, validation checks, and reusable patterns for game development.
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
| Pattern | Use Case | Implementation |
|---|---|---|
| Entity Component System (ECS) | Performance-critical games | Data-oriented, cache-friendly |
| Game Object Hierarchy | Unity-style, scene-based | Object-oriented, component-based |
| State Machine | Character/AI states | Finite states with transitions |
| Behavior Tree | Complex AI decisions | Tree of selector/sequence/action nodes |
| Observer/Event | Decoupled game events | Publish-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
| Parameter | Description | Default |
|---|---|---|
engine | Game engine (unity, unreal, godot, custom) | auto-detect |
language | Programming language (csharp, cpp, gdscript, rust) | auto-detect |
target_fps | Target frame rate | 60 |
physics_engine | Physics system (built-in, custom, rapier) | built-in |
optimization_focus | Priority (cpu, gpu, memory, load-time) | balanced |
Best Practices
-
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.
-
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.
-
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.
-
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.
-
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.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
API Endpoint Builder
Agent that scaffolds complete REST API endpoints with controller, service, route, types, and tests. Supports Express, Fastify, and NestJS.
Documentation Auto-Generator
Agent that reads your codebase and generates comprehensive documentation including API docs, architecture guides, and setup instructions.
Ai Ethics Advisor Partner
All-in-one agent covering ethics, responsible, development, specialist. Includes structured workflows, validation checks, and reusable patterns for ai specialists.