Hytale-documentation.github.io

Entity Component System (ECS) Architecture

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.

Core Concepts

The Store Class

com.hypixel.hytale.component.Store<ECS_TYPE> is the heart of the ECS.

Key System interfaces

Dual ECS Worlds

Hytale uses two distinct ECS worlds running in parallel for each game world:

  1. Entity Store (EntityStore):
    • Manages game objects like Players, Mobs, Items, Projectiles.
    • Components: UUIDComponent, NetworkId, Transform, Velocity, Health, etc.
  2. Chunk Store (ChunkStore):
    • Manages map chunks as entities.
    • Components: WorldChunk (metadata), ChunkColumn (block data).
    • This allows the “World” itself to be managed and updated using the same modular system as entities.