A lightweight TypeScript game engine for server-authoritative multiplayer games
npm install murowA lightweight TypeScript game engine for server-authoritative multiplayer games.
``bash`
npm install murow
`typescript`
import {
FixedTicker,
EventSystem,
BinaryCodec,
generateId,
lerp,
NavMesh,
PooledCodec,
IntentTracker,
Reconciliator
} from 'murow';
// or
import { FixedTicker } from 'murow/core';
: Deterministic fixed-rate update loop
- EventSystem: High-performance event handling
- BinaryCodec: Schema-driven binary serialization
- generateId: Cryptographically secure ID generation
- lerp: Linear interpolation utility
- NavMesh: Pathfinding with dynamic obstacles
- PooledCodec: Object-pooled binary codec with array support (via PooledCodec.array()) for efficient snapshot encoding. Supports zero-copy encoding with encodeInto() for minimal allocations
- IntentTracker & Reconciliator: Client-side prediction$3
Minimalist networking primitives:
- IntentRegistry: Type-safe intent codec registry
- SnapshotCodec: Binary encoding for state deltas
- Snapshot: Delta-based state updates
- applySnapshot(): Deep merge snapshots into stateWorks harmoniously with core utilities (
FixedTicker, IntentTracker, Reconciliator).See Protocol Layer Documentation for usage.
$3
Transport-agnostic client/server abstractions:
- ServerNetwork: Multiplayer game server with per-peer snapshot registries
- ClientNetwork: Game client with intent/snapshot handling
- TransportAdapter: Pluggable transport interface
- BunWebSocketTransport: Bun WebSocket implementation (reference)Key features:
- Per-peer snapshot registries for fog of war and interest management
- Transport agnostic - works with WebSocket, WebRTC, UDP, etc.
- Type-safe protocol integration with
IntentRegistry and SnapshotRegistrySee Network Layer Documentation for usage and examples/multiplayer-game.ts for a complete example.
Building
`bash
npm install
npm run build
``MIT