Will BD Pro get better performance in big world games?

malo

New member
In a large world game, there are tens of thousands of monsters. When a player kills a monster, the corresponding behavior tree is destroyed. After a period of time, the monster is refreshed and a new behavior tree is created.
Considering that the BD pro uses DOTS, memory continuity is needed to improve performance. For this type of game that may frequently create and destroy behavior trees, can the BD pro get better performance? Is it necessary to rearrange the memory distribution when creating and destroying behavior trees to achieve memory continuity?
 
Yes, DOTS allows for those type of numbers. With that said, instead of destroying and creating entities you should instead just disable and enable.
 
Yes, DOTS allows for those type of numbers. With that said, instead of destroying and creating entities you should instead just disable and enable.
If a resource has not been used for a long time, I think it is better to release the resource to free up memory. If a new AI is generated afterwards, it needs to be recreated. Or when the game is just started, the AI is slowly spawned in the big world. In this process, the behavior tree instance will also be slowly created. At this time, will BD pro automatically arrange the memory?
 
ECS arranges the memory in an efficient order, but still if you were to destroy and deserialize/initialize again you're going to incur some cost. Instead you should use object pooling with subtrees, this page has some code:

 
Back
Top