Skip to main content

Overview

The Entity system is the foundation of all gameplay logic.
Damage, conditions, attributes, buffs, debuffs, items, skills, AI decisions — everything operates on Entities, not GameObjects.

This page explains what an Entity is, how it is managed, and how it fits into graphs.


What Is an Entity?

An Entity is a lightweight data container that represents a combat participant.

Examples:

  • Player
  • Enemy
  • Summoned unit
  • Projectile
  • Temporary GraphObject instance entity

An Entity is not a GameObject, but it can be linked to one through an [EntityComponent].

Each Entity has:

  • A unique ID (uid)
  • A set of [Attributes]
  • A set of CustomData
  • Runtime state used by GraphObject and systems

EntityComponent (Unity Side)

To connect a GameObject to the combat system, attach an:

EntityComponent

This component:

  • Registers the GameObject as an Entity instance
  • Exposes AttributeData in the inspector
  • Connect behaviors with runtime Entity data (read/write)
  • Allows physics detection to resolve targets

[EntityManager]

The [EntityManager] is a global registry that stores and resolves Entities.

Responsibilities:


AttributeData on Entities

AttributeData are numeric values of Attribute such as:

  • Health
  • Attack
  • Defense
  • CritRate
  • MoveSpeed

They are read and modified at runtime.


Entity Runtime Lifecycle

  1. GameObject spawns
  2. EntityComponent registers as instance of Entity
  3. Behaviors on entity
  4. Entity instance removed on destroy
Note: 
Combat logic and behavior execution do not require an Entity instance.
These systems operate entirely on backend data.
The Entity instance is used solely to visualize or present the results of events and data updates.
As a result, you can simulate combat in the background, reuse logic across different contexts
(AI, previews, server logic), and reduce unnecessary coupling between data and presentation.

Why This Matters

The Entity system enables:

  • Fully data-driven combat
  • Improves system flexibility, performance, and testability.
  • Clean scaling for AI, loot, and difficulty
  • Lightweight and highly modular.