Optimization, performance etc.

Forums 💬 FlowCanvas ⚙️ Support Optimization, performance etc.

  • This topic has 0 replies, 4 voices, and was last updated 8 years ago by Gavalakis.
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #22530
    szaruga
    Participant

      Hello. (Sorry for my English)

      I’ll do a simple thing:

      [attachment file=”03-08-2016_01.jpg”]

      Created object (prefab) – it has flow script:

      [attachment file=”2016-08-03_08-16-32.jpg”]

      When creating object – game stops for 1 sekund.
      Except to slowing down, everything seems to work, there are no errors.
      Does that mean a little more complicated things are not recommended? 🙁

      Additional info:
      – Unity: 5.3.2f1
      – Flow Canvas: 1.2.5b

      #22551
      Gavalakis
      Keymaster

        Hello,

        What kind of platform and specs is this happening on? This is quite a big delay there and maybe something is going wrong. Is it possible for you to send me the project to test it out?

        Also, have you tried the SpaceInvaders example game from the Downloads section, (which is also more complicated than the images above)? Does it also has a similar performance issue on your end?

        Let me know.
        Thanks.

        #22550
        szaruga
        Participant

          Hello
          (sorry for my english 🙂 )

          [quote quote=895]
          What kind of platform and specs is this happening on? ……………………………….
          [/quote]

          Platform? hmm…
          Game Build —> Windows x86_64
          My PC —> Windows 8.1, i5-4460, RAM-16GB, GPU-GTX 750Ti, Crucial MX100 256GB

          [quote quote=895]
          ……………..(which is also more complicated than the images above)?………………
          [/quote]

          My project is probably more complicated, i’m at the beginning of the road and i have about 80 macros, 40 global variables… one of many flow scripts:

          [attachment file=”2016-08-07_15-28-16.jpg”]

          I think this is all too much complex and … whether FlowCanvas + NodeCanvas can handle this?

          But…
          I worked in Unreal Engine 4 with BLUEPRINTS and… examples:
          [attachment file=”2016-08-07_16-13-04.jpg”]
          [attachment file=”2016-08-07_16-11-31.jpg”]
          [attachment file=”2016-08-07_16-09-07.jpg”]

          And everything worked very smoothly, i hope to get similar results by FlowCanvas and NodeCanvas.

          [quote quote=895]
          …………………. Is it possible for you to send me the project to test it out?
          ………………….
          [/quote]

          I am ashamed to show my project 😉

          but…

          I was able to fix it:

          The problem posed in macros, mostly “Empty IO” (setting several variables and hiding some panels)
          Of course, these operations are executed only when the object is clicked.

          However…
          When macros moved to another object and executes them through event… delays disappeared.

          Important question —> it is the correct way?

          Regards 🙂

          #22549
          Gavalakis
          Keymaster

            Hello again,

            Sharing a screenshot of the flowscript helped. Indeed the delay here is caused by the many uses of Macros. The problem is that right now all Macros are being initialized when the root flowscript is enabled, so if there are a lot of Macros there (like in your case) initialization will be slow.
            I will fix this in the next update so that each Macro is instead initialized only when it is needed and this change will greatly increase the performance for when using a lot of Macros.

            Thanks again for your information!

            #22548
            szaruga
            Participant

              Hello (sorry for my english 🙂 )

              Thank you, and patiently wait for the patch 🙂

              And…
              I think my next issue also fits in thread.
              Still not much I can do and still a lot of learning ahead of me.
              I already know that in the programming, different things can do in different ways, I really like it, but I’m afraid of optimization

              My current problem is: “class versus structure”
              At the moment, items, objects and NPCs in my project are structures. in example:
              [attachment file=”2016-08-20_16-54-45.jpg”]
              S_Item_Data = structure
              I did it because not fully understand how they work references (with classes). Before, they were is class, when the game was creating an object from Data Table, I had various errors. Roughly I understand why this happened.

              But, more important for me is something else:
              I was planning to buy —>
              https://www.assetstore.unity3d.com/en/#!/content/59863
              However, the seller explained to me, that I must to use classes instead of structures, if i want to use the package.
              At the moment, everything in my project seems to work fine (except for delays caused by macros 😉 )
              Leaving aside the question Visual Item Database, I could change the structures on classes (lot of work) and try to deal with references. But much more important is the question:

              What’s better for performance and general use, structures or classes? (especially in the situation described) and… (especially in FlowCanvas)

              #22547
              Gavalakis
              Keymaster

                Hey,

                Generally speaking structures are faster than classes, but that difference mostly comes in play in certain situations. MSDN has a nice article about the differences: [LINK]

                FlowCanvas can work with both classes and structures the same and the most commonly performance issue with structures (value boxing), is not happening in FlowCanvas either, except in the case of when data “travel” in and out of a Macro, in which case a structure will be boxed/unboxed.

                #22546
                szaruga
                Participant

                  “I will fix this in the next update so that each Macro is instead initialized only when it is needed and this change will greatly increase the performance for when using a lot of Macros.”

                  Not available yet? I check version 1.3, but the game still runs more than a minute

                  #22545
                  Gavalakis
                  Keymaster

                    Hello,

                    I am very sorry that I wasn’t able to fit the Macro improvement in the new version 1.3 🙁
                    I really had to send the new update 1.3 due to the many changes there were and other older requests, but I am already working on the new one with the Macro instantiation fix.
                    Once again, I’m very sorry that this did not make it in the the current version.

                    #22544
                    szaruga
                    Participant

                      Ok, I’m waiting patiently.

                      #22543
                      szaruga
                      Participant

                        Are you planning to add something like the Unreal Blueprints’ “find references” feature? It’s a very useful thing that lets you find all references to a variable, function, macro etc. in multiple graphs. See the screenshot for an example how it works (never mind the strange name of the thing being searched for, it’s probably a result of opening an old project in a new version of Unreal).

                        #22542
                        Gavalakis
                        Keymaster

                          Hello,

                          I was planning to add a find references for nodes that use a specific blackboard variable, but maybe I could expand this to find references for other things as well (like as you said macros), or certain functions. This is certainly not an easy thing to add, but I also think it is quite useful to have 🙂
                          Thanks for the suggestion.

                          #22541
                          amoka
                          Participant

                            Hi,

                            I agree this search functionality would be essential addition to FlowCanvas. I always use the search tool a lot when doing traditional coding, so I am missing this feature much in FC.

                            #22540
                            Gavalakis
                            Keymaster

                              Thanks for your input.

                              #22539
                              nicoyiqi
                              Participant

                                hey,everyone,I recently create a method to find node in graph,thought inspired by the new release feature : relay node.

                                The “find” node, like this.

                                [attachment file=”12.jpg”]

                                you can search to find the node which name contain input text.

                                by click the select button, you can select that node. and I also add new function to focus the selected nodes, just press “F” ;

                                click control+ f ,to select this find node directly;

                                beside, I modify the relay node code, add relay flow node, and select corresponding input or outPut node more convenient.

                                [attachment file=”2.jpg”]

                                [attachment file=”3.jpg”]

                                here is the unitypackage, just cover the source files.

                                [attachment file=”findnode.unitypackage”]

                                #22538
                                nicoyiqi
                                Participant

                                  I find a bug : when duplicate a node, the new node’s UID does not change, that cause relay out node’s relay input value node reference still point to old node instead of new duplicate node.

                                  the solution is add follow code in Node.cs after line 219 :

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