Search Unity

FlowCanvas (inspired by Unreal Blueprints)

Discussion in 'Works In Progress - Archive' started by nuverian, May 12, 2014.

  1. Pajaroide

    Pajaroide

    Joined:
    Sep 19, 2012
    Posts:
    34
    Personally, after using Unreal Engine 4 Blueprints I don't want to go back to old-school coding. Hopefully we can see this in the asset store soon.
     
    Last edited: Mar 10, 2015
  2. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Release is going to be very soon since I've got most things resolved :)
    Thanks

    Hello,
    Thanks Stiffx :)
    Yeah, that is one of the hardest parts, since I want to allow both low level flexibility but designer friendly routines as well.
    So basicaly the way its going right now regarding this matter, is that one could work on a high level approach by using encapsulated actions and conditions which do not expose any ports at all to cluter the canvas and thus is a matter of controling the flow with flow nodes, (Branch, ForEach, Switch etc) and linking up Actions and Conditions.
    2015-03-12_04h32_53.png
    So in the above example, instead of exposing all those parameters of that Tween action as ports, which in this case there are quite many, they are only changable in the inspector, in a more..direct way.
    I think this is a valid aproach to minimize and simplify the effort if one needs so. By all means, let me know of your thoughts :)
    Thanks again!
    Hey!
    I am glad to hear that :)
    Im full throtle ahead to release this.

    Thanks
     
    Last edited: Mar 12, 2015
    Pajaroide likes this.
  3. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    I see, very nice. Are you using some templates to create the graphs or it can read normal C# code written by anyone?Anyways it would be good to reverse code to generate graphs.

    Like I sayd it's a very good idea
     
  4. nuverian

    nuverian

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

    The graphs are purely made in the editor and don't read or generate any code.
    With that said though, any function or property access can be turned into a node with reflection.

    Is that what you mean?

    Thanks! Im glad you like the idea :)
     
  5. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    Okay. If that normally when we does not have access via script to visual script. But you must make:
    1) Create function (or many uses of one group of nodes)
    2) Create clear working with prefabs. Power of C# scripting that create many universal script for all object who use this script. When we make any change in script and save it - script change on all object. I dont want to find all object and change manually on them all.
    When release? And if you need tester - i want ;)
     
  6. nuverian

    nuverian

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

    You kind of do have access to the visual script from code, in the sense of sending event flow signals, getting/setting variables, or getting the resulting value of a network. There is a very simple API for those things.

    1) Are you refering to Compound Nodes like this:
    http://forum.unity3d.com/threads/vi...or-unreal-blueprint-like.245646/#post-1976180 ?
    If so they are already there :)
    2) Yep, You can use the same visual script amongst any number of objects, prefabs or not. The visual script graph is stored in an asset file.

    I hope I understood your questions correctly. Sorry if not.
    Can't promise of a realease date yet, but it's soon enough :)

    Thanks!
     
  7. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    hmmm I see. I'm telling you this because the UE blue print actually generates C++ code.
    With that said, if your product can read an C# script and convert to a flow graph (and vice-versa) it would be THE product.

    For example, let's say I have my C# script:
    Code (csharp):
    1. public float Sum(float a, float b);
    and your project can read that and create the flow graph. "I know that there's allot of complexity in it" but worth a try :D

    Anyways like I said your project idea is very very good. Keep it up
     
  8. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    @Stiffx

    Are you sure? BluePrints generates C++ code, but only when you compile project. In Unreal you does not have access to blueprints variable, public function and etc from c++ scripts. Convert code in c++ when compile give us speed the same as normally scripts c++. And this is all.

    @nuverian

    As example. I create visual script with Gameobject.enable in method Start (As example - enable light). I save this scripts as prefabs (Name EnableLight). Assign on all my light GO in scene. Okey... Later i want to update scripts - i add change color of light. When i resave "EnableLight" - it has changes on all GO, who has this Visual scripts?

    In other visuals scripts it is imposible!
     
  9. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Sorry for the late replies guys.

    Hey,
    Yeah, I know UE blueprints generate code at some point at least.
    While I can understand the possible reasons of code generation, what would be the reasons of the other way, meaning generating a flow graph from code? I am just wondering, although to be honest it's not going to happen in this tool :)
    Code generation might do on the other hand at some point.

    Thanks.

    Hey,

    Yes that is correct.
    The Visual Script (lets call it FlowGraph), is an asset file. Any gameobject who has the FlowGraphController attached and the example "EnableLight" FlowGraph attached, will use that same FlowGraph. As a result any changes made to that FlowGraph are common.
     
  10. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello everyone!
    Here is a rather big update on the tool. (including things than NC people might know)
    Many of them are convenience stuff.

    Port Context Menus
    Dragging a port in empty space shows a context menu of common (not all) nodes that you can connect and do stuff with that type of port. This works both forward and backwards (as in the example)

    ContextSensitiveMenu.png
    Connecting Context Menu
    Dragging a port connection on a node shows a menu of possible ports to connect to, including convertions (see later)

    ContextOnNode.png


    Full Browser
    A node browser similar to the Unity's Add Component menu.
    In reality it can be used for any menu

    Browser.png


    Auto Convertions
    This is one of my favorites :). Instead of having to create a converter node, convertions are automaticaly handled for you in the binder connection context. Apart from the common type convertions, the converters are extendable and I took the liberty to also add "convertions" for Component>GameObject, GameObject>Component, Component>Component.
    While in reality the above are not convertions techinicaly speaking, it realy simplifies the workflow to have the ability to connect a GameObject type into an Animator one directly and then an Animator into a Transform etc.
    The icon on the connection shows that a convertion is happening there.

    AutoConvertions.png

    Generic Nodes
    Being a system tha fiddles with types extensively, having c# generics support seems something good to have I think :)
    A such, nodes<T> can be used directly, thus etremely minimizing the number of actual node implementations needed, like for example instead of ForEachFloat, ForEachString etc, there is a single ForEach<T>.


    Canvas Groups
    Like you guessed and see, canvas organization rectangle groups :)
    Groups.png



    The current list of available EventNodes is:
    • Code Event
    • Collision
    • Collision2D
    • CustomEvent
    • CustomEvent<T>
    • FlowGraph Events
    • Keyboard
    • Mouse
    • Oscillator
    • Trigger
    • Trigger2D
    • UIButton
    • Update


    The current list of available FlowControl Nodes is:
    • Coroutine State
    • Delay
    • Flip Flop
    • For Each<T>
    • For N
    • Latch
    • Sequence
    • Split
    • Switch
    • Switch Enum
    • Switch Int
    • Toggle
    • While
    • Merge AND
    • Merge OR
    • Merge XOR

    If you feel something is missing or have any suggestions or feedback, now is a good time to tell :)
    I am going to submit the tool to the asset store within this week!

    Cheers and have fun!
     
    Last edited: Mar 26, 2015
    Pajaroide and iviachupichu like this.
  11. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    This is just lovely nuvi! I've been working extensively with Blueprints in Unreal 4 and I honestly love them, so this here is very exciting! :D

    Cheers and great job man

    -Steven
     
  12. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh and btw Blueprint compiles to Bytecode, not C++.
     
  13. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Will it have custom classes action support ?
    I mean i create some Class with extending you system, for example i give it some Input variables and some output ones like :
    Input : Angle of Object , Angle for rotation
    Output : Transform
    Then we could use that new Class in your object as a black nox we could branch to other objects ?
    I think this is the main needed feature as we would be able to make any custom action components and branch them with other variables and other node objects.
    And it's less work on your side because you won't need to write thousand Actions supporting all Untiy features.

    Can we create one Flowgraph per object and some Flowgraphs per level ?

    Does it generates C# code when compiling to use them ?

    Can it be used to create and manage AI states ?
     
  14. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey Steven :)
    Thanks a lot! I am glad you like.

    Let me know if you feel something should be there ;)

    Cheers!

    Hello,

    I supose you mean creating custom Nodes? If so, yes of course you can create custom nodes with inputs and outputs :)
    There are various ways to extend the system.

    There is no special 'Level FlowGraph', but you can create one by having an empty game object and a FlowGraph on it as usual.

    There is no code generation involved, no.

    Can you clarify what you mean with your last question?
    Flowgraphs are not state machines, thus why I am asking in what context :)

    Cheers!
     
  15. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    How good is the performance compared to C# ?
     
  16. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    The system is very fast except in case of using reflection nodes.
    Calls from one node to another are direct delegate calls. Nothing really going in between.
    Furthermore values are referenced by their correct type, so there is no value boxing/unboxing.
    After release the reflection nodes will also get a major performance boost so that they also use same as above instead of method info Invoke.

    Cheers!
     
  17. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Doing the Unity rounds, and seeing how things are progressing Nuvi! :D
     
  18. nuverian

    nuverian

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

    I have made vast performance and convenience improvements and the tool is actualy ready to be commited to the store, if only I had written the documentation already, which I haven't :)
     
  19. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Can't we just use the Blueprint documentation for Unreal Engine 4? Hahaha...

    ...can't wait man and thank you for the update! :D
     
  20. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    Beautiful. Cannot wait to try this!!
     
  21. Wylaryzel

    Wylaryzel

    Joined:
    Sep 13, 2013
    Posts:
    126
    Very interested in the release - hope it doesn't take to long to get the documentation ready.

    Currently I'm evaluating different 'visualizers'. As this one and the NC are somehow based on the same idea - how much are both intergrated / connected together? Would it be possible to have the behavoir tree / fsm dealed within NC and this one dealing with more complex activities? And would both tools exchanges variable data and trigger events forth and back?

    Would be a big plus for myself.

    Thx in advance
     
  22. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Yeah. Hah. I suppose you could do that up to some extend. :)

    Thanks :)

    Hello,

    Both systems are build on the same core framework and as such they work quite well together.
    Variables, events etc can be common and can be send between one another. After release of FlowCanvas, I will also provide more in depth integrations with one another. For example having an FSM state being defined with a nested FlowScript, in which case the fsm will be sending events like OnEnter, OnUpdate and OnExit and you could define what happens in the FlowScript :)

    Cheers :)
     
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Any approx release date ?
     
  24. nuverian

    nuverian

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

    I just made a pre-release post in the Asset Store forum category :). Thus I am going to submit it in within the next few days, if not tomorrow.

    Cheers!
     
  25. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It is easy to use our own custom action nodes programmed in C# ?
     
  26. nuverian

    nuverian

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

    There are some different ways in which you can create a node for FlowCanvas.
    If you are after creating a simple node which mostly looks like a function, you can do so like this:

    Code (CSharp):
    1. public class Log : ActionNode<string>{
    2.     public override void Invoke(string text){
    3.         Debug.Log(text);
    4.     }
    5. }
    This is a node :)

    Log.png

    Similarily if you wanted to create a simple function node (which returns some value), you can do so like this:
    Code (CSharp):
    1. public class LerpVector : FunctionNode<Vector3, Vector3, Vector3, float>{
    2.     public override Vector3 Invoke(Vector3 from, Vector3 to, float t){
    3.         return Vector3.Lerp(from, to, t);
    4.     }
    5. }

    Lerp.png

    The above ways are for simple nodes. If you want more complex ones, meaning with any number of inputs and/or outputs and complete control, you can do so by extending the base flow node class. It's more complex but more flexible:

    Code (CSharp):
    1. public class Example : FGNode{
    2.  
    3.     public event System.Action<Flow> Out;
    4.     public event System.Action<Flow> Out2;
    5.     public ValueInput<string> text;
    6.  
    7.     public void In(Flow f){
    8.         Debug.Log(text.value);
    9.         Out(f);
    10.     }
    11.  
    12.     public void In2(Flow f){
    13.         //...do something
    14.         Out2(f);
    15.     }
    16.  
    17.     public float SomeValue(){
    18.         return 13f;
    19.     }
    20. }
    node.png

    There is even a third way, but I will leave it to those 2 so that I do not confuse you :)

    Basicaly because most of the custom nodes created will be Actions and Functions, the first way can cover most of the needs I believe.

    Let me know if you have any questions.

    Cheers!
     
    Last edited: Apr 15, 2015
  27. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This seems very eay to make custom nodes, that's just great as we are not tied to predefined nodes only.

    About the resulting final runnable code , it is some compiled C# fo all flowgraphs ?
    And what about performance , does it impact a lot compared to pure C# ?