BT performance with a couple hundred agents

NodeCanvas Forums Support BT performance with a couple hundred agents


Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #17449


    I wrote this message a couple weeks ago in continuation of an older post in the ‘General Discussion’ section ( because I thought it would be easier for you to have same issues on the same post, but I’m thinking that maybe you don’t look at that forum as often, so I’m copying it here. I hope that’s OK:

    I’m working on a strategy game in which up to 400 units should be alive, moving, attacking, etc. but I have performance issues at 150-200 entities, so I decided to delve into profiler. Here’s the test I did with 400 entities, considering the significant overhead due to the deep profiler:

    In file 1 you can see the simpler Profiler picture. Inside my BT tasks there are two expensive operations (Physics.OverlapSphere and distance calculations). The rest are simple checks and assignations, so it seemed initially weird that OverlapSphere being the most expensive operation, it only accounted for ~20% of the processing time:


    In file 2 you can see a deep profiler screenshot. I understand here that Node.Reset() is just handling the subgraph. If so, would it help to delete the subgraph and copy the tasks into all the BTs that implement them instead?


    Here you can see Node.Reset() in depth:


    However, leaving aside the Node.Reset() issue, I also have troubles with Node.Execute(). From the 35 ms that it takes, I believe that only the half of it (~16ms) are attributable to the code within the Condition and the Actions themselves.


    So I’m wondering, is there anything I can do from NodeCanvas’ perspective to improve performance? I have already in mind an alternative to OverlapSpehere, but I’m afraid it won’t be enough if I can’t find a way to trim the BT’s handling too.

    Thank you so much in advance

    You must be logged in to view attached files.

    I couln’t add a 5th file to my previous message, here’s the most complex BT that I’m implementing for context:


    You must be logged in to view attached files.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.