BTs (and all other graph systems) in NodeCanvas are serialized and deserialized to/from json.
Due to this fact of course, and even though I’ve done a lot of performance nitpicking modifications to the json serializer used (FullSerializer), there is bound to be an overhead when a BT is deserialized due to inevitable memory allocation taking place on deserialization.
When a tree is instantiated to be used by an agent, even though there is some caching going on to avoid the same json from being parsed, deserialization is once again taking place and as such an overhead will as well.
Of course, one solution to this, would be to instantiate your agents in loading time, disabled them and only enable them when they are meant to actually be used in the game. That is considering the fact that you have a lot of agents of course.
I hope this information help, but please. If you have any questions, do let me know.
Thanks again for your interest in NodeCanvas! 🙂
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.