game-development
Game development with Unity, Unreal Engine, and Godot. Use when building games, implementing game mechanics, physics, AI, or working with game engines.
What this skill does
# Game Development
Comprehensive guide for building games across major engines and platforms.
## Engine Comparison
| Engine | Language | Best For | Platforms |
| ---------- | --------------- | ----------------------- | --------- |
| **Unity** | C# | Mobile, indie, VR/AR | All |
| **Unreal** | C++, Blueprints | AAA, realistic graphics | All |
| **Godot** | GDScript, C# | 2D, indie, open source | All |
---
## Unity (C#)
### Project Structure
```
Assets/
├── Scripts/
│ ├── Player/
│ │ ├── PlayerController.cs
│ │ └── PlayerInput.cs
│ ├── Enemies/
│ ├── Systems/
│ └── Utils/
├── Prefabs/
├── Scenes/
├── Materials/
├── Animations/
└── Resources/
```
### Player Controller
```csharp
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(CharacterController))]
public class PlayerController : MonoBehaviour
{
[Header("Movement")]
[SerializeField] private float moveSpeed = 5f;
[SerializeField] private float sprintMultiplier = 1.5f;
[SerializeField] private float jumpHeight = 2f;
[SerializeField] private float gravity = -9.81f;
[Header("Look")]
[SerializeField] private float lookSensitivity = 2f;
[SerializeField] private float maxLookAngle = 80f;
private CharacterController _controller;
private Vector2 _moveInput;
private Vector2 _lookInput;
private Vector3 _velocity;
private float _xRotation;
private bool _isSprinting;
private void Awake()
{
_controller = GetComponent<CharacterController>();
Cursor.lockState = CursorLockMode.Locked;
}
private void Update()
{
HandleMovement();
HandleLook();
ApplyGravity();
}
private void HandleMovement()
{
float speed = _isSprinting ? moveSpeed * sprintMultiplier : moveSpeed;
Vector3 move = transform.right * _moveInput.x + transform.forward * _moveInput.y;
_controller.Move(move * speed * Time.deltaTime);
}
private void HandleLook()
{
float mouseX = _lookInput.x * lookSensitivity * Time.deltaTime;
float mouseY = _lookInput.y * lookSensitivity * Time.deltaTime;
_xRotation -= mouseY;
_xRotation = Mathf.Clamp(_xRotation, -maxLookAngle, maxLookAngle);
Camera.main.transform.localRotation = Quaternion.Euler(_xRotation, 0f, 0f);
transform.Rotate(Vector3.up * mouseX);
}
private void ApplyGravity()
{
if (_controller.isGrounded && _velocity.y < 0)
{
_velocity.y = -2f;
}
_velocity.y += gravity * Time.deltaTime;
_controller.Move(_velocity * Time.deltaTime);
}
// Input System callbacks
public void OnMove(InputAction.CallbackContext context) =>
_moveInput = context.ReadValue<Vector2>();
public void OnLook(InputAction.CallbackContext context) =>
_lookInput = context.ReadValue<Vector2>();
public void OnJump(InputAction.CallbackContext context)
{
if (context.performed && _controller.isGrounded)
{
_velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);
}
}
public void OnSprint(InputAction.CallbackContext context) =>
_isSprinting = context.performed;
}
```
### State Machine
```csharp
public interface IState
{
void Enter();
void Update();
void Exit();
}
public class StateMachine
{
private IState _currentState;
public void ChangeState(IState newState)
{
_currentState?.Exit();
_currentState = newState;
_currentState.Enter();
}
public void Update() => _currentState?.Update();
}
// Example: Enemy AI States
public class IdleState : IState
{
private readonly EnemyAI _enemy;
public IdleState(EnemyAI enemy) => _enemy = enemy;
public void Enter() => _enemy.Animator.SetTrigger("Idle");
public void Update()
{
if (_enemy.CanSeePlayer())
{
_enemy.StateMachine.ChangeState(new ChaseState(_enemy));
}
}
public void Exit() { }
}
public class ChaseState : IState
{
private readonly EnemyAI _enemy;
public ChaseState(EnemyAI enemy) => _enemy = enemy;
public void Enter() => _enemy.Animator.SetTrigger("Run");
public void Update()
{
_enemy.NavAgent.SetDestination(_enemy.Player.position);
if (_enemy.InAttackRange())
{
_enemy.StateMachine.ChangeState(new AttackState(_enemy));
}
else if (!_enemy.CanSeePlayer())
{
_enemy.StateMachine.ChangeState(new IdleState(_enemy));
}
}
public void Exit() { }
}
```
### Object Pooling
```csharp
public class ObjectPool<T> where T : Component
{
private readonly T _prefab;
private readonly Transform _parent;
private readonly Queue<T> _pool = new();
public ObjectPool(T prefab, int initialSize, Transform parent = null)
{
_prefab = prefab;
_parent = parent;
for (int i = 0; i < initialSize; i++)
{
CreateInstance();
}
}
public T Get()
{
if (_pool.Count == 0) CreateInstance();
T obj = _pool.Dequeue();
obj.gameObject.SetActive(true);
return obj;
}
public void Return(T obj)
{
obj.gameObject.SetActive(false);
_pool.Enqueue(obj);
}
private void CreateInstance()
{
T obj = Object.Instantiate(_prefab, _parent);
obj.gameObject.SetActive(false);
_pool.Enqueue(obj);
}
}
```
---
## Unreal Engine (C++)
### Actor Component
```cpp
// PlayerMovementComponent.h
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "PlayerMovementComponent.generated.h"
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class MYGAME_API UPlayerMovementComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPlayerMovementComponent();
virtual void TickComponent(float DeltaTime, ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction) override;
UFUNCTION(BlueprintCallable, Category = "Movement")
void Move(FVector2D Input);
UFUNCTION(BlueprintCallable, Category = "Movement")
void Jump();
protected:
virtual void BeginPlay() override;
private:
UPROPERTY(EditAnywhere, Category = "Movement")
float MoveSpeed = 600.0f;
UPROPERTY(EditAnywhere, Category = "Movement")
float JumpForce = 400.0f;
UPROPERTY()
class UCharacterMovementComponent* MovementComponent;
};
// PlayerMovementComponent.cpp
#include "PlayerMovementComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
UPlayerMovementComponent::UPlayerMovementComponent()
{
PrimaryComponentTick.bCanEverTick = true;
}
void UPlayerMovementComponent::BeginPlay()
{
Super::BeginPlay();
if (ACharacter* Owner = Cast<ACharacter>(GetOwner()))
{
MovementComponent = Owner->GetCharacterMovement();
}
}
void UPlayerMovementComponent::Move(FVector2D Input)
{
if (!MovementComponent) return;
FVector Forward = GetOwner()->GetActorForwardVector();
FVector Right = GetOwner()->GetActorRightVector();
FVector Direction = (Forward * Input.Y + Right * Input.X).GetSafeNormal();
MovementComponent->AddInputVector(Direction * MoveSpeed);
}
void UPlayerMovementComponent::Jump()
{
if (ACharacter* Character = Cast<ACharacter>(GetOwner()))
{
Character->Jump();
}
}
```
### Gameplay Ability System (GAS)
```cpp
// MyGameplayAbility.h
#pragma once
#include "Abilities/GameplayAbility.h"
#include "MyGameplayAbility.generated.h"
UCLASS()
class MYGAME_API UMyGameplayAbility : public UGameplayAbility
{
GENERATED_BODY()
public:
UMyGameplayAbility();
virtual void ActivateAbility(const FGameplayAbilitySpecHandle Handle,
const FGameplayAbilityActorInfo* ActorInfo,
const FGameplayAbilityActivationInfo ActivationInfo,
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.