Problem about your json parser

Forums 💬 NodeCanvas ⚙️ Support Problem about your json parser

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #17857
    jjr2930
    Participant

      When i load BehaviourTree asset(it have just one task), JSON Parser create so many memory garbage,

      this problem is so critical to me

      Can you optimize your parser?

      Or can you tell me solve this problem?

      #17864
      Gavalakis
      Keymaster

        Hello and sorry for the late reply.
        This definitively looks something is going wrong here.
        It only takes 56kb here of that same tree, of which 43kb is all due to the Unity Log to Console.

        What version of NodeCanvas you are using?

        #17863
        jjr2930
        Participant

          I use 2.6.3 version

          this situation is occurred when you first load Behaviour Tree..

          so if you can not see this situation, you must restart editor,

          and load Behaviour Tree asset

          you can not miss it

          #17862
          Gavalakis
          Keymaster

            Hello again,

            I am sorry, but no matter what I do, I can’t reproduce such a high allocation when the graph is loaded.
            How are you loading the graph exactly? Can you please copy/paste the code that you are using to load the graph?

            Thank you.

            #17861
            jjr2930
            Participant

              1. restart editor
              2. open profiler(click deep profiler)
              3. Create new Behaviour Tree (it’s name is BehaviourTree)
              4. add this component to any gameobject in scene
              5. play, and click “HI” button

              if you want video, I will create

              using NodeCanvas.BehaviourTrees;
              using System.Collections;
              using System.Collections.Generic;
              using UnityEngine;

              [RequireComponent(typeof(BehaviourTreeOwner))]
              public class LoadBT : MonoBehaviour {

              public void OnGUI()
              {
              if ( GUILayout.Button( “HI” ) )
              {
              var loaded = (BehaviourTree)Resources.Load( “BehaviourTree” );
              GetComponent<BehaviourTreeOwner>().SwitchBehaviour( loaded );
              }
              }
              }

              #17860
              Gavalakis
              Keymaster

                Hello again,
                I just did your test exactly as provided and here are the results, which look quite good though:
                [attachment file=”DeserializeTest.png”]

                What version of Unity are you using please?

                Thanks.

                #17859
                jjr2930
                Participant

                  I use 5.6.1 p1

                  #17858
                  Gavalakis
                  Keymaster

                    I will test this out in this exact version Unity 5.6.1 p1 to confirm, and will let you know.
                    Thanks.

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