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 从公开仓库中收录这些内容。

举报或申请下架