Platform Architecture: Game-Agnostic Control & Data Plane
Explore how Playna cleanly separates authentication and lobby governance (Control Plane) from the strict TLS 1.3 binary Data Plane and 6 pluggable physics solvers.
Game-Agnostic Multiplayer Infrastructure
Traditional multiplayer backends force studios to rewrite rooms, authentication, anti-cheat bounds, turn fencing, and simulation math for every new title. **Playna** separates infrastructure into two strict layers configured by schema:
- **Control Plane (`HTTPS / REST / OAuth2 PKCE / Ed25519`):** Multi-tenant scopes (`gam_*`), lobby/matchmaking coordination, API keys, and ECS schema governance.
- **Data Plane (`QUIC / HTTP/3 WebTransport / WSS / Raw TLS-DTLS`):** Binary packet framing, speed/sequence anti-cheat validation, AOI delta replication, and pluggable physics solvers.
Zero-Plaintext Standard (Strict TLS 1.3)
Plain HTTP (`http://`) and unencrypted WebSockets (`ws://`) are strictly disabled across every edge listener:
| Transport Channel | Best For | Encryption |
| **HTTP/3 WebTransport** | Browser & ultra-low-latency datagram loops | TLS 1.3 UDP/QUIC |
| **Secure WebSockets (WSS)** | Universal browser & enterprise firewall traversal | TLS 1.3 TCP |
| **QUIC Streams & Datagrams** | Native mobile & desktop engines | TLS 1.3 + ALPN |
| **Raw TLS TCP / DTLS UDP** | Custom Godot, Unity, Unreal, Bevy sockets | TLS 1.3 / DTLS |
Multi-Engine ECS Codegen
Every published ECS schema locks a deterministic CRC32 **`schema_hash`** and emits ready-to-compile binary codecs alongside **`PHYSICS_RUNTIME_GUIDE`** (`TypeScript`, `Godot 4.7.2`, `Unity C#`, `Unreal C++`, `Bevy Rust`).
The 6 Pluggable Physics & Simulation Solvers (0x61–0x66)
Complete specification of Playna's 6 standalone simulation modules covering opcodes, data-plane tick CPU, transport hints, and client rendering patterns.
The 6 Pluggable Physics & Simulation Solvers
Playna exposes **6 standalone game-agnostic simulation modules**. Studios select their solver inside the ECS schema without touching backend server code.
| Provider | Opcode | Tick / CPU Profile | Recommended Channel | Example Genres |
| **`swept_ccd`** | `0x61` / `0x20` | Solve on shot · 0 idle CPU | Stream (>1200B) / Datagram | Billiards, Carom, Air Hockey |
| **`ballistics`** | `0x62` | 30 Hz / Shot evaluation | Datagram / Stream | Archery, Artillery, Grenades |
| **`rigid_body`** | `0x63` | 60 Hz · 4x Sub-stepping | HTTP/3 WT Datagram / WSS | Vehicle Soccer, Brawlers |
| **`kinematic_ecs`** | `0x64` | 30 / 64 / 128 Hz | HTTP/3 WT / WSS / UDP | FPS, MOBA, Battle Royale |
| **`granular_particle`** | `0x65` | 30 Hz · Sparse diffs | Datagram / WSS | Falling Sand, Fluids, Voxels |
| **`turn_based`** | `0x66` | **0 Hz** (Strict per-move) | Reliable Ordered Stream | Chess, Checkers, Cards, Sudoku |
Client Scene Rendering Rules
- **`swept_ccd` (`0x61`):** Submit one impulse command; interpolate streamed collision keyframes and commit final positions strictly on shot completion.
- **`ballistics` (`0x62`):** Render local projectile arcs from schema wind/gravity constants and reconcile authoritative impact/score frames.
- **`rigid_body` (`0x63`):** Stream clamped 3D forces and smooth 60 Hz entity snapshots via a short interpolation buffer.
- **`kinematic_ecs` (`0x64`):** Run responsive client locomotion prediction bounded by `max_speed_mps`, paired with server `T - RTT/2` hitscan checks.
- **`granular_particle` (`0x65`):** Upload incoming sparse `(x, y, kind)` cells directly to an instanced mesh or GPU data texture.
- **`turn_based` (`0x66`):** Zero tick traffic while waiting; unlock inputs strictly when `active_slot === mySlot` and enforce monotonic `turn_seq`.
Multi-Physics & Hybrid Composition (secondary_providers)
Rules for composing primary and secondary physics solvers inside one match room, plus forbidden redundant pairs.
Multi-Physics & Hybrid Composition
Complex multiplayer games frequently require character locomotion alongside projectile arcs or dynamic props. By declaring **`secondary_providers`** in your ECS schema, Playna routes binary commands by opcode (`0x61..0x66`) cleanly across compatible modules in the same room.
Supported Hybrid Matrix
| Primary (`simulation`) | Allowed `secondary_providers` | Recommended Capabilities & AOI | Typical Genres |
| **`kinematic_ecs`** | `ballistics`, `rigid_body`, `granular_particle` | `lag_compensation` / `rollback` + `aoi` | Battle Royale, Hero Shooters, Sandbox Brawlers |
| **`rigid_body`** | `ballistics`, `swept_ccd` | `rollback` | Tank Duels, Naval Combat, Physics Vehicles |
| **`turn_based`** | `swept_ccd`, `ballistics` | None (Strict Serialized) | Turn-Based Billiards, Golf, Artillery PvP |
Sample Hybrid Schema (FPS Move + Ballistic Shoot + AOI)
{
"name": "HybridFpsBallistics",
"publish": true,
"physics": {
"simulation": "kinematic_ecs",
"secondary_providers": ["ballistics"],
"capabilities": ["lag_compensation"],
"tick_rate_hz": 64,
"history_depth_ticks": 64,
"params": {
"max_speed_mps": 12.0,
"gravity_mps2": 9.81,
"aoi_radius_m": 120.0
}
}
}
Rejected Combinations
- **`swept_ccd` + `lag_compensation`:** Analytical trajectories resolve exact continuous collisions once per impulse (`incompatible_capability`).
- **`turn_based` + `rollback` / `lag_compensation`:** Turn-fenced commands require no speculative rewind.
- **`turn_based` + `granular_particle`:** Continuous cellular grid stepping conflicts with zero-CPU idle turn games.
AOI Spatial Filtering, Move + Shoot Separation & Entity LERP
How Area of Interest (AOI) reduces bandwidth, how Move separates from Hitscan/Ballistic Shoot, and how clients interpolate discrete server snapshots.
AOI Spatial Filtering, Move + Shoot & Entity Interpolation
Spatial visibility and step validation live in Playna's replication layer rather than inside one hardcoded game loop, allowing AOI to protect bandwidth across shooters, MMORPGs, and physics arenas.
1. Area of Interest (`visibility: "aoi"`)
Marking a component with `visibility: "aoi"` filters outgoing delta snapshots per recipient by `aoi_radius`:
- Out-of-range entity states stay off the wire → **significantly lower bandwidth**.
- Remote enemy positions outside interest range never reach client memory → **blocks radar/map hacks**.
- Server-side `max_step_distance` bounds reject unauthorized teleportation deltas.
2. How Move and Shoot Compose
- **Move (Locomotion, Speed Bounds & AOI):** Handled by **`kinematic_ecs` (`0x64`)**.
- **Shoot — Hitscan (Instant Ray Weapons):** Resolved inside `kinematic_ecs` + `lag_compensation` by rewinding target spheres in the history ring buffer to `T - RTT/2` and testing 3D ray-sphere intersection.
- **Shoot — Projectiles (Gravity/Wind Arrows & Shells):** Movement stays on `kinematic_ecs` while fire commands dispatch to secondary **`ballistics` (`0x62`)**.
3. Smooth Scene Rendering: Entity LERP & SLERP
Because servers snapshot at 20–60 Hz while clients render at 60–240 Hz, client scenes render remote entities slightly behind live time inside an interpolation buffer:
- `t_render = t_client_now - t_interpolation_delay` (`1.5 ~ 2.0 * dt_tick + jitter_ms`)
- `alpha = clamp((t_render - t_prev) / (t_next - t_prev), 0.0, 1.0)`
- Position: `P(t) = lerp(P_prev, P_next, alpha)`
- Rotation: `R(t) = slerp(R_prev, R_next, alpha)`
- Brief packet loss triggers velocity-clamped Dead Reckoning (`<= 100 ms`) blended smoothly on arrival of the next authoritative snapshot.
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.