Hytale’s game logic is built upon a custom Entity Component System (ECS). This architecture separates data (Components) from logic (Systems) and identity (Entities), enabling high performance and modularity.
Ref<ECS_TYPE>. They are lightweight handles that point to a specific index in the storage.Component<ECS_TYPE>. They contain no logic.ISystem that process entities possessing specific components.Store Classcom.hypixel.hytale.component.Store<ECS_TYPE> is the heart of the ECS.
ArchetypeChunks. This is similar to Unity’s DOTS or Bevy ECS, providing memory contiguity for cache efficiency.Store supports parallel task execution (ParallelTask), allowing systems to update entities concurrently across threads.CommandBuffers and applied at safe points to prevent concurrency issues during iteration.ISystem: Base interface.TickingSystem: Systems that run every tick.EntityEventSystem: Reacts to entity-specific events.WorldEventSystem: Reacts to global world events.HolderSystem: Validates or processes entities when they are added to the store.Hytale uses two distinct ECS worlds running in parallel for each game world:
EntityStore):
UUIDComponent, NetworkId, Transform, Velocity, Health, etc.ChunkStore):
WorldChunk (metadata), ChunkColumn (block data).