# Stop Rewriting Game Backends: 6 Pluggable Solvers & Hybrid Physics Composition

*Published: 2026-11-15 | Category: Core Architecture*

A multiplayer platform built to host thousands of games cannot afford bespoke backend rewrites per title. Playna separates room orchestration and simulation into **6 standalone game-agnostic physics and turn-arbiter modules**.

## 1. Matching Server CPU to Game Dynamics

Ticking an idle pool table or chess board at 60 Hz wastes server resources.

- **`swept_ccd` (`0x61`)**: Solves the entire continuous collision chain once per impulse and broadcasts keyframes with zero idle tick overhead.
- **`turn_based` (`0x66`)**: Idles at **0 Hz** for Chess, Checkers, Card Games, and Sudoku, awakening strictly to verify `active_slot` and `turn_seq`.
- **`kinematic_ecs` (`0x64`) & `rigid_body` (`0x63`)**: Deliver 60–128 Hz sub-stepped simulation, movement bounds, and rewind history for fast shooters and physics brawlers.

Every generated SDK embeds `PHYSICS_RUNTIME_GUIDE` for **TypeScript, Godot 4.7.2, Unity, Unreal, and Bevy**, documenting the exact client rendering loop for the selected physics profile.

## 2. Running Hybrid Solvers Inside One Room

A tactical shooter walks on `kinematic_ecs` while arcing grenades on `ballistics`; turn-based golf gates turns with `turn_based` while computing trajectories with `ballistics`.

```json
{
  "simulation": "kinematic_ecs",
  "secondary_providers": ["ballistics"],
  "capabilities": ["lag_compensation"],
  "tick_rate_hz": 64,
  "params": {
    "max_speed_mps": 12.0,
    "gravity_mps2": 9.81,
    "aoi_radius_m": 120.0
  }
}
```

> Schema validation automatically enforces safe composition rules and rejects redundant pairs such as `swept_ccd + lag_compensation` or `turn_based + rollback`.

---

# Her Oyun İçin Backend Değiştirmeye Son: 6 Tak-Çalıştır Fizik Çözücüsü ve Hibrit Kombinasyonlar

Bir multiplayer altyapısı binlerce farklı oyun türünü barındıracaksa, her yeni oyun eklendiğinde sunucu tarafında özel oyun kodu yazmak sürdürülebilir değildir. Playna’da kontrol ve veri düzlemini oyun kurallarından tamamen ayırıp **6 bağımsız tak-çalıştır fizik/simülasyon modülüne** böldük.

## 1. Veri Düzlemi CPU’sunu Oyunun Dinamiğine Göre Harcamak

Bir masa bilardosu veya satranç maçında sunucunun saniyede 60 kez boş sahneyi ticklemesi saf israftır.

- **`swept_ccd` (`0x61`)**: Yalnızca topa vurulduğu anda tüm çarpışma eğrisini tek seferde çözer ve anahtar kareleri yayınlar; boşta tick CPU maliyeti sıfırdır.
- **`turn_based` (`0x66`)**: Satranç, dama, okey ve sudoku gibi oyunlar için **0 Hz** ile bekler; yalnızca aktif oyuncunun hamlesinde `active_slot` ve `turn_seq` doğrulaması yapar.
- **`kinematic_ecs` (`0x64`) & `rigid_body` (`0x63`)**: Aksiyon FPS ve fizik arenaları için 60–128 Hz alt-adımlı simülasyon, hız sınırı koruması ve geçmiş tarih tamponu sunar.

Hangi çözücüyü seçtiğinizde istemcinizin sahneyi nasıl render edeceği, ECS Codegen ile doğrudan **TypeScript, Godot 4.7.2, Unity, Unreal ve Bevy** kodunuza `PHYSICS_RUNTIME_GUIDE` olarak eklenir.

## 2. Birden Fazla Fiziğin Aynı Odada Birleşmesi

Gerçek oyunlar çoğu zaman tek bir fizik tipine sığmaz. Örneğin bir Battle Royale oyununda oyuncu yürümesi `kinematic_ecs` ile, el bombası veya düşüşlü keskin nişancı mermisi `ballistics` ile çalışır. Sıra tabanlı bir golf oyununda ise sıra kontrolü `turn_based` üzerindeyken atış anında `ballistics` devreye girer.

```json
{
  "simulation": "kinematic_ecs",
  "secondary_providers": ["ballistics"],
  "capabilities": ["lag_compensation"],
  "tick_rate_hz": 64,
  "params": {
    "max_speed_mps": 12.0,
    "gravity_mps2": 9.81,
    "aoi_radius_m": 120.0
  }
}
```

> Şema doğrulama aşamasında yalnızca uyumlu hibrit çiftlere izin verilir; gereksiz/çelişkili kombinasyonlar (`swept_ccd + lag_compensation` veya `turn_based + rollback`) üretim ortamına çıkmadan engellenir.
