# SpriteDX - Playground - Multiplayer Design v0.1

This document will discuss how to implement playground system that allows for network based games.

## Vision

Build a minimal, session-based shared world where players coexist in real time — move, collide, emote, and interact — with FPS-grade responsiveness, near-zero idle cost, and an architecture so clean it feels *inevitable*.

## Motivation

Most multiplayer system fail one of three ways:

1. Overbuilt
    
2. Over-managed
    
3. Over-locked
    

As a single-person startup, the goal is to design a system that:

* Scales down better than it scales up
    
* It understandable in one sitting
    
* Can be abandoned for months and restarted cleanly
    
* Feels elegant rather than clever
    

## Core Goals

1. Real-time coexistence  
    FPS-style movement and interactions  
    Server-authoritative  
    4-16 players per session
    
2. Scale-to-zero cost  
    No idle compute  
    No permanent game servers  
    Pay only while a session is alive
    
3. 10-year survivability  
    Open protocols  
    portable infra  
    No black-box multiplayer SDKs
    
4. Solo-founder operability  
    Few moving parts  
    Easy debugging  
    clear failure modes
    
5. Character-first  
    Characters are external data (SpriteDX)
    

## Non-Goals

* No persistent world state
    
* No economy
    
* No MMO scaling
    
* No kernel anti-cheat
    
* No platform lock-in wars
    

## High-Level Architecture

```plaintext
   [Browser Client (Unity WebGL)]
                |
                | WebRTC / UDP-like Transport
                |
  [Ephemeral Authoritative Game Server]
                |
  [Control Plane (Matchmaking + Auth)]
                |
  [Asset/CDN (SpriteDX Characters)] 
```

## Technical Decisions

### Client

* Unity WebGL
    
* Client-side predictions + reconciliation
    
* Characters loaded dynamically via manifest
    

### Networking

* WebRTC DataChannels
    
    * Browser-safe
        
    * UDP semantics
        
    * NAT traversal handled
        
* 30-60 Hz tick
    

### Game Server

* Authoritative
    
* Stateless per match
    
* Runs physics + hit validation
    
* Lifespan = session duration
    

### Hosting Model

* Ephemeral compute
    
    * Spins up on match start
        
    * Destroy on match end
        
* No always-on instances
    

### Control Plane

* Simple HTTP / WebSocket service
    
* Matchmaking
    
* Session orchastration
    
* Can live on:
    
    * Cloudflare Workers
        
    * Any boring backend
        

## Character Model

```json
{
  "characterId": "spritedx:pixel_042",
  "animations": {
    "idle": "idle.webp",
    "run": "run.webp",
    "jump": "jump.webp"
  },
  "hitbox": { "w": 0.6, "h": 1.8 },
  "scale": 1.0
}
```

* Hot-loadable
    
* Cacheable
    
* Portable across worlds
    
* Identity follows the character
    

This is the emotional core.

— Pixel
