Game Developer

作者 jeffallan1be15d8064f8MIT11K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 天前更新

Use when building game systems, implementing Unity/Unreal Engine features, or optimizing game performance. Invoke to implement ECS architecture, configure physics systems and colliders, set up multiplayer networking with lag compensation, optimize frame rates to 60+ FPS targets, develop shaders, or apply game design patterns such as object pooling and state machines. Trigger keywords: Unity, Unreal Engine, game development, ECS architecture, game physics, multiplayer networking, game optimization, shader programming, game AI.

AI 產生的概覽

指導 Unity 與 Unreal 遊戲系統的實作,涵蓋 ECS、物理、網路、著色器與效能最佳化。

功能
此技能為 Unity 和 Unreal Engine 的遊戲開發提供實作指引,涵蓋 ECS 架構、物理與碰撞體、具延遲補償的多人網路、著色器開發,以及以 60+ FPS 為目標的效能最佳化。它也提供關於 Unity 模式、Unreal C++、ECS 模式、效能最佳化與多人網路的參考文件,並產出以程式碼為主的成果,例如系統實作、資料結構與最佳化說明。
適用情境
在建構遊戲系統或實作 Unity、Unreal Engine 功能時使用。適合涉及 ECS 架構、遊戲物理、多人網路、著色器程式設計、遊戲 AI 或畫面更新率與記憶體最佳化的任務。
執行需求
不隨附指令碼,僅有指示與參考文件。指引內容預設在 Unity 或 Unreal Engine 環境中作業,並提及使用 Unity Profiler 或 Unreal Insights 等效能分析工具進行驗證。

Game Developer

Core Workflow

  1. Analyze requirements — Identify genre, platforms, performance targets, multiplayer needs
  2. Design architecture — Plan ECS/component systems, optimize for target platforms
  3. Implement — Build core mechanics, graphics, physics, AI, networking
  4. Optimize — Profile and optimize for 60+ FPS, minimize memory/battery usage
    • ✅ Validation checkpoint: Run Unity Profiler or Unreal Insights; verify frame time ≤16 ms (60 FPS) before proceeding. Identify and resolve CPU/GPU bottlenecks iteratively.
  5. Test — Cross-platform testing, performance validation, multiplayer stress tests
    • ✅ Validation checkpoint: Confirm stable frame rate under stress load; run multiplayer latency/desync tests before shipping.

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Unity Developmentreferences/unity-patterns.mdUnity C#, MonoBehaviour, Scriptable Objects
Unreal Developmentreferences/unreal-cpp.mdUnreal C++, Blueprints, Actor components
ECS & Patternsreferences/ecs-patterns.mdEntity Component System, game patterns
Performancereferences/performance-optimization.mdFPS optimization, profiling, memory
Networkingreferences/multiplayer-networking.mdMultiplayer, client-server, lag compensation

Constraints

MUST DO

  • Target 60+ FPS on all platforms
  • Use object pooling for frequent instantiation
  • Implement LOD systems for optimization
  • Profile performance regularly (CPU, GPU, memory)
  • Use async loading for resources
  • Implement proper state machines for game logic
  • Cache component references (avoid GetComponent in Update)
  • Use delta time for frame-independent movement

MUST NOT DO

  • Instantiate/Destroy in tight loops or Update()
  • Skip profiling and performance testing
  • Use string comparisons for tags (use CompareTag)
  • Allocate memory in Update/FixedUpdate loops
  • Ignore platform-specific constraints (mobile, console)
  • Use Find methods in Update loops
  • Hardcode game values (use ScriptableObjects/data files)

Output Templates

When implementing game features, provide:

  1. Core system implementation (ECS component, MonoBehaviour, or Actor)
  2. Associated data structures (ScriptableObjects, structs, configs)
  3. Performance considerations and optimizations
  4. Brief explanation of architecture decisions

Key Code Patterns

Object Pooling (Unity C#)

csharp
public class ObjectPool<T> where T : Component{    private readonly Queue<T> _pool = new();    private readonly T _prefab;    private readonly Transform _parent;
    public ObjectPool(T prefab, int initialSize, Transform parent = null)    {        _prefab = prefab;        _parent = parent;        for (int i = 0; i < initialSize; i++)            Release(Create());    }
    public T Get()    {        T obj = _pool.Count > 0 ? _pool.Dequeue() : Create();        obj.gameObject.SetActive(true);        return obj;    }
    public void Release(T obj)    {        obj.gameObject.SetActive(false);        _pool.Enqueue(obj);    }
    private T Create() => Object.Instantiate(_prefab, _parent);}

Component Caching (Unity C#)

csharp
public class PlayerController : MonoBehaviour{    // Cache all component references in Awake — never call GetComponent in Update    private Rigidbody _rb;    private Animator _animator;    private PlayerInput _input;
    private void Awake()    {        _rb = GetComponent<Rigidbody>();        _animator = GetComponent<Animator>();        _input = GetComponent<PlayerInput>();    }
    private void FixedUpdate()    {        // Use cached references; use deltaTime for frame-independence        Vector3 move = _input.MoveDirection * (speed * Time.fixedDeltaTime);        _rb.MovePosition(_rb.position + move);    }}

State Machine (Unity C#)

csharp
public abstract class State{    public abstract void Enter();    public abstract void Tick(float deltaTime);    public abstract void Exit();}
public class StateMachine{    private State _current;
    public void TransitionTo(State next)    {        _current?.Exit();        _current = next;        _current.Enter();    }
    public void Tick(float deltaTime) => _current?.Tick(deltaTime);}
// Usage examplepublic class IdleState : State{    private readonly Animator _animator;    public IdleState(Animator animator) => _animator = animator;    public override void Enter() => _animator.SetTrigger("Idle");    public override void Tick(float deltaTime) { /* poll transitions */ }    public override void Exit() { }}

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

來源與署名

來源:jeffallan/claude-skills位於skills/game-developer提交1be15d8

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架