-
In Unity DOTS, we generally want to minimize the number of unique component combinations AKA archetypes. This means no "God Objects", or in DOTS terms, entities with a huge number of components. Adding just one unique component to any of these "God Entities" would create an entirely new archetype chunk populated by just one large set of components. In my ECS architecture, actors have a gargantuan number of configurable data components, with many, many arcehtype variations. The separate Monobehavior-based PandaBT framework would query component data from these myriad God Entities. Overall, my current system is very inefficient at utilizing the cache and conserving chunk space. Fortunately, EntitiesBT seems to avert this problem. I'd like to ask a few questions on if or how EntitiesBT uses the cache well and minimizes chunk waste.
Soldier = ([Flanking Components],[Tactics Components],[Gun Components],[Morale Components],[Armor Components]) Any small variation in this archetype, such as adding a single "RadioComponent" for example, would waste chunks and decrease execution performance. In addition, PandaBT would require querying data from all these groups of components for their related behavior tree action nodes. Of course, this God Entity could still be split up into many sub-entities that can still be read from PandaBT's Monobehavior code, but the amount of Editor dragging and dropping would drive many crazy. The potential alternative using EntitiesBT is the following entities: Soldier = () Smart Flank = ([Subset of Flanking Components],[EntitiesBT Components]) And so on. The Soldier entity is now just a blank "folder" entity, while each of its data components are now tied to their related behavior components. Cohesion is nicely tight, each chunk is now populated by a large number of easily manageable entity components, and any systems that operate on the data components (AimForSniperSystem, FlankPathfindingCalculationSystem, etc) won't iterate over unnecessary components. Each entity could also now be saved as a prefab, with prefab variants used to inject different configuration values. They can then be dragged and dropped into different areas of a behavior tree (the Covering Fire subtree and Flanking Fire subtrees would both use a prefab instance of Shoot, for example). Or, have just one base instance of the data components, and create a special authoring that injects a special node variant that refers to this base data entity. @quabug please do tell if EntitiesBT can be utilized to solve this problem. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The memory layout of behavior tree is absolutely independent from
Tree structure of
I am not familiar with A I am not sure I fully understand your questions, so please point out if something is still unclear. |
Beta Was this translation helpful? Give feedback.
The memory layout of behavior tree is absolutely independent from
Unity.Entities
, there's no components at all.The nodes data (tree) will be stored in a continuance blob,
NodeBlob
, after build/load.Entity
orGameObject
just different data sources for behavior tree which can be access via their ownBlackboard
.