v0.0.2
Release Notes for v0.0.2
🎮 New Features
Network Layer (Major Addition)
-
ServerNetwork & ClientNetwork: Complete transport-agnostic client/server abstractions for multiplayer games
- Per-peer snapshot registries for fog of war and interest management
- Built-in heartbeat mechanism for connection health monitoring
- Automatic bandwidth optimization through delta detection
- Transport-agnostic design (works with WebSocket, WebRTC, UDP, etc.)
-
Transport Adapters:
BunWebSocketServerTransport: Production-ready Bun WebSocket server adapterBrowserWebSocketClientTransport: Browser WebSocket client adapter- Pluggable transport interface for custom implementations
-
Multiplayer Game Example: Complete working example demonstrating:
- Client-side prediction with server reconciliation
- Binary protocol with efficient encoding
- Multiple concurrent players
- Fixed tick rate simulation (20 TPS)
Protocol Enhancements
- defineIntent Helper: Type-safe intent definition with automatic codec generation
- Intent Change Detection: Automatic optimization to only send changed intents, reducing bandwidth
- Client Tick Tracking: Server tracks client tick for accurate reconciliation
- Global Intent Handlers: Server-side handlers for processing client intents
Codec Improvements
- Array Support:
PooledCodec.array()for efficient snapshot encoding of collections - Zero-Copy Operations:
calculateSize()andencodeInto()methods for minimal allocations - Enhanced SnapshotRegistry: Zero-copy encoding and decoding support
📝 Documentation
- Updated README with Network Layer section
- Comprehensive Network Layer Documentation
- Complete Multiplayer Game Example with tutorial
📊 Statistics
- 36 files changed: 6,585 additions, 252 deletions
- 17 commits since 9081729
Breaking Changes
defineIntent objects for better type safety. Old registration method still works but is deprecated.