# Binary Wire Contract & 5-Engine Automatic SDK Codegen

> Zero-copy little-endian binary framing, CRC32 schema_hash drift protection, OpenAPI 3.0.3, and machine-readable AI discovery endpoints.

# Binary Wire Contract & 5-Engine Automatic SDK Codegen

To eliminate JSON parsing overhead inside fast simulation loops, Playna's Data Plane uses fixed-offset **little-endian binary frames**. Your Control Plane defines the schema once over HTTPS/OpenAPI 3.0.3, and Playna generates matching wire codecs for five engines.

## Core Frame Opcodes

- **`0x50–0x5F`:** Managed ECS component replication, delta snapshots, and client `ACK`.
- **`0x61` / `0x20`:** `swept_ccd` impulse command & continuous trajectory keyframes.
- **`0x62`:** `ballistics` parametric shot, impact position, and target ring score.
- **`0x63`:** `rigid_body` clamped 3D impulse and sub-stepped transform frame.
- **`0x64`:** `kinematic_ecs` sequenced wish-velocity and arena-clamped position frame.
- **`0x65`:** `granular_particle` grid brush input and sparse cell diff frame.
- **`0x66`:** `turn_based` `active_slot` and monotonic `turn_seq` move commit frame.

## Supported Codegen Engines (`/v1/ecs/schemas/{id}/codegen/{engine}`)

- `web`: ES2022 TypeScript zero-copy `DataView` codecs + `PHYSICS_RUNTIME_GUIDE`.
- `godot`: Godot 4.7.2 `StreamPeerBuffer` `.gd` classes.
- `unity`: Unity 6 DOTS `IComponentData` + `BinaryPrimitives` `.cs` structs.
- `unreal`: Unreal Engine 5.3 `FMassFragment` `.h` headers.
- `bevy`: Bevy 0.15 `Component` + `mod.rs` Rust modules.

## Discovery Endpoints for Search Engines & AI Agents

- **`/llms.txt`** & **`/llms-full.txt`**: Standard AI assistant index and complete clean Markdown corpus.
- **`/*.md`**: Direct clean Markdown URLs for every Wiki guide and Blog post (`/wiki/physics.md`, `/blog/<slug>.md`).
- **`/openapi.json`** & **`/docs`**: Interactive OpenAPI 3.0.3 spec & Swagger playground.
- **`/sitemap.xml`** & **`/rss.xml`**: XML Sitemap and RSS 2.0 feed.

---

# İkili Protokol (Wire Contract) ve 5 Motor İçin Otomatik SDK Üretimi

# İkili Protokol & 5 Motor SDK Üretimi

Playna veri düzlemi JSON serileştirme maliyetinden kaçınmak için sabit ofsetli **little-endian ikili çerçeveler** kullanır. Kontrol düzlemi OpenAPI 3.0.3 (`HTTPS`) ile yönetilir; veri düzlemi ise yayınlanan şemadan üretilen istemci dosyalarıyla konuşur.

## Sabit Çerçeve Özeti

- **`0x50–0x5F`:** Yönetilen ECS bileşen güncellemeleri, delta snapshot ve onay (`ACK`).
- **`0x61` / `0x20`:** `swept_ccd` anlık vuruş & tam çarpışma yörüngesi.
- **`0x62`:** `ballistics` parametrik atış, uçuş ve hedef skoru.
- **`0x63`:** `rigid_body` 3D kuvvet/impulse ve alt-adımlı transform karesi.
- **`0x64`:** `kinematic_ecs` sıralı wish-velocity ve pozisyon karesi.
- **`0x65`:** `granular_particle` grid hücre fırçası ve seyrek hücre diffi.
- **`0x66`:** `turn_based` aktif slot ve `turn_seq` korumalı sıra hakemi.

## Üretilen Hedef Motorlar (`/v1/ecs/schemas/{id}/codegen/{engine}`)

- `web`: Sıfır-kopya `DataView` kullanan ES2022 TypeScript istemcisi + `PHYSICS_RUNTIME_GUIDE`.
- `godot`: Godot 4.7.2 için `StreamPeerBuffer` tabanlı `.gd` sınıfları.
- `unity`: Unity 6 DOTS `IComponentData` + `BinaryPrimitives` `.cs` yapıları.
- `unreal`: Unreal Engine 5.3 `FMassFragment` `.h` başlıkları.
- `bevy`: Bevy 0.15 `Component` + `mod.rs` Rust modülleri.

## Arama Motorları ve Yapay Zeka Ajanları İçin Açık Uçlar

- **`/llms.txt`** & **`/llms-full.txt`**: LLM ajanları ve AI kod asistanları için yapılandırılmış Markdown dokümantasyon indeksi.
- **`/*.md`**: Her Wiki ve Blog sayfasının ham `.md` kaynağı (`/wiki/physics.md`, `/blog/<slug>.md`).
- **`/openapi.json`** & **`/docs`**: Tam Control Plane OpenAPI 3.0.3 şeması ve Swagger UI.
- **`/sitemap.xml`** & **`/rss.xml`**: Arama motoru ve RSS okuyucu beslemeleri.
