Claude
Skills
Sign in
Back

game-engines

Included with Lifetime
$97 forever

Master game engines - Unity, Unreal Engine, Godot. Engine-specific workflows, systems architecture, and production best practices.

Generalscriptsassets

What this skill does


# Game Engines & Frameworks

## Engine Comparison

```
┌─────────────────────────────────────────────────────────────┐
│                    ENGINE COMPARISON                         │
├─────────────────────────────────────────────────────────────┤
│  UNITY (C#):                                                 │
│  ├─ Best for: 2D/3D, Mobile, Indie, VR/AR                  │
│  ├─ Learning: Moderate                                      │
│  ├─ Performance: Good (IL2CPP for native)                  │
│  └─ Market: 70%+ of mobile games                           │
│                                                              │
│  UNREAL (C++/Blueprints):                                    │
│  ├─ Best for: AAA, High-end graphics, Large teams          │
│  ├─ Learning: Steep (C++) / Easy (Blueprints)              │
│  ├─ Performance: Excellent                                  │
│  └─ Market: Major console/PC titles                        │
│                                                              │
│  GODOT (GDScript/C#):                                        │
│  ├─ Best for: 2D games, Learning, Open source              │
│  ├─ Learning: Easy                                          │
│  ├─ Performance: Good for 2D, Improving for 3D             │
│  └─ Market: Growing indie scene                            │
└─────────────────────────────────────────────────────────────┘
```

## Unity Architecture

```
UNITY COMPONENT SYSTEM:
┌─────────────────────────────────────────────────────────────┐
│  GameObject                                                  │
│  ├─ Transform (required)                                    │
│  ├─ Renderer (MeshRenderer, SpriteRenderer)                │
│  ├─ Collider (BoxCollider, CapsuleCollider)                │
│  ├─ Rigidbody (physics simulation)                         │
│  └─ Custom MonoBehaviour scripts                           │
│                                                              │
│  LIFECYCLE:                                                  │
│  Awake() → OnEnable() → Start() → FixedUpdate() →          │
│  Update() → LateUpdate() → OnDisable() → OnDestroy()       │
└─────────────────────────────────────────────────────────────┘
```

```csharp
// ✅ Production-Ready: Unity Component Pattern
public class PlayerController : MonoBehaviour
{
    [Header("Movement Settings")]
    [SerializeField] private float moveSpeed = 5f;
    [SerializeField] private float jumpForce = 10f;

    [Header("Ground Check")]
    [SerializeField] private Transform groundCheck;
    [SerializeField] private float groundRadius = 0.2f;
    [SerializeField] private LayerMask groundLayer;

    private Rigidbody2D _rb;
    private bool _isGrounded;
    private float _horizontalInput;

    // Cache components in Awake
    private void Awake()
    {
        _rb = GetComponent<Rigidbody2D>();
    }

    private void Update()
    {
        // Input in Update (frame-rate independent)
        _horizontalInput = Input.GetAxisRaw("Horizontal");

        if (Input.GetButtonDown("Jump") && _isGrounded)
        {
            Jump();
        }
    }

    private void FixedUpdate()
    {
        // Physics in FixedUpdate (consistent timing)
        CheckGround();
        Move();
    }

    private void CheckGround()
    {
        _isGrounded = Physics2D.OverlapCircle(
            groundCheck.position, groundRadius, groundLayer);
    }

    private void Move()
    {
        _rb.velocity = new Vector2(
            _horizontalInput * moveSpeed,
            _rb.velocity.y);
    }

    private void Jump()
    {
        _rb.velocity = new Vector2(_rb.velocity.x, jumpForce);
    }
}
```

## Unreal Engine Architecture

```
UNREAL ACTOR SYSTEM:
┌─────────────────────────────────────────────────────────────┐
│  AActor (Base class for all game objects)                   │
│  ├─ APawn (Can be possessed by controller)                 │
│  │   └─ ACharacter (Has CharacterMovementComponent)        │
│  ├─ AGameMode (Game rules)                                 │
│  └─ APlayerController (Player input handling)              │
│                                                              │
│  COMPONENTS:                                                 │
│  ├─ USceneComponent (Transform hierarchy)                  │
│  ├─ UStaticMeshComponent (3D model)                        │
│  ├─ UCapsuleComponent (Collision)                          │
│  └─ UCharacterMovementComponent (Movement logic)           │
│                                                              │
│  LIFECYCLE:                                                  │
│  Constructor → BeginPlay() → Tick() → EndPlay()            │
└─────────────────────────────────────────────────────────────┘
```

```cpp
// ✅ Production-Ready: Unreal Character
UCLASS()
class MYGAME_API AMyCharacter : public ACharacter
{
    GENERATED_BODY()

public:
    AMyCharacter();

    virtual void BeginPlay() override;
    virtual void Tick(float DeltaTime) override;
    virtual void SetupPlayerInputComponent(
        UInputComponent* PlayerInputComponent) override;

protected:
    UPROPERTY(EditAnywhere, Category = "Movement")
    float WalkSpeed = 600.0f;

    UPROPERTY(EditAnywhere, Category = "Movement")
    float SprintSpeed = 1200.0f;

    UPROPERTY(EditAnywhere, Category = "Combat")
    float MaxHealth = 100.0f;

private:
    UPROPERTY()
    float CurrentHealth;

    bool bIsSprinting;

    void MoveForward(float Value);
    void MoveRight(float Value);
    void StartSprint();
    void StopSprint();

    UFUNCTION()
    void OnTakeDamage(float Damage, AActor* DamageCauser);
};

// Implementation
void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();
    CurrentHealth = MaxHealth;
    GetCharacterMovement()->MaxWalkSpeed = WalkSpeed;
}

void AMyCharacter::SetupPlayerInputComponent(
    UInputComponent* PlayerInputComponent)
{
    Super::SetupPlayerInputComponent(PlayerInputComponent);

    PlayerInputComponent->BindAxis("MoveForward", this,
        &AMyCharacter::MoveForward);
    PlayerInputComponent->BindAxis("MoveRight", this,
        &AMyCharacter::MoveRight);
    PlayerInputComponent->BindAction("Sprint", IE_Pressed, this,
        &AMyCharacter::StartSprint);
    PlayerInputComponent->BindAction("Sprint", IE_Released, this,
        &AMyCharacter::StopSprint);
}
```

## Godot Architecture

```
GODOT NODE SYSTEM:
┌─────────────────────────────────────────────────────────────┐
│  Node (Base class)                                           │
│  ├─ Node2D (2D game objects)                                │
│  │   ├─ Sprite2D                                            │
│  │   ├─ CharacterBody2D                                     │
│  │   └─ Area2D                                              │
│  ├─ Node3D (3D game objects)                                │
│  │   ├─ MeshInstance3D                                      │
│  │   ├─ CharacterBody3D                                     │
│  │   └─ Area3D                                              │
│  └─ Control (UI elements)                                   │
│                                                              │
│  LIFECYCLE:                                                  │
│  _init() → _ready() → _process() / _physics_process()      │
│                                                              │
│  SIGNALS (Event System):                                     │
│  signal hit(damage)                                         │
│  emit_signal("hit", 10)                                     │
│  connect("hit", target, "_on_hit")                          │
└─────────────────────────────────────────────────────────────┘
```

```gdscript
# ✅ Production-Ready: Godot Player Controller
extends CharacterBody2D

class_name Player

signal health_changed(new_health, max_health)
signal died()

@export var move_speed: float = 200.0
@export var jump_force: float = 400.0
@export var max_health: int = 100

@onready var sprite: Sprite2D = $Sprite2D
@onready var animation: Animati

Related in General