Search Unity

[Released] uNode - Visual Scripting [Support C# Import/Export]

Discussion in 'Assets and Asset Store' started by wahid_rachmawan, Oct 18, 2017.

  1. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Thank you, i've more healthy now.

    Fixed in next update.
     
  2. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    I really like how uNode looks, especially the vertical theme, which is a good way of representing algorithms where the execution goes from top to bottom. But in case of a state machine, it doesn't look very good, because there can be transitions in both directions.
    So I think it's best if the outgoing connections go to both sides, and incoming ones go to the top or the bottom of the nodes. I happen to own another asset that allows creating state machines, see the screenshots for examples how it looks there.

    Here is a layout in uNode --->
    SM_001.png

    Now the same state machine made in the other tool --->
    SM_003.png
    I think it looks a lot more clear and flexible.

    Due to the rule about the connection directions, we get almost 360° freedom of placement of nodes that looks very good. --->
    FSM_004.png
    FSM_007gif.gif
     
    DavidLe360 and Skyfly like this.
  3. Innocent-Dev

    Innocent-Dev

    Joined:
    Apr 1, 2015
    Posts:
    23
    Then it will be problem to connect with non state nodes! statwe.jpg
     
  4. BebopTune

    BebopTune

    Joined:
    Apr 7, 2019
    Posts:
    25
    What about Bolt's port proxy approach?
     
  5. Innocent-Dev

    Innocent-Dev

    Joined:
    Apr 1, 2015
    Posts:
    23
    I think the problem with connections can be solved approximately as in the figure below. unode states.jpg But I think Wahid_rachmawan will send us all to hell soon!:)
     
    Szaruga likes this.
  6. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    You're right.
    It turns out that, unfortunately, State Machine in uNode will be ugly, even with proxy - it's bad (for me) :(
     
  7. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    I know that this problem can be solved - but it is certainly not easy and Wahid probably will not want to sacrifice for us.
     
    Innocent-Dev likes this.
  8. BebopTune

    BebopTune

    Joined:
    Apr 7, 2019
    Posts:
    25
    all go downwards, no crossing , is this not better than spaghetti? 1.png
     
  9. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Each system have a pros and cons and due to how the state graph works its not possible to make state node like that because its only good for state node but not if it combine with regular node because uNode doesn't have dedicated state graph so i'll leave the design as is.

    Yes this is what i mean, it doesn't seamless on combining with regular nodes.

    That's just hiding a stuff so its only improve a little bit.

    Yes its still not as good as expected, maybe a dedicated state graph may solve this problem but currently i still doesn't have a plan to make it.

    When all go downward how we can transition to initial state?
     
    Innocent-Dev likes this.
  10. BebopTune

    BebopTune

    Joined:
    Apr 7, 2019
    Posts:
    25
    I meant not like this , example in his image there is transition from state 8 to state9 . and look messy . instead connect directly to upward we clone transition, bring above of state9 and connect, this way vertical flow principle not violated.

    And not just for from down to up, if you want transition from state9 to state5 again that connection gonna cross lot of other connections and state nodes.
     
  11. BebopTune

    BebopTune

    Joined:
    Apr 7, 2019
    Posts:
    25
  12. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    I understand that it is not easy - to make a nice and clear state graph when it is not hierarchical and is integrated with the rest of things.
    However, I think that one of the basic ideas of visual scripting - is the ability to arrange the code in a visual form in the most clear and readable form. If I did not need it - I would probably created code traditionally.
    I still think that uNode is the best in its class, and you have accustomed us to the high level of your tool. Nevertheless, given that it is supposed to be a VISUAL tool - officially I consider State Graph to be the first significant disadvantage of uNode.

    Nobody and nothing is perfect. ;)
     
  13. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Then it will be similar to using Proxy:
    Capture.PNG
    Instead of copying transition to above it only mark proxy with dot.

    I'll consider to improve the State Graph again after some major update, from now i'll leave as is.
     
  14. Innocent-Dev

    Innocent-Dev

    Joined:
    Apr 1, 2015
    Posts:
    23
    How do you like that ? unode state.jpg
     
  15. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Its good but i think better of what we have now, since it doesn't show the transition name in graph.
     
  16. Innocent-Dev

    Innocent-Dev

    Joined:
    Apr 1, 2015
    Posts:
    23
    unode state 3.jpg
    Looks cute !!!;)
     
  17. BebopTune

    BebopTune

    Joined:
    Apr 7, 2019
    Posts:
    25
    So when we hover on dot we will see hidden connection?

    What about also put small state name under dot? We could understand where it go without hover on it . Hover on each dot for remember every time could be hassle.

    Like this.

    Screen Shot 1.png
     
  18. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    I suggest working on the state graph, when other important things will be ready and stable. ;)
     
  19. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    I think @BepopTune design is more clear and easy to implement since i just need to add name under the dot.

    Sure;).
     
  20. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    It is easy and improves the situation, but to a small extent.
    Alisia proposals are better - but much harder to implement.

    P.S.
    Maybe it's my fault, because I'm a person who is very sensitive to visual stimuli. I can see - quickly and efficiently pick up lines, connections, etc. - which helps me a lot better and faster to understand the graphic layout I'm looking at.
    I use proxy connections as a last resort and always try to make all calls as visible and transparent as possible.
    Therefore, in the case of state graph - such a layout is almost perfect for me --->
    SM_003.png
     
    laurentlavigne likes this.
  21. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Right.
     
  22. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    uNode v1.8b5 has been released.

    changelog v1.8b5:
    -Added Support region for Vertical graph.
    -Added ability to rename transition by double click on transition block (Vertical Graph)
    -Added store parameter value for StateEventNode and TransitionEvent
    -Added StickyNote
    -Added Once node
    -Added Timer node
    -Added Multi AND node
    -Added Multi Arithmetic node
    -Added Multi OR mode
    -Mark ANDNode, ArithmeticNode and ORNode to obsolete.
    -Improved CSharpGenerator
    -Improved Editor
    -Fixed some bugs

    Download here : http://maxygames.com/download/

    Note:
    • To convert old AND, OR, Arithmatic node to multi input just right click on node and select 'Convert to multi AND/OR/Arithmatic' and add new input inside inspector.
     
    Szaruga and Innocent-Dev like this.
  23. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    I´ve tested it on Unity v5.6. Especially in my case "many target" situations. OnMouseOver with many Targets. Than "TransForm.Rotate" Node with a GameObject-List of many GameObjects via the "ForEachLoop"-Node. Works as expected. Also the C# generation works / the C# preview. The interesting thing is, if i sometimes got errors trying "C# generation" which results in no generation of a C# script, i can use "C#-preview" doing "copy n pase" and et voila it works ! :)

    I am happy, we have a "add note" function and a "add region" function. Very helpfull !

    EDIT:
    When deleting uNode, because you want only to use your generated script, you need the file "RuntimeSMHelper.cs" as far as i know. But somehow it doesn´t work. It only works if i don´t delete uNode. Maybe you can put a "folder" inside uNode with all necessary files. Currently it is located inside "other", i think. Or is there a way to do it without additional files ? Would be great to add this important info inside the documentation and the uNode.unitypackage !
     
    Last edited: May 16, 2019
  24. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Two arithmetic operations - divide and power - show errors in inspector. In case of the "divide" operation, it happens only when using an Action node, and it compiles to C# code correctly. In case of "power" it's both in a normal node and an Action node, and it compiles incorrectly to ^ operator, which in C# means XOR instead of power.
    2019-05-16_18-00-06.png
     
  25. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    I have two suggestions:

    1. Add colored frames around values connected to a node (preferably optional?) --->
    sugg_001.png

    2. Add colored text in Action nodes --->
    sugg_002a.png

    edit//
    Possibly, following this trail --->
    2019-05-17_01-54-13g.png
    Do it - if it is easier --->
    2019-05-17_02-02-03h.png
     
    Last edited: May 17, 2019
    Innocent-Dev and BebopTune like this.
  26. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Thanks for good feedback.

    You'll need those file when using State Machine and i'll improve documentation on v1.8 stable is out.

    Error check bug will be fixed soon and for Power operator it look like c# doesn't have it by default so i'll convert ^ to Math.Power instead.

    It will be added in next update.

    I've try to implement it before but UI Elements look like doesn't support rich text.


    What this?
     
  27. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    For me, it doesn´t work just leaving the file "RuntimeSMHelper.cs" (only when the uNode.dll is inside the new project). Maybe you can doublecheck it, when you are doing the documentation for uNode and you have time for it.
     
  28. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    I meant a different kind of text coloring, where only the rightmost member type matters, not the types we get it from.

    For me texts like this --->
    sugg_007.png
    (That is much better --->)
    sugg_007a.png
    when in one color, are less readable than C# code in MonoDevelop or Visual Studio, where colors are used to indicate different kinds of code elements. [example] --->
    image_2019_05_17T15_32_01_853Z.png

    Here are examples of how it could look in uNode --->
    sugg_005f.png
    sugg_006f.png

    However, I understand that it is difficult to do or even impossible :(
     
    Last edited: May 17, 2019
  29. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Normally file inside 'Other' folder is all what you need, but if not please post it here.

    Sure it look much better, i'll try to implement it.
     
    DavidLe360 and Szaruga like this.
  30. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    @Szaruga ... good point. It makes really a better quality level of reading text, when using different color-code !
    @Wahid ... sure, i try to report everything, to improve "uNode". This is what i got, just leaving the files inside "other" & deleting the rest (Tested on Uv5.6, very simple scene):
    Assets/uNode_Code.cs(20,13): error CS0234: The type or namespace name `uNodeHelper' does not exist in the namespace `MaxyGames'. Are you missing an assembly reference?

    It works only, if i put "uNode.dll" in addition into the project. But this shouldn´t go this way, as i understood it. Maybe you can investigate into it, when you got some time. Maybe also some other users can test this, too.
     
  31. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Just found that using multi target in event makes uNode required 'uNodeHelper' class, i'll fix it in next update.
    Thanks for report it.
     
  32. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Top ! That would be great ! Thx :)
     
  33. BebopTune

    BebopTune

    Joined:
    Apr 7, 2019
    Posts:
    25
    can we also have color for c# preview?
     
  34. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    uNode have it, just import c# parser.
     
  35. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    Because a colored rectangular frame can be associated with "energy" flow, I think it's better to instead of this idea:
    sugg_004.png

    do this:
    sugg_008.png

    But it would be best to make both options available, so every user can customize uNode according to their own preferences.

    P.S.
    I'm sorry, if I expect too much, there are only suggestions. :oops:
     
  36. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    I've implemented border color on input port and a colored node and block title soon i will release new version.

    For the colored text inside button, this will available in the future update but i'll try to implement it and hope will available in next update too.
     
    Szaruga likes this.
  37. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    uNode v1.8b6 has been released.

    Capture.PNG

    changelog v1.8b6:
    -Now vertical graph is using asset file so users can makes new theme for vertical graph.
    -Added colored node title on Vertical graph.
    -Added colored block title for action & condition.
    -Added proxy name for transition in Vertical graph.
    -Improved Editor.
    -Removed Power operator, use UnityEngine.Mathf.Pow instead.
    -Fixed some bugs.

    Download here : http://maxygames.com/download/

    Note: i not remove dependencies with uNode when generating script using multi target in 'Event' because removing dependencies will need a new script file for every event like Update, LateUpdate etc. So i think its good to using existing script instead.
     
  38. eggeuk

    eggeuk

    Joined:
    Sep 1, 2013
    Posts:
    88
    Hi everybody,
    what a nice new release. A lot of wishes from forum members are build in.

    Indeed, now there are only some steps more, for getting a new official release of uNode.
    Time is coming for Unity Community to notice, that there is a new visual programming language doing ones work with style of VFX Graph. I'm really deeply eager about how Unity members would handle uNode.

    For my opinion presently to do:

    - FSM: Let FSM be in the state it is. There is enough stuff for building FSM graphs.
    If 'Spaghettis' are developed, a redesign should be better than new nodes. And we do have proxies.

    - Consistence: Every node and graph element should have the same behaviors as the other ones there shouldn't be differences.
    Example: Each node should be able to copy and past. Presently the nodes in an Action have no Copy/Past.The Action Block itself could be copied but not the nodes within.
    We should have a look if those things do happen.

    - Being smart: There shouldn't be things where User have to reflect of doing things this or that way and even why.
    Example: In 'uNode editor>uNode_obj' there can not be found the word 'Method'. But in 'Right Click Menu > Goto' there is '[0]Methode 0' (or more of this). Clicking this menu point the graph is focused to an event node, this with a name without the phrase 'Method'.
    How should a newbie understand this? Three places, diverging names and one functionality.

    - Specially for consistence and being smart as an example is the problematically renaming of pasted nodes:
    Please see picture. The correctly way is done by C#-Compiler - how else? - but not within uNode Editor.

    OK! Going further?
    Wahid is working within the code of uNode. There is less time left for work on documentation and user experience (UX).
    What forum members could do is testing all parts of uNode, but they too would have less times.

    Well, what else could be done?
    There should be some testing about workflow with uNode and some building of more documentation for potentially new users.
    Both could be done by rebuilding the old Unity Examples and even some new ones. Building from ground up within uNode, not importing of C# code.

    And it would be helpfully if having some (code) Graph Snippets for using in ones work. Just a kind of library with good examples of users work. Such as: Building Primitives, UI example, FPC, ...
    And as I'm reading my text I'm thinking: Why not having an example of every important node of uNode? Yes, I do mean every - static types if necessary.

    For timing of this all: Not done within some weeks, but till end of summer.
    Then uNode Vertical Graph as a revolutionary new step of programming may be introduced to Unity3D World.

    For myself remains of wishing success for managing the next great release of uNode.
     

    Attached Files:

    Last edited: May 22, 2019
    Szaruga and BebopTune like this.
  39. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    Thank you for better and better uNode. :) However, I have some important remarks about the new features.


    1. Functions (methods) should have a special color, used only for them.

    2. Currently in the expressions where members are accessed, only the leftmost element is colored, and the rest are left white. I think every element of such expression should be colored. I can think of 2 options here: Every element should have its own color, or the entire expression is colored according to its rightmost element, which is the most important, because it determines the type of the whole expression.

    3. The "#Nodes" or "#Pin" text should be colored according to the type of connected value from nodes.

    4. If a function's return type is "void", the "store to" part shouldn't be displayed.

    5. Function parameters should be colored according to their type, also when used inside the function.

    6. I think instead of "List.get_Item(index)", it should be displayed as "List [index]", or at least getting an item from a list should use a separate color.

    7. The color of enums should be the same in action blocks and normal nodes (currently it isn't).

    sugg_01f.png
    sugg_02f.png
    sugg_03f.png
     
    Last edited: May 22, 2019
  40. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Hey, just tested the fresh build.

    "Note: i not remove dependencies with uNode when generating script using multi target in 'Event' because removing dependencies will need a new script file for every event like Update, LateUpdate etc. So i think its good to using existing script instead." < Don´t know what this means (especially : "using existing script instead").

    Sadly, it is the same as before. I got the same error (without uNode.dll):
    error CS0234: The type or namespace name `uNodeHelper' does not exist in the namespace `MaxyGames'. Are you missing an assembly reference?

    And with uNode.dll, it works as before. Just these errors came across:
    TypeLoadException: Could not load type 'MaxyGames.JsonHelper' from assembly 'uNode, Version=1.7.9.6, Culture=neutral, PublicKeyToken=null'.
    MaxyGames.EventSystem.ESAction.OnBeforeSerialize ()
    MaxyGames.EventSystem.ESAction.OnAfterDeserialize ()


    So does it mean, we will have a chance, got the generated code working without uNode.dll ? Or do we need this little file ?
     
  41. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sure copy/paste Action & Condition will available soon.

    This will be fixed soon.

    Auto rename on paste will available in next update.

    Sure this still on roadmap but not yet started maybe when the v1.8 stable will released.

    -Are you mean a Graph Snippets for creating a new graph or what?

    -An example of most important node can be found in the documentation but its only most, i still don't have time for work on documentation.

    Thanks for your feedback and suggestion.

    Thanks for detailed remarks, i'll improve color as you say for next update.

    I mean you'll need uNode.dll when generating script using multi target in 'EventNode'.
    So if you want to get pure c#, don't use multi target in EventNode, i planned to fix it in v2.0.
     
    Szaruga likes this.
  42. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Sorry, but I have no idea what an EventNode or multi target is. o_O:confused:

    and...
    1. In the "Add Node" window, there are several categories: All, Function, Variable, Property, Type. But "Values" uses a separate button, and it's not included in "All". What's the reason of this?

    2. Is there a chance uNode will allow using preprocessor directives (and parsing them)? Allowing platform-dependent compilation would be useful in some cases.

    3. Which version of Unity should I use with uNode? Do you recommend using version 2019.1.0f2, or updating to a newer version?

    4. There seems to be a problem with anonymous functions that started with uNode version 1.8b5. In versions up to 1.8b4 it worked properly, and in later versions it causes errors.
    Unity 2019.1.0f2 + uNode v1.8b4 (correct) --->
    error_002.png
    but in uNode v1.8b6 (and b5) --->
    error_002a.png
    error_002b.png

    5. When using the "Display Full Node Name" option and the vertical theme, some function parameters are displayed incorrectly as NULL. --->
    error_003.png

    6. After re-enabling the uNode editor and even after compilation - nodes change their location (red). It would be fun if it was possible to stay straight down(when I set such positions myself)?(green) --->
    error_004.png
     
    Last edited: May 24, 2019
  43. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Ah ok...i was really wondering why nothing related to my report was fixed. "..., i planned to fix it in v2.0." Good, i can wait until v2.0 will fix this issue with "Multi-Target in Event-Node" ! Really important for me & other users, i guess. And ya, we need pure C# code output ;)
     
  44. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Multi target in Event node:
    Screenshot (304).png
    Its can receive event from one or many game objects.

    1. Because in 'Values' its only have Type so no need for category and why its use 'Values' button because if anyone want create a new instance they can click on the button and find what the type they want to create the instance.

    2. Yes for generate preprocessor and No for parsing c#.

    3. I recommend using Unity 2019.1.0f2 because uNode still in BETA.

    4. You may fix it manually by disable

    5 and 6. Will be fixed soon.

    Thanks.

    Edit: for num 6 i can't reproduce, in my it work as expected.
     
    Last edited: May 25, 2019
  45. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    What? o_O

    From the beginning:
    To arrange nodes straight as in the picture --->
    upload_2019-5-25_20-57-40.png
    1. I need to spend some time using the 2.0 zoom
    2. After re-enabling the editor, after compilation or when moving the group of nodes together - sometimes nodes change their position themselves - maybe because I don't use the snap node option
    3. I don't use the snap node option - because with this option it is impossible to arrange the nodes as in the picture above
    Here we go again to point 1...

    edit//

    You still have not improved it --->
    2019-05-24_19-35-14.png
    2019-05-24_19-37-17.png
     
    Last edited: May 26, 2019
  46. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sorry forgot to complete write it.
    -You can manually fix it by disable debug value node, i think you not use it but the serializer save it as true so you just to enable and disable the debug:
    Capture.PNG
    Let me know if it works.

    Thanks i found the bug cause this happen:
    -When re-enabling the editor using different zoom the bug may happen, it not change the position but change the width of the node because of zoom effect and currently i not found a way to fix it because its from unity side.
    bug.gif

    you mean for validation or if?
     
  47. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    If I set it like that --->
    2019-05-26_07-03-36.png
    I have such errors --->
    2019-05-26_06-59-36.png 2019-05-26_07-00-27.png

    Only this setting seems to work --->
    2019-05-26_07-13-11.png
     
  48. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    Only one in four exploration trips end up finding an artifact with a mysterious name: "This" ;) --->
    this_01.png
    but...
    this_02.png
    and...
    this_03.png
    and...
    this_04a.png

    This is not in the action nodes :(


    ---> ;)
     
    Last edited: May 26, 2019
  49. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    I mean enable then disable debug option again to trigger the uNode to save the settings.

    Thanks for the report it will be fixed in next update.

    Sorry for forgot it because i not add it on roadmap before, it will be fixed in next update.
     
  50. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Thanks. :)

    Problem with the action block:
    Everything is OK here --->
    go_00.png

    However, in the action block - it doesn't work --->
    go_01.png


    You have to use a trick --->
    go_02.png

    go_03.png

    edit// This problem also applies to other things that work similarly
     
    Last edited: May 26, 2019