Performance instantiating hundreds of BTs

Forums 💬 NodeCanvas 🗨️ General Discussion Performance instantiating hundreds of BTs

  • This topic has 0 replies, 2 voices, and was last updated 7 years ago by Gavalakis.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13652
    bzwill
    Participant

      Hi there,

      I’m just experimenting with using a BT on an agent of which there will be 100s in game at any time. When all agents are first initialized there’s a huge spike, caused by calling Resources.FindObjectsOfTypeAll();

      I have a few questions:

      • Can i work around this? Is this only called when in editor?
      • Are FSMs going to be faster than BTs for this many agents (if other things remain the same).
      • Any other tips when wanting to use 100s to 1000+ BTs?

      Thanks

      #13655
      Gavalakis
      Keymaster

        Hello,

        This is only called in editor, yes.
        This is only to support the icons in the hierarchy to be highlighted when a GraphOwner “state” change to enabled/disabled.
        You can however disable this feature (and thus save the spike caused in the editor due to this), by disabling the option called “Highlight Active In Hierarchy” under the “Prefs” dropdown menu of the NodeCanvas editor toolbar.

        Thanks!

        #13654
        bzwill
        Participant

          Ah thank you so much! That’s great!

          If its not already (I tried to check) this might be a good thing to put in documentation 🙂

          #13653
          Gavalakis
          Keymaster

            Thanks! 🙂
            I’ve just added this info in the docs.

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