game-programming-languages
Game programming languages - C#, C++, GDScript. Learn syntax, patterns, and engine-specific idioms for professional game development.
What this skill does
# Game Programming Languages
## C# (Unity)
**Easiest to learn**, **most used for game dev**
```csharp
// ✅ Production-Ready: Unity MonoBehaviour Template
public class GameEntity : MonoBehaviour
{
[SerializeField] private float _speed = 5f;
[SerializeField] private int _health = 100;
public event Action<int> OnHealthChanged;
public event Action OnDeath;
private Rigidbody _rb;
private bool _isInitialized;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
_isInitialized = true;
}
public void TakeDamage(int amount)
{
if (!_isInitialized) return;
_health = Mathf.Max(0, _health - amount);
OnHealthChanged?.Invoke(_health);
if (_health <= 0)
OnDeath?.Invoke();
}
}
```
**Key Features:**
- Object-oriented, managed memory
- LINQ for data queries
- Coroutines for async game logic
- Events and delegates
- Garbage collection (requires optimization)
**Learning Path**: 2-3 weeks basics, 2-3 months mastery
## C++ (Unreal Engine)
**Most powerful**, **steepest learning curve**
```cpp
// ✅ Production-Ready: Unreal Actor Template
UCLASS()
class MYGAME_API AGameEntity : public AActor
{
GENERATED_BODY()
public:
AGameEntity();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Stats")
float Speed = 500.0f;
UPROPERTY(ReplicatedUsing = OnRep_Health)
int32 Health = 100;
UFUNCTION(BlueprintCallable, Category = "Combat")
void TakeDamage(int32 Amount);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHealthChanged, int32, NewHealth);
UPROPERTY(BlueprintAssignable)
FOnHealthChanged OnHealthChanged;
protected:
virtual void BeginPlay() override;
UFUNCTION()
void OnRep_Health();
};
```
**Key Features:**
- Manual memory management (smart pointers)
- Templates and STL
- Maximum performance
- Unreal reflection system (UPROPERTY, UFUNCTION)
- Blueprint integration
**Learning Path**: 4-6 weeks basics, 4-6 months proficiency
## GDScript (Godot)
**Python-like**, **easiest syntax**
```gdscript
# ✅ Production-Ready: Godot Node Template
extends CharacterBody2D
class_name GameEntity
signal health_changed(new_health: int)
signal died
@export var speed: float = 200.0
@export var max_health: int = 100
var _health: int = max_health
func _ready() -> void:
_health = max_health
func take_damage(amount: int) -> void:
_health = max(0, _health - amount)
health_changed.emit(_health)
if _health <= 0:
died.emit()
queue_free()
func _physics_process(delta: float) -> void:
var direction = Input.get_vector("left", "right", "up", "down")
velocity = direction * speed
move_and_slide()
```
**Key Features:**
- Dynamic typing with optional type hints
- Simple, Python-like syntax
- Signals for messaging
- First-class functions
- Growing ecosystem
**Learning Path**: 1-2 weeks basics, 4-8 weeks proficiency
## Language Comparison
| Feature | C# (Unity) | C++ (Unreal) | GDScript |
|---------|------------|--------------|----------|
| Memory | Managed (GC) | Manual | Managed |
| Speed | Fast | Fastest | Moderate |
| Learning | Moderate | Hard | Easy |
| Typing | Static | Static | Dynamic |
| Industry | Mobile/Indie | AAA | Indie |
## 🔧 Troubleshooting
```
┌─────────────────────────────────────────────────────────────┐
│ PROBLEM: Garbage collection spikes in C# │
├─────────────────────────────────────────────────────────────┤
│ SOLUTIONS: │
│ → Use object pooling │
│ → Avoid allocations in Update() │
│ → Cache GetComponent results │
│ → Use structs for small data │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ PROBLEM: Memory leaks in C++ │
├─────────────────────────────────────────────────────────────┤
│ SOLUTIONS: │
│ → Use TSharedPtr/TWeakPtr │
│ → UPROPERTY for UObject pointers │
│ → Run memory profiler regularly │
└─────────────────────────────────────────────────────────────┘
```
## Best Practices
| Practice | Benefit |
|----------|---------|
| Consistent naming | Readable code |
| Early returns | Reduced nesting |
| Composition over inheritance | Flexible design |
| Cache frequently used values | Performance |
---
**Use this skill**: When learning game programming languages or optimizing code.
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.