BT performance with a couple hundred agents

NodeCanvas Forums Support BT performance with a couple hundred agents

Tagged: 

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

    Hi,

    I wrote this message a couple weeks ago in continuation of an older post in the ‘General Discussion’ section (https://nodecanvas.paradoxnotion.com/forums/topic/bt-performance-issues-with-100-200-agents/) 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:

    1.profiler

    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?

    2.deep-profiler

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

    3.node_.reset_

    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.

    4.deep-profiler

    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

    Attachments:
    You must be logged in to view attached files.
    #17454
    inmaculada
    Participant

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

    5.more-complex-bt

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