Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[DEAD PROJECT] Visual Programming for Unity.

Discussion in 'Works In Progress - Archive' started by Cynicat, Jul 21, 2014.

?

Are you interested in a Visual Programming System?

  1. Yes!

  2. Only if it where really powerfull.

  3. Only if it where really easy to Use.

  4. Not Really...

Results are only viewable after voting.
  1. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    [Re-Written... again]
    Ok so this is a personal project.
    Maybe asset store since some people seem to be interested. Maybe.
    The idea is simple.
    design a graph based way of making scripts.
    that means you get a normal c#/java script just like you might write.
    that is all.

    Tenets:
    Tool not System. more design philosophy than anything.
    Clean UI.
    Ease of use.
    Low level control(you can use text nodes to say what code goes where).
    No bullshit. you get code. you should be able to un-install this addon and your code will work.
    Like code. but graphs. this means i want all the functionality of normal programming(kinda stretch goal).

    Details:
    Graphs are basically classes. you add functions, variables, etc...
    graphs also have a special trick. they are both nodes and scripts. the idea is from substance designer, you add input's and outputs. these allow you to easily create new nodes. in script these become functions, public variables and messages(google the unity messaging system).

    Nodes are the logic blocks you add to the graph. these can alter data, execute functionality, or even have hidden logic(like having a node that needs to be initialized it could hide that logic inside itself). they also use built-in inspector and such.

    Ports are what connect all the nodes. yeah not much to say. they connect things.

    Final notes:
    I'm a game engineer. i need something really powerful. but i also don't like typing. it hurts my wrists. so yeah. that mean's i'm not making this just for level designers. i know how to code pretty damn well. i have no reason to make something that isn't up to stuff like voxel engines, open world system's and really anything i feel like making at the time. i just want something that lets me build a script out of components. unity is a component based engine(game is made of scenes which are made of gameobjects which are made of components). i want to take that further and say that scripts are made of nodes. i like the idea that one day all i would have to do for really good character control is something like this:
    Icons.png

    i recently re-designed the framework. this means i rebuilt it from the ground up. finally got back to the UI phase so i still need to get it up to snuff visually but the new system is kick-ass! now with ZOOMYNESS and panning! so yeah. that's a thing. i'm going to go sleep now. its 4 a.m. dont become game dev's kids. you will work WAY to much. and i thought 8 hours was alot 3 years ago... now i do 12-16 hours a day... sigh.... have a great week guys.
     
    Last edited: Aug 17, 2014
    boshko, Eric2241 and EBR like this.
  2. KheltonHeadley

    KheltonHeadley

    Joined:
    Oct 19, 2010
    Posts:
    1,685
    Playmaker? The other alternatives. Seems you're just reinventing the wheel.
     
    Deleted User likes this.
  3. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    playmaker is a great state machine system but is pretty bad at designing logic. the other alternatives are too focused on the idea of being programming for non programmers and as a result are too weak to make anything that requires a lot of complexity. closest would be UScript and the interface on that one gets so tangled so fast its nearly impossible to read. also I'm pretty sure you have to have the addon to run the code it makes. i want to make something that makes standalone code and isn't invasive to your workflow(especially for teams you cant force your team to buy an addon just so you can run a visual script.) also UScript doesn't generate very good code.
     
    boshko likes this.
  4. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    uScript is the best in all I think.
    If you think you have better option and have some beta tester requirements then please add me in your list. I have 1 year+ experience in using uScrip.
     
  5. vidi

    vidi

    Joined:
    Oct 14, 2012
    Posts:
    175
    That is only your subjective opinion

    My brain is so fit with playmaker, I want not change it anymore.

    Uscript was very confuse for me .
     
    Kellyrayj likes this.
  6. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    So, this system would allow you to visually design/write your classes. Once designed, it would actually generate a code file for you to then use (C#, JS, etc)? Whats the advantage of this? Once the class is modified, surely your graph editor will break, or it will just overwrite the changes made?

    I can see some advantages of being able to do more complex logic, but I would love to see a true comparison between say PlayMaker and this, to see how your system can achieve something quite complex in a simpler manner than PlayMaker.
     
  7. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Just this morning I was thinking of such a node based approach to scripting. I was wondering what was keeping someone from doing this (and why is it hard to achieve, what can be the downside)
    I hope, complex scripts can be efficiently generated with a node based approach.
    I always find it hard to follow when a script gets too long. I hope such an approach can get over this.

    I've been using Uscript for 2 years, I find it quite useful and well done. I know what I'm doing with Uscript, I only wish it would generate code that could be easier to follow. But I understand that"s not an easy task.

    What other visual scripting assets don't do is Inspector scripting. I have no experience with this but you might wanna take a look the possibility.

    Hope to see and use this asset someday.
     
  8. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    yeah since its designed to support inheritence you will totally be able to extend the editor! as for the code heres an example of how my system generates code:
    this:

    becomes this:
     

    Attached Files:

  9. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    for the code part i use 3 methods to allow you to both text script and visual script at the same time.
    1. snippets are nodes where you can copy paste code into them and it will paste that code into the file(how our nodes are made).
    2. c# partials make it easy to add logic without touching your original code.
    3. java doesn't support partials so you prolly couldn't add to the same file. however you could write a base class you inherit from. one thing i could do with java is have it recognize altered text and make Text Nodes out of them(therefore not breaking your script) but that wouldn't be on release.

    the main use of a graph system like this is that you could program with the graph without having to worry about stuff like your team not having the addon and such. just make scripts the way you would but with a graph interface. at the end you have a text script like any other and therefor with all the advantages that come with it.
     
  10. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    its currently not stable enough for beta but when it is ill send you a beta copy! =3
     
  11. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    i love playmaker but there are alot of extra steps in getting logic working and when its finished its harder to understand. at least in my experience. =3
     
  12. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Thanks for the clarification.

    So, just so I understand, can you only block out code using this tool, or write the entire class via visual scripting? For example, could your example for the movement produce a fully working movement class that can be added onto a gameobject? If so, could you provide an example of that? Would be interesting to see the full workings.
     
  13. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    its designed as a way of programming through a graph. so the focus is programming from scratch to a full script(wouldnt just have to be monobehaviors, could be anything) the code i showed was pseudo code. you would be able to graph out the logic for movement and jumping and such. its point is to be an alternative way of programming more akin to building a flow chart but otherwise would allow you the full power of programming.
     
  14. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Does sound quite interesting now I understand it more. Ive been programming for 5 years now, but just started using PlayMaker a bit more because of its quick prototyping abilities, and because others who cannot program can come into the project and understand whats going on. However, as people have mentioned, doing really complex stuff is not as simple as we would like, where as your asset might fill that void.

    I would love to test something, and help give some input as to features and additions. Would be great if you could add me to your beta list when you are ready :)
     
  15. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Cool idea for a new generation of visual-scripting for non-coders or wannabe-coders. About PlayMaker: What i read in their statement is, that PlayMaker is probably 10% slower than a real code. That is a fact ! This is something i really don´t like ! About uScript, i read only that it is like "real C# code". Whatever...what i saw on YouTube of uScript, is that it looks very confusing, cause of bad desgin. Would say, not really a benefit for designers. So i prefer PlayMaker. But i am curious what your solution would get better... :) (maybe you can make a YouTube video that shows your work in action)
     
    Last edited: Jul 22, 2014
  16. Kinos141

    Kinos141

    Joined:
    Jun 22, 2011
    Posts:
    969
    I think what will set apart your project from the rest is too add gameplay mechanics as nodes. Nodes like physics and character controller jump node, character controller with parameters, scene fade in and out, line of sight and behavior components for AI just to name a few.
    I personally like PlayMaker, but I think added actions that do directly what I want instead of stringing together nodes until I get the desired effect would be more... desirable. Right now, the current solutions make nodes of the Unity API, which is cool, but can be better.
     
  17. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I would say , study UE4 blueprints and give us something as good to sue and as clear.
     
  18. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    That sounds great! one of the features that ive been looking into is hidden behaviors. this would be like having a player movement node that had both Update behavior and behavior for when the game starts. i think that would really help with what your talking about. thats perfect since the main reason i'm making it is re usability. so have game mechanics, check!
     
  19. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    yeah i'm looking to make something with a similer idea though i'm trying to make it closer to Unity scripting. though certain features like the drag to create node are a must!
     
    zenGarden likes this.
  20. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    when its ready for beta ill add you to the list! =3
     
  21. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    that is probably a better way of showing how its supposed to work than explaining it with screenshots. will do! =3
     
  22. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Made a dev diary showing off the general idea of the system. warning: may have to wait a bit for youtube to process the thing.. =(
     
    boshko and mimminito like this.
  23. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Awesome stuff! Sounds like it could be promising, cant wait to try it out.
     
    boshko and Cynicat like this.
  24. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Right click node creation! no more giant buttons on the top left! =3
     

    Attached Files:

    Last edited: Jul 24, 2014
  25. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Seems like your making progress!
     
  26. Kinos141

    Kinos141

    Joined:
    Jun 22, 2011
    Posts:
    969
    Saw the video.
    My advise is to not focus more than a few seconds on what doesn't work. You want to be positive about the project at all times to sell the idea so you can sell the product.
    I would've said, "This is an alpha build, not all features work as of yet..." then move on to the features.
     
  27. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    just wanted to be clear why i didnt have the thing open for beta yet. but thanks for the advice. mostly i'm making this for my own use but ill probably toss it up on the asset store since there seem to be a few people interested.
     
  28. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    its now in a scrollview so you can pan around the canvas!

    you can scrub around the canvas now. need to add middle click panning but other than that its ready to receive larger graphs now. =3
     

    Attached Files:

    boshko likes this.
  29. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Thx for Video. Looks really promising. I like the idea to see the code behind the node. Its also good, simply to learn more about scripting, as a lazy designer.
     
  30. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    I love the logic part of programming and i just wish we had a platform where artists, designers, and programmers can all take full advantage of the tools we have without needing a bunch of years of study. also helps programmers focus more on what there doing rather than how to do it. hope i can make something that meets that. =3
     
  31. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Re-wrote the post to be more clear as when i wrote it i was half asleep. also added proper node sorting, animator style. =3
     
  32. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Update: custom node styles! i can add custom graphics to each node type. =3
     

    Attached Files:

    boshko likes this.
  33. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Good progress.
    About colors, you could take covention colors like :
    color1 = test functions, color2 = variables, color3 = branching functions, color4 = physic functions, color5 = movement functions, color 6 = appearece functions, color7 = Array etc ...
    For the titles on the boxes, perhaps make the font in another color font and some bold one ?
     
  34. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    I love the look of NodeCanvas, they have got a really good theme going on, its clean and simple. Not saying you have to go that route, but some feedback from me would be to make it nice and clean and clear.
     
  35. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    yeah the interface looks very clean! thanks for pointing it out. =3
     
  36. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    posted a new dev video showing off the new features.
    . sorry for being rambly, a little bit sick today.
     
    TechnicalArtist likes this.
  37. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Looking better and better. Im so intrigued by the development of node based editors, any tips on where you began?
     
  38. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    graphs themselves are pretty simple, Graph[contains nodes and edges], Nodes[contain slots], Edges[Connects two slots], Slots[sit there and look pretty]. you can do it without slots as well. i recommend practicing with game objects with nodes and edges first. the thing i had the most trouble with was the way unity does the editor saving and assets. also i recommend if you want to make some complicated graphs you should google partials(they are awesome). hope that helps. glad someone is enjoying seeing my work =3.
     
  39. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Thanks for the info. Im just interested in how they are built, and would like to have the knowledge about how to create one. I dont have a use for it yet, but would love to get a working example.
     
  40. zRedCode

    zRedCode

    Joined:
    Nov 11, 2013
    Posts:
    131
    sorry, i prefer C#. After you have learned it, is more simple read C# than this visual programming system.
     
  41. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    the interface does need to be cleaned up alot. and i'm not claiming everyone will like it better. but i would like a method of making code that was more designer-ish. but with the full power of programming. sometimes i dont feel like killing my wrists with all the typing. my goal is that it should be faster to make and cleaner to read at the end. but yeah atm its not(hence the work in progress part).
     
  42. zRedCode

    zRedCode

    Joined:
    Nov 11, 2013
    Posts:
    131
    Cynicat: nothing is better than code. Visual programming is only an exscuse to not learn C#. Unity isn't gamemaker, is a bit professional tool, and like other professional tools require to know a programming language. Visual programming is good only if you have to make a prototype. But when you have to code, fix bugs, you need to dig into the code.
     
  43. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Im sorry, but thats just an opinion. If this was the case, then UE4 would not have BluePrints. Visual Programming is great for many things, not just because you want to make a prototype, but maybe because you want to visually represent a system you have in mind, maybe you want some better live debugging support (PlayMaker), or maybe you have a team of people, some of which do not know C# (as its not their profession) but they can understand a visual system.

    There are many reasons that Visual Programming systems are good, and bad, but I dont think that this topic is the discussion for that. Its to help encourage the developer to carry on what he is doing, and to give him feedback on his system, not feedback on why he should not be doing it...
     
  44. zRedCode

    zRedCode

    Joined:
    Nov 11, 2013
    Posts:
    131
    Sorry but before writing code in mono i have 1 page with flux diagams explaining what im going to code, in one complete game i have over 200 pages. Hand written. Visual programming can help me with this, but when you have to fix bugs? I prefer code. I know 7 programming languages. i have spentd 1-2 months for each language to learn it, after learned it nothing has stopped me. visual programming is only the way to avoid studying code. I really not see benefits from it.
     
  45. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Thats fine, we all have opinions. Now lets leave this thread for updates to his system, not for a discussion on why its a bad idea.

    Apologies for the hijack @Cynicat
     
  46. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Flaws in your logic:

    1. Visual programming is harder when fixing bugs?
    let me throw you same stats.
    Humans can process information 60x faster through visual input than text.
    Humans notice flaws in visual information 240x faster that text.(all humans skim to a certain extent, it results in us being able to read misspelled text and misread text alot, however in code where a single missing + can mean a broken program reading through pages of code without visual aid has a huge margin for error).

    2. Its just an excuse not to learn c#? i know 8 programming languages(2 are outdated, 1 is rusty). let me tell you something. a history lesson if you will... back in the days before simplicity focused languages like c# people much like you said that languages like that would never work because they couldn't handle complex logic(managed memory etc...). they said that managed memory was going to lead to tons of bugs, that the object oriented approach wasn't powerful enough to handle anything on its own. etc... now look at it. its the go to for easy programming. its incredibly powerful. you bitch about how its just an excuse for not learning a programming language the same way people bitched that c# was a dumbed down version of c++. i started on c++ and moved to c# because it was easier, faster, cleaner, and simpler than c++. i can write logic that would take me hours in c++ in 15 min in c#. you are a hypocrite. by simplifying programming we allow more people to access the logic and make it easier for programmers to focus on what they are doing rather than how they do it.

    3. Unity isn't gamemaker. OK this one cracks me up! let me slap you in the face with reality for a second. do you know one of the best tools for making an old-school JRPG? do ya? RPG Maker... something designed for simplicity and designing... you guessed it! old-school RPG's... so we shouldn't be making tools to make programming easier according to you(see above entry for more details /\ ). yeah... again while bitching about how c# is the only real way to make a game.

    4. nothing is better than code. let me once again go to my science nerd roots and throw stats:
    lets do a test. using an If statment(really simple to write)
    c#: about 12 keystrokes.
    Graphs: hold I and click.
    running a function:
    c#: average about 5-16 keystrokes(with auto-complete)
    Graphs: hold the appropriate key and left click the menu item(see shaderforge for what i mean)
    you get my point.

    and finally, your going onto someones WIP page and telling them they are wasting there time. i dont go onto your games page and tell you your game is S***. its rude, disrespectful and makes you a troll. however even though you are kinda being a dick. i wish you a good day. our industry is one of co-operation. one where programmers programmed tools for 3d artists to make awesome models and animations. ones where 3d artists make assets that programmers use in there games, animators make animations, etc... this industry thrives on bringing us together(sappy as it sounds). we need to be more connected not less. something happened the other day that gave me new resolve for this project. i was testing flux, making a simple script. my friend walked up behind me and started reading over my shoulder. i casually asked if you understood what it meant and he recited exactly what it does to me. he was very interested in it... he is not a programmer, hes not even a PC user. hes a console gamer who doesn't know what directX is. that why i want to do this project. i want to be able to work alongside designers, artists and programmers who can all use the power of constructive logic.
     
    boshko likes this.
  47. gameseizer_00

    gameseizer_00

    Joined:
    Dec 20, 2013
    Posts:
    124
    Wow. You must be very smart. Good luck with your visual programming.
     
  48. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    thanks =3. most programming languages are very similar so it gets alot easier the more you learn. first is hard, second is hardest, then it gets way easier.
     
    GarBenjamin likes this.
  49. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Update: new UI. what do you guys think? if you look at the FixedUpdate node i show the new tooltip feature for when you mouse over pins. =3
     

    Attached Files:

  50. TheSin

    TheSin

    Joined:
    Aug 4, 2011
    Posts:
    150
    Looking good and nice progress.

    I myself am very much a coder but haven't gotten into visual scripting although, like you posted, artists, non-coders etc find them great and playmaker, uScript and ue4's blueprint show how important and intergrated they are becoming in game design.

    I've been writing my own coding based node system for a while now too but am aiming it very much at coders but with its plugNplay architecture will allow sharing of behaviours and incredible customization etc.

    Anyway, nice progress shots, I designed my system from scratch with zooming functionality, node customization and custom tools that can be easily expanded. Zooming was initially a nightmare especially since nodes can have multiple parts, have un/nested nodes and custom visual inspectors but have it flawless now. Alot of crazy stuff going on.