Server Architecture
Deep dive into MAEngine's server-side systems and design patterns
Server Architecture
This section documents the core architectural concepts powering MAEngine's game server.
Core Systems
Spatial Grid
A 2D uniform spatial hash grid optimized for fast entity proximity queries. Used for interest management and relevance calculations.
ECS (Entity Component System)
How MAEngine uses Bevy ECS for game state management, including components, resources, bundles, and the EntityManager bridge.
Class Extension System
The class system for Lua scripting with Subscribe, BindValue, and Inherit patterns.
Relevance & Interest Management
How MAEngine filters entity updates based on distance and ownership for efficient networking at scale.
Design Philosophy
MAEngine's architecture follows these principles:
-
Server-Authoritative: The server is the source of truth. Clients submit inputs, server validates and replicates state.
-
Optimized for Scale: Systems are designed for 100-1000+ concurrent players with efficient spatial queries and interest management.
-
Lua Freedom: Scripts have full access to engine capabilities without safety rails. Trust is given to game developers.
-
Clean Separation: Clear boundaries between networking, ECS, scripting, and spatial systems.