Behaviour Tree System in a Data-Oriented Paradigm
Mohamad Khairulhelmy Hussain · Theseus (Ammattikorkeakoulujen) · 2026
Behaviour trees (BTs) are widely used for implementing decision-making in game AI, while Unity’s Entity Component System (ECS) introduces a data-oriented paradigm that differs significantly from traditional object-oriented approaches. The lack of clear guidance on integrating BTs within ECS-based architectures has created challenges for developers seeking performance and scalability. The objective was to develop a practical guide that enables the implementation of behaviour trees using Unity ECS. The aim was to bridge the conceptual and technical gap between traditional BT design and ECS principles so that other developers can replicate and adapt the approach. A behaviour tree framework was designed and implemented using Unity ECS concepts such as entities, components, and systems. Key BT elements, including nodes, execution flow, and state handling, were restructured into a data-oriented format. The guide was structured to present step-by-step instructions and explanations of core design decisions. A functional ECS-compatible behaviour tree implementation was produced, demonstrating that BT logic can be effectively adapted to a data-oriented architecture. The resulting guide provides clear instructions, code structures, and design patterns that support the creation of AI systems within Unity ECS. Behaviour trees were successfully adapted to Unity ECS by rethinking their structure in terms of data and systems rather than objects. The produced guide enables other developers to implement similar solutions and contributes to the broader understanding of AI design in data-oriented environments. The approach highlights the importance of aligning traditional AI patterns with ECS principles to achieve optimal results.