murow
v0.1.3
Published
A lightweight TypeScript game engine for server-authoritative multiplayer games
Maintainers
Readme
Murow
A lightweight TypeScript game engine for server-authoritative multiplayer games.
Installation
npm install murowUsage
import { FixedTicker, EventSystem, BinaryCodec, generateId, lerp, PrefabBucket } from 'murow';
// or
import { FixedTicker } from 'murow/core';
import { WebGPU2DRenderer } from 'murow/webgpu';Modules
Core — Low-level utilities and systems
BinaryCodec— Schema-driven binary serializationPooledCodec— Object-pooled binary codec with array supportEventSystem— High-performance event handlingFixedTicker— Deterministic fixed-rate update loopDriver— Event-driven update orchestrationgenerateId— Cryptographically secure ID generationlerp— Linear interpolation utilityNavMesh— Pathfinding with dynamic obstaclesIntentTracker&Reconciliator— Client-side predictionInputTracker— Cross-platform input state trackingFreeList— Slot allocator for reusable handlesSparseBatcher— Layer/sheet bucketing for batched renderingSimpleRNG— Seedable deterministic random number generatorRay2D/Ray3D— Zero-allocation ray intersection tests (segment, circle/sphere, AABB, plane, triangle)
ECS — Entity Component System
High-performance ECS with SoA (Structure of Arrays) storage, bitmask queries, and zero-allocation hot paths:
World— Manages entities and componentsdefineComponent— Define typed components with binary schemasEntityHandle— Fluent chainable entity API
Game — Game loop abstractions
GameLoop— Client/server tick loop withsync/pre-tick/tick/post-tick/renderphases,every(...)interval scheduling, plus input tracking and frame interpolation
Protocol — Networking primitives
Minimalist networking primitives:
IntentRegistry— Type-safe intent codec registrySnapshotCodec&SnapshotRegistry— Binary encoding for state deltasSnapshot<T>— Delta-based state updatesapplySnapshot()— Deep merge snapshots into stateRpcRegistry&defineRpc()— Type-safe RPC definitions
Network — Transport-agnostic networking
Transport-agnostic client/server abstractions:
ServerNetwork— Multiplayer game server with per-peer snapshot registriesClientNetwork— Game client with intent/snapshot handlingTransportAdapter— Pluggable transport interfaceBunWebSocketTransport— 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
IntentRegistryandSnapshotRegistry
Renderer — Abstract renderer interfaces + asset pipeline
Renderer-agnostic primitives consumed by any backend (@murow/webgpu, future PixiJS, Three.js, …).
BaseRenderer/Base2DRenderer/Base3DRenderer— abstract contractsPrefabBucket— typed registry for spawnable assets. Declare → load → typed lookup; the renderer self-sizes from the bucketparseGltf/parseSpritesheet— pure CPU parsers (no GPU, no canvas)SkeletalAnimation— CPU-side bone evaluation for skinned meshes
WebGPU — WebGPU rendering backend
The WebGPU renderer is bundled with murow and accessible via murow/webgpu:
import { WebGPU2DRenderer, WebGPU3DRenderer } from 'murow/webgpu';See WebGPU README for full documentation.
Netcode — Multiplayer layer
Opinionated multiplayer layer built on the Protocol and Network
primitives above. Adds snapshot-based state sync, client-side prediction
with rollback, jitter interpolation, server-pushed entity assignment,
and spatial-interest plugins.
import { GameServer, GameClient, defineIntents, definePredictions } from 'murow/netcode';See Netcode README for full documentation. If
its opinions don't fit, drop down to the Protocol and Network
primitives directly.
Building
npm install
npm run buildLicense
MIT
