Search Unity

FlowCanvas - Visual Scripting Similar to Unreal Blueprints

Discussion in 'Assets and Asset Store' started by nuverian, Apr 14, 2015.

  1. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Hi Nuv,

    With reference to 1.1 and explicit functions... I'm not sure I get how this should work. I drag my script into the graph and I get as per screen shot, not the name of my actual functions?

    Example function:

    Code (CSharp):
    1.     public static void RemoveLine() {
    2.         if (myLineRender.GetLineCount() > 0)
    3.             myLineRender.RemoveLine(new System.Guid("00000000-0000-0000-0000-00000000" + (myLineRender.GetLineCount() - 1).ToString("0000")));
    4.     }
    5.  
    No rush, I've decided to write code instead, but I might use FC later to call on the functions I create...

    Rix
     

    Attached Files:

    • FC.png
      FC.png
      File size:
      43.5 KB
      Views:
      880
  2. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks.
    Yes, there is a Break input for the ForLoop and ForEach nodes added in the last version :)

    Thanks :)

    :) The string concat is a method declared in string class and as such I can't really alter the number of parameters it takes. There is a concat version though already that takes a string array for parameters (params string[])
    What I am trying to do for the next version is to expose such params arrays to individual ports rather than an whole array and as such the ability to dynamicaly add/remove ports :)

    Cheers!

    Hey,

    When you drag&drop an object in the editor it simply looks at the methods of that object type. In your case a MonoScript type. What you want to do instead, is:
    • Open up "Windows/NodeCanvas/Preferred Types Editor".
    • Add your type in the list either through the button "Add Type" or drag and drop your monoscript in the editor.
    • From here on, you will be able to use the type's functions. Your function will appear under "Actions/Reflected/My Type/Remove Line".
    Let me know if that works for you.
    Thanks
     
  3. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Excellent, thanks Nuverian. One thing to add for anyone else who this may apply to... the Static Functions are listed under Actions whereas the non-static are listed under Functions.

    Still one more question. Where do all of these "DO" functions derive from? I suspect they come from my line:

    using System.Collections

    I'm just curious...

    Thanks again,

    Rix
     

    Attached Files:

    • FC.png
      FC.png
      File size:
      107.5 KB
      Views:
      764
  4. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    It doesnt matter whether a method is static for whether it will be listed under Actions or Functions. What matters is only the methods return type. If the method is a void, it is going under Actions, otherwise under Functions. That's all :)

    The "DO" methods listed there are from DOTween you probably have in your project. It's DOTween's extension methods.
    I can probably add extensions methods under a subcategory for clarity in the next version.

    Cheers!
     
    Rixtter likes this.
  5. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    I've also uploaded an update of DOTween integration nodes, as well a new package for EasySave integration online.
    You can download both here.

    Cheers!
     
    SONB and GamerPET like this.
  6. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Did anybody using DOTween in FC manage to set number of loops for a tween? I want to start a rotation tween and set loops to -1 (infinite) but got lost in the sea of reflected functions :confused:
     
  7. krissebesta

    krissebesta

    Joined:
    Oct 20, 2010
    Posts:
    16
    Hi, I downloaded the SpaceInvaders package and installed it and got it running. However, when I open any graph I cannot scroll the contents of the graph in any direction. I can use my mouse scroll wheel to zoom in and out. Even the scroll bars in the window do NOT work. :-( Am I missing something? Thanks! Kris
     
  8. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    @krissebesta: You must use the middle mouse button or hold the alt button and then use the left mouse button. The scroll bars are only a visual cue unfortunately.
     
    nuverian likes this.
  9. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    There are many parts that make up for a tween in DOTween, so it's better to have the tween in self contained nodes similar to the extension ones. I could add a number of loops in these nodes to make things easier to handle.

    Hello.
    As @Smolli mentioned, these are not really scrollbars, but rather indicators of the nodes position within the canvas. Panning the canvas around is done with middle mouse button or by holding ALT and left mouse button.

    Cheers!
     
  10. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    how do I compare specific vectors (X, Y, Z) distance? such as
    Code (csharp):
    1.  
    2. if (this.transform.position.Y > other.transform.position.Y)
    3. {
    4.  
    5. }
    6.  
    the Vector3.Distance node compares the distance on all three vectors at once. But I only want 1 from those 3 tested.

    Also, what other ways can I find specific objects matching a comparison, or testing true for something? (like a variable is at a certain number inside, or unique ID), the get tag nodes, and the GameObject.FindGameObjectWithTag are useful, but tags are limiting. I wanted to know what other popular nodes can be used to search through objects matching a parameter. or even meeting true for collision, or having a specific variable inside of them true, and then testing collision.

    I think you can simply make a trigger event and it will take any collision with a correct tagged object? hmmmm I'm trying not to use tags as they can be limiting, (only one tag per object
     
  11. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    You can use the Extract Vector3 node to extract the x,y,z components. Here is an example. Notice that Self and GameObject variable nodes can be connected directly to the Vector3 in which case transform.position is returned.
    CheckY.png

    There are many ways to filter objects outside of tags. Here is an example, where I have created a custom Component named "MyComponent" and which has a float property named "number". OnCollision, we check if number is greater than a certain value (10) as an example.
    CheckNumber.png

    Let me know if these works for you, or if you need any help or clarification :)
    Thanks!
     
  12. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Thank you for the help.
     
  13. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    Hi
    i dont know how to acess reflected nodes when i add third paty plugins
     
  14. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    how to do this in flow canvas i tried to do but unable to record pls show
    using UnityEngine;
    using System.Collections;

    public class ExampleClass : MonoBehaviour {
    void Start() {
    AudioSource aud = GetComponent<AudioSource>();
    aud.clip = Microphone.Start("Built-in Microphone", true, 10, 44100);
    aud.Play();
    }
    }
     
  15. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    SystemInfo was not shown in the preferred type window
     
  16. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    some refection nodes dont have input flow
     
  17. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    If the function or property you want to call, get/set is on a monobehaviour component, you can drag and drop the monobehaviour in the editor. A menu will show up where you will be able to select the function or property to get/set.

    If it's not on a component, please open up the Preferred Types Editor window. In that window you can add any type that you want to work with in FlowCanvas. All types added in that list, will show in the "Reflected" category for you to choose a method to call, or property to get/set.
    Here is the relevant documentation: http://flowcanvas.paradoxnotion.com/documentation/?section=working-with-types

    Here is how this can be done.
    MicClip.png

    Notice that like explained before. Microphone type is no included by default in the Preferred Types list, thus I had to go and add it before start creating this example.

    Not all nodes require a flow input port to work. All "Function" nodes, those that return a value, can be used without "calling" them like in the example image above and by default do not have a flow input or output port. You can convert them to have one if so required though, by setting the "Callable" setting in the node inspector to true.
    Callable.png
    If you do that though, you will have to explicitely call the input flow port before using the output value. In most cases, it's easier to no do that and just use the output value directly like in the example graph above :)

    Let me know if you have any questions or need any clarification on the above.
    Thanks!
     
  18. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    Hi
    how can i get get audio component and also can i use search to look for a function instead of going through big list
     
  19. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    how to save the clip
     
  20. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    You can press "Space" keyboard key, to open up a more complete browser for adding nodes, which contains a search field, yes. Here is a relevant documentation: http://flowcanvas.paradoxnotion.com/documentation/?section=adding-nodes

    Can you please clarify what you mean? Do you mean save it as a variable, save it an asset or something different?

    Thanks
     
  21. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    i want to save it as a audio clip once i click save button or s key
     
  22. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,

    Saving an asset mostly requires using the AssetDatabase unity class, but this is an editor only functionality and not really ment to be used in runtime. So saving the audioclip as an asset file to the disk in runtime really involves a lot of other work which is not really supported/handled in flowcanvas, unless of course you have some other library that handles saving audioclips in runtime, in which case I can guide you through how to use that other library in FC.
    Is that what you mean or something different?
    Thanks
     
  23. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    i want to save from flow canvas i know there are some plugins like easy save can i use easy save to save the audio clip to the disk
     
  24. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    I think you want to save the reference of the audio and not the audio itself. Something like that?

    Like your audio component has something.wav set up as the audio clip and you want to save this reference to a file so when you load you load that audio clip into that audio component?
     
  25. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    no i want to save the audio file into disk and then use it i want to use it on android or ios platform mostly
     
  26. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello again,
    So, here is a free script that can be used to save audiofile to disk. https://gist.github.com/darktable/2317063. You can download and add SavWav.cs to your project. I have also attached for you here a node that makes use of the above script 'SaveAudioToDisk'. Just put it in your project as well.

    Finaly here is an example flowScript usage:
    SaveAUdioClip.png
    By default the SavWav script saves it to the application data path, which under windows for example is "Users/Name/AppData etc". It actually logs exactly where the file is saved once the SaveAudioToDisk node is called.

    I hope this helps.
    Thanks
     

    Attached Files:

    GamerPET and unitywlp like this.
  27. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Nuv coming for help again :D
     
    nuverian likes this.
  28. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Just a heads up for anyone that haven't noticed, there is a new integration available, this time with the newly released SLATE Cutscene Director tool. The integration is a single node, but that node wraps the core functionality of a cutscene inside for playback, as well as section events and global events, instead of have it separated into several nodes, so that the node can be used as a cutscene entity.
    Slate-FC.png

    Cheers!
     
  29. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    @nuverian
    here a new happy customer.
    Thanks for your amazing asset!!!
     
    unitywlp likes this.
  30. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    i faced some problem when i try to use very complex script to flow script but other than that it was really nice tool
     
  31. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey, thanks a lot! I am very glad you like the tool :)
    If you encounter any problems or have any questions, or suggestions, please let me know.
    Thanks again!

    Thank you. Let me know if I can help in any way :)
    Cheers!
     
  32. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Nuv,

    Maybe I need the write up, but it's not there yet so I'm a little confused... I know it should be simple, could be that I shouldn't code while necking wine :rolleyes:

    I have some quirks I'm working against here. I've added the bridge and I can add the FlowScript node, but when I hit the toggle to select which script to add, the listed scripts won't populate the box. Am I missing something?

    Can I add a Behavior tree AND a flowscript to the same object? The reason I ask, is that if you try to toggle from the Canvas menu to select between FlowScriptControllers and BehaviorTreeOwners, it won't change. I have to hit "edit" from the Unity Inspector to load the relevant canvas.

    It also made me think that if I can't do the above, I would need a script on separate object, but the same problem applies.

    Unity 5.3.4
    NC & FC latest.

    Request: for blackboard variables. Can you create a drag-and-drop so we can drag from the BB to the graph?

    Thanks,

    Rix
     
    Last edited: Mar 27, 2016
  33. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    nuverian and all the community

    please, let me make a few suggestions.

    nuverian: what do you think turn your assets (Flow & Node Canvas) more "community driven" in this way:

    1) Manage new features/requests with TRELLO, bitrix24, etc. (project management approach)
    2) Have a web repository (GitHub, Bitbucket, etc) for NEW ACTIONS made by the community and by yourself.
    3) Have a WIKIPEDIA like, to manage all the documentation generated by you and by the community.

    I'm thinking in the "GNU/Linux Kernel" development process.

    I think that with this approach all of us can benefits.
    Your software get more "customers" and your customers get more quality.
     
    Rixtter likes this.
  34. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    One million votes from me, especially for option 2.

    I also vote for 2 hugely needed options:

    1. Search feature on your website.
    2. Section for tutorials. I have great ideas for this topic, and will contribute lots. I will post one this holiday to show an example.

    Option 2 should encourage the community to post their snippets based on their own projects. I will post every time I create a graph based on a task I have resolved.

    Rix
     
    Last edited: Mar 27, 2016
  35. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey :)

    Can you please provide a bit more info on your first issue regarding the FlowScript node and "toggle to select script to add"? I unfortunately don't understand what you mean here.

    Regarding having a Behaviour Tree and a FlowScript, yes that is totaly possible. You can have as many and of any combination of them on the same gameobject. I have just fixed the bug where the dropdown in the toolbar was not switching correctly.

    Your last request is something already in the TODO list :)

    Thanks!

    Hey!
    Thanks a lot for your suggestions. All are very good and I totaly agree. I will look into putting them in practise very soon, probably in the order you mentioned them as well :)
    Thanks again!

    Hey,
    Thanks for your suggestions as well! :)
    I've just added the missing search in the forums. Your 2nd suggestions pairs well with @mkgm 's 3rd one. I will look into those soon. Thanks again.
     
  36. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Thanks Nuv, I'm loving these super versatile tools more every day :)

    Here's a pic from what I meant from above post. I can't seem to call any of my Flow Graphs. I'm thinking maybe a bug, because I have had no trouble in the past.
     

    Attached Files:

  37. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    You should select the Assets tab, not the Scene tab :) Considering you have any asset flowscript created before, you will then be able to select it and assign it. Otherwise, you can click the "Create New" to create a new one.

    Let me know if thats the case.
    Thanks
     
  38. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Does that mean we can only select those saved as assets, and not those bound to owner?

    I forget if there were restrictions placed on those saved as assets, but if there are then would it be possible to add bound graphs in a future update?

    I've saved my test as an asset, everything works fine so maybe I'm wrong on restrictions...
     
    Last edited: Mar 28, 2016
  39. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    For a nested flowscript within a behaviour tree, yes. only asset flowscripts can be selected. Remember that the flowscript asset selected there is part of the same Behaviour Tree owner so it makes sense not to be able to select a FlowScriptController for example like (I suppose) your tried before.

    The only restriction that asset graphs have, is that you can't have scene object references assigned to them (the common Unity "limitation"). Thus the way to work around that is to use Blackboard variables within which you CAN have scene object references.

    If you need any clarification on the above let me know :)
     
    Rixtter likes this.
  40. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello everyone.
    The new version is now live on the asset store. Here are the important changes:
    • Massive improve in deserialization speed/GC.
    • The add node menu has been greatly re-organized to be easier. Both Action and Function nodes are now listed under a single "Functions" category. Reflected nodes are also separated with subcategories for "Methods" and "Properties" instead of all being listed under one category. Inherited members and extensions are now listed under a subcategory named "More" of the type. I look forward to hear if you prefer this new menu over the old one.
    • Unity Object values can now be connected to Bool inputs directly, which in effects will check if the object is null similar to how it's done in code.
    • The Switch Integer and Switch String nodes now have a "Default" output. This is called when the input value does not match any of the output cases.
    • The Cooldown node now has a "Cancel" input.
    • The number of supported reflected parameters are now increased to 8.
    • Blackboard variables panel in the editor is now scrollable.
    • Various fixes and improvements.
    Cheers!
     
  41. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Hey @nuverian - I have a few questions -

    1. How is performance of your asset compared to Unreal engines Blueprint or Autodesk Stingray's flow Visual Scripting System?
    2. How is the performance of Flow canvas with larger scale projects? (Open World or MMO like games)

    Thanks for your time,
    HeadClot
     
  42. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    This is a HUGE improvement :) Big time saver, now I don't have to think whether they are functions with returns or not. And I love not seeing those pesky inherited members... Now this is very clean & I can see only the functions listed that I want to see.

    Excellent improvement, everyone will agree so please keep this implemented !!

    Rix
     
  43. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Thanks :) Indeed I also think the menu is much cleaner now and easier to grasp. I am very glad you agree!
     
  44. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    Well, they aren't really some solid ways to compare performance of flowCanvas to any of the two, but I can tell for a fact that both blueprints and stingrays ought to be faster even if only for the reason that both of them are built-in the engine while FC is a plugin built on top of an engine. That being said, FC is heavily optimized and very fast.
    As for performance in large scale projects, it all depends on how many flowscripts you have running concurently and of course what they actually do. The backbone is simply calling methods through delegate calls, but of course if the methods called are slow, so will be the flowscript. Once again, the backbone is heavilty optimized and the architecture is made to perform as fast as possible can in runtime.

    Please let me know if you have any other questions.
    Thanks!
     
  45. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    Hi
    why it was not possible to write custom script with flow canvas as we do in the programming languages.
    i am asking in general.
     
  46. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    To save you some time unitywlp, I don't think your question is specific enough for Nuverian to answer.

    Do you mean writing custom nodes?
    If you find the existing nodes lacking, you can create your own custom nodes very easily. Have you looked at the documentation for this? http://flowcanvas.paradoxnotion.com/documentation/

    Or do you mean accessing custom scripts?
    Flowcanvas works very well with custom scripts. You simply need to ensure you update the Windows... NodeCanvas... Preferred Types. Drag your scripts into the top of this popup, your functions are then easily accessed via the Functions... Reflected area within the Flowcanvas graph.

    Or you could also mean why doesn't Flowcanvas GENERATE scripts.
    This one I can't answer. Nodecanvas generates C# but Flowcanvas doesn't. I'm not sure if that is possible for future versions or not, perhaps Nuverian would offer an answer to that...

    Rix
     
  47. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    flow canvas really nice tool but i was asking is it possible to do every thing we can in programming
     
  48. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    I had another look at Stingray to see improvements since 1.0 and I see now it is on 1.2 My opinion is really limited because I've only spent 15 minutes at a time trying to get a look at what it can do. I just looked at a lua scripting tutorial on youtube:



    Yikes. That's a lot of code to move a cube up and down.

    I then had a look at visual scripting for basically a simple character controller:



    Ouch. Not my cup of tea at all. Maybe on power for how complicated (too many nodes to accomplish something simple) Blueprints are.

    I think Flowcanvas is hit the ground running type of scripting, whereas the other 2 need days of tutorials to figure out the basics.

    I also read that Blueprints are 10 times slower than coding in C++ Can't comment on Stingray.

    For me it's a no-brainer to stick with Unity for C# and Flowcanvas is IMO way better/easier than either of the above. Performance looks to be on par with C# from what I can tell so far... in so much as I don't notice any lag whatsoever yet... but I'm not hundreds of nodes in yet... I'm writing scripts & calling them with FC because it's a fun hobby...

    Rix
     
  49. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Nuverian quoted somewhere earlier in this thread that while possible to code an entire game in Flowcanvas, it would be difficult. I think what he means by that is that some complicated tasks are best handled with C#, but at the same time it also means that yes, you can do everything that we can in programming. Maybe minus some of the more advanced structures eg I couldn't find a dictionary equivalent so I popped it into a script & I call it via FC. I don't even know what a Lambda is but I doubt it's in there. But you don't need these structures if you code the long way around I guess.

    Personally what I've found so far is that complicated tasks are probably best coded in C# and then called via reflection in FC. For example, nested FOR loops. I would hate to put this into nodes... which is a challenge for you Nuverian... would you suggest we go to C# for the likes of this?

    Code (csharp):
    1.  
    2.         for (x = 0; x <= 20 ; x++) {
    3.             for (z = 0; z <= 41; z++) {
    4.                 if (x == 0) {
    5.                     if (z == 0) {
    6.                         deleted intentionally
    7.                     } else {
    8.                         deleted intentionally
    9.                     }
    10.                 } else {
    11.                     deleted intentionally
    12.                 }
    13.             }
    14.         }
    15.  
    The star attraction for me is adding in 3rd party C# scripts. Add them in to FC via reflection, and it is extremely easy to implement those functions visually without the headaches involved in totally understanding the underlying code.

    In summary, the answer is YES but you should be prepared to write a few functions here and there.

    Rix
     
  50. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    146
    yes right making the above code in flow canvas was not supported i guess but adding those features will make very nice tool