📄️ Entity Component System
Voxelize servers run on the Specs ECS crate. It is recommended to read through the Specs ECS tutorial before continuing.
📄️ The Client Entity
On the client side, entities are Three.js objects that represent server-side ECS entities. They receive data updates from the server and render accordingly.
📄️ Custom Entity Creation
On the server, entities are ECS objects with components. You define entity loaders that specify which components an entity type has, then spawn instances of those entities.
📄️ Metadata Component
Metadata is how entity state gets synchronized from server to client. The MetadataComp stores a JSON-serializable map that gets sent to clients whenever it changes.
📄️ Customizing the ECS
Voxelize's server runs on Specs ECS, which executes systems in parallel each game tick. You can customize the dispatcher to add your own systems, modify execution order, or extend built-in behaviors.
📄️ Network Interception
Network interceptors allow you to hook into the message flow between client and server. Any object with an onMessage method can be registered as an interceptor.
📄️ Collision Detection
Voxelize uses Rapier physics for entity-to-entity collision detection. Entities with InteractorComp can detect when they collide with other interactors.
📄️ The Events System
Events are location-based messages that broadcast to nearby clients. Unlike methods which are world-wide RPC calls, events only reach clients who have the originating chunk loaded.
📄️ Method Handling
Methods are world-wide RPC calls from client to server. They're used for actions that affect game state, like spawning entities, updating inventories, or changing world settings.
📄️ Chat and Colored Text
Voxelize provides a chat system for player communication and a colored text utility for styled text rendering.
📄️ Protocol Networking
Voxelize uses Protocol Buffers for efficient binary serialization of network messages. Understanding the protocol helps when building custom features.
📄️ Custom Blocks
Beyond basic blocks, Voxelize supports advanced block configurations including rotations, transparency, custom shapes, and dynamic behaviors.
📄️ TypeScript Transport
The Transport class is a server-side WebSocket client that connects to the Voxelize game server from an external Node.js process. It receives the same real-time events that browser clients receive (player joins, chat messages, entity updates), enabling you to build services that react to game activity.