AI Skill Report Card
Architecting Game Engines
YAML--- name: architecting-game-engines description: Architects scalable game engine systems and rendering pipelines. Use when designing core engine components, optimizing performance, or structuring large-scale game development frameworks. ---
Game Engine Architecture
Quick Start14 / 15
C++// Core engine loop structure class GameEngine { EngineSubsystem* renderer; EngineSubsystem* physics; EngineSubsystem* audio; EngineSubsystem* input; public: void Initialize() { renderer = new RenderSystem(); physics = new PhysicsSystem(); // Initialize in dependency order } void GameLoop() { while (running) { input->Update(deltaTime); physics->Update(deltaTime); renderer->Render(); } } };
Recommendation▾
Add concrete before/after performance metrics in examples (e.g., 'reduced frame time from 16ms to 8ms')
Workflow12 / 15
Progress:
- Define core subsystem interfaces
- Implement memory management strategy
- Build entity-component system
- Create rendering abstraction layer
- Implement resource management
- Add scripting integration
- Optimize critical paths
- Profile and iterate
1. System Architecture
- Use composition over inheritance for game objects
- Implement event-driven communication between systems
- Design for data-oriented programming (cache efficiency)
2. Memory Management
C++class MemoryPool { void* Allocate(size_t size, size_t alignment = 16); void Deallocate(void* ptr); void Reset(); // Frame-based allocation };
3. Rendering Pipeline
- Abstract graphics API (DirectX/Vulkan/OpenGL)
- Command buffer system for multi-threading
- Material system with shader hot-reloading
Recommendation▾
Include specific profiling outputs or memory layout diagrams rather than just code snippets
Examples12 / 20
Example 1: Component System Input: Actor needs physics, rendering, and audio components Output:
C++class Actor { std::vector<Component*> components; template<typename T> T* GetComponent() { for (auto comp : components) { if (auto typed = dynamic_cast<T*>(comp)) return typed; } return nullptr; } };
Example 2: Asset Pipeline Input: Load 3D model with textures and animations Output:
C++class AssetManager { std::unordered_map<std::string, std::shared_ptr<Asset>> cache; template<typename T> std::shared_ptr<T> Load(const std::string& path) { if (auto cached = cache.find(path); cached != cache.end()) { return std::static_pointer_cast<T>(cached->second); } // Load and cache new asset } };
Recommendation▾
Provide a complete minimal engine template that can be compiled and run immediately
Best Practices
Performance
- Use object pools for frequently allocated objects
- Implement frustum culling and occlusion culling
- Batch rendering calls by material/shader
- Profile with tools like Intel VTune or Superluminal
Code Organization
Engine/
├── Core/ # Math, containers, memory
├── Rendering/ # Graphics abstraction
├── Physics/ # Collision and dynamics
├── Audio/ # Sound system
├── Input/ # Controller/keyboard handling
└── Scripting/ # Lua/C# integration
Threading
- Render thread separate from game logic
- Job system for parallel task execution
- Lock-free data structures where possible
Common Pitfalls
- Don't allocate memory during gameplay loops
- Don't make everything virtual - profile first
- Don't couple systems tightly - use message passing
- Don't ignore cache misses - structure data for access patterns
- Don't optimize prematurely - measure before optimizing
- Avoid deep inheritance hierarchies in hot paths
- Never block the main thread for I/O operations