📄️ Calling Methods
Methods are RPC calls from client to server. Use them when a client action needs to trigger server-side logic - spawning entities, changing world state, or validating game rules.
📄️ Handling Events
Events broadcast messages to nearby clients. They're location-based - only players with the relevant chunk loaded receive the event. Use them for effects, notifications, and reactive game logic.
📄️ Metadata Processing
In Voxelize, metadata is a way to keep entities and players in sync with the server. Essentially, metadata is a JSON serializable object that contains the individual components that the entity itself possesses. For example, a player entity might have a position component, a rotation component, and a health component. These components are stored in the metadata object, and whenever these individual components are changed, the metadata object is updated and sent to the client.
📄️ Custom Dispatcher
The Voxelize server is built on top of the specs ECS framework. This means that the server is made up of a series of systems that are running in parallel. By default, Voxelize has a list of systems that are used to handle things like chunk generation, network packet handling, and more. These systems come together and define what happens every game tick.
📄️ Transport
Transport is a server-side WebSocket client that connects to Voxelize from external Node.js processes. It receives the same real-time events that browser clients receive, enabling backend services to react to game activity.