Search Unity

Visualize (Visual Logic Editor for Unity)

Discussion in 'Made With Unity' started by jerrodputman, Nov 11, 2010.

  1. jerrodputman

    jerrodputman

    Joined:
    Jun 4, 2008
    Posts:
    181
    Hey everyone,

    So with the announcement of the Asset Store, I figured it was probably time to announce a plugin we've been working on the past few weeks.

    It's called Visualize, and as the name suggests, it's a visual logic editor for Unity. If you have any experience with the Unreal engine or UDK, you know that Unreal's Kismet is a very powerful tool. Well, Visualize essentially brings that awesomeness to Unity.




    And here's a nice big copy-pasta from our website (which has bigger and better screenshots):

    Creating a custom action looks something like this:

    Code (csharp):
    1.  
    2. [SequenceAction(Title="Spawn Enemies", Description="Spawns enemies.")]
    3. [InputLink]
    4. [OutputLink]
    5. public class SeqActSpawnEnemies : SequenceAction
    6. {
    7.     [VariableLink(Title="Pool")]
    8.     [SerializeField]
    9.     private SeqVarSpawnPool spawnPool;
    10.  
    11.     public override void OnActivate(int triggeredInputLinkIndex)
    12.     {
    13.         base.OnActivate(triggeredInputLinkIndex);
    14.        
    15.         // Do cool stuff here!
    16.        
    17.         // All done.
    18.         TriggerOutput(0);
    19.     }
    20. }
    21.  
    The plan is to release it via the Asset Store (provided it's approved). No pricing or release date is set yet, but I will say that it is fully functioning right now (we're using it ourselves), so it's not some far-away thing to hope for that'll never get released.

    NOTE: The initial release will probably only include a few built-in actions, events, and conditionals, so DON'T expect to use this as a visual scripting system (at least out of the box). Its real power (and Unity's, for that matter) comes in its extensibility and broad applications.
     
  2. Tilluss

    Tilluss

    Joined:
    Mar 5, 2010
    Posts:
    34
    Looks pretty good, any idea's on price just yet?
     
  3. CorruptScanline

    CorruptScanline

    Joined:
    Mar 26, 2009
    Posts:
    217
    Looks great, good work.
     
  4. jerrodputman

    jerrodputman

    Joined:
    Jun 4, 2008
    Posts:
    181
    Not yet. We're trying to find that balance between "this is something that's very useful and a lot of hard work was put into it" and "OMG that's too expensive I hate your face!"
     
  5. laurie

    laurie

    Joined:
    Aug 31, 2009
    Posts:
    638
    I've been asking around looking for a generalized node/graph editor so this is very interesting. Does it include the ability to define custom graph types and associate nodes (actions/variables/etc) to that graph type? For example, could you create a 'shader' editor that only offered shader-related types of node? Or is it a single unified framework (so any action/whatever you define becomes available in every graph)?
     
  6. granada

    granada

    Joined:
    Oct 31, 2010
    Posts:
    135
    For a complete programing novice like me this will be great,i tried the
    Unreal's Kismet version got things to workalmost strait away.I have decided
    to use Unity as i find it a lot simpler to use,Just need the money for pro now.Anyway
    thats enough rambling,thanks for all your hard work on this.

    Dave
     
  7. thellama

    thellama

    Joined:
    Mar 25, 2010
    Posts:
    360
    Looks like custom actions need be defined in C# only? I understand C# is the general coding platform for extensions, but I worry, since our development is entirely unityscript, there could be problems?

    In other words can I define custom actions in C# and still hardcode the rest of the game in unityscript without running into issues? Or is there anything you could foresee being a problem.

    It looks awesome, but I think one thing I'm struggling to understand is if nothing is hardcoded, say I have an enemy and I build the logic for his AI and patterns, can I save that logic system out, reapply it to different enemies and alter the values like a script in the inspector?

    E.G. can you reference already created logic systems as individual instances?

    Another question, can we contact the logic via scripting. So can I output some of that information into a script or even have a script look into the logic editor, find a value and retrieve it?

    I only ask so many questions because I'm very interested in buying this once it becomes available, but I will not pay "OMG that's too expensive I hate your face!" :D
     
  8. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Last edited: Nov 11, 2010
  9. jerrodputman

    jerrodputman

    Joined:
    Jun 4, 2008
    Posts:
    181
    Hi guys. Sorry, I had to sleep sometime, heh.

    At the moment, it's designed towards the unified framework style, meaning everything (actions, variable types) is available to every graph. The backend is flexible enough to create a "shader-only" version of it, but that's not publicly accessible. However, what you're suggesting is pretty interesting. So, while I'm not making any promises for that sort of functionality, I'm certainly going to look into it.

    Good questions. First off, you can definitely write your custom actions/events/conditionals/variables in JavaScript. That would look something like this:

    Code (csharp):
    1. @script Visualize.SequenceAction(Title="Spawn Enemies")
    2. @script Visualize.InputLink
    3. @script Visualize.OutputLink
    4.  
    5. class SeqActSpawnEnemies extends Visualize.SequenceAction
    6. {
    7.     function OnActivate(triggeredInputLink : int)
    8.     {
    9.         // Do cool stuff here!
    10.  
    11.         TriggerOutput(0);
    12.     }
    13. }
    Sidenote: If anyone knows of a way to do a "using" style directive in UnityScript so that you don't have to throw "Visualize." everywhere, I'd appreciate it!

    Secondly, the sequences are entirely instance-based, meaning that a sequence is only ever attached to a single GameObject. Two examples: 1) You have a prefab that you're using to instantiate from, and that prefab has a sequence attached to it. When you instantiate that prefab, each new GameObject has its own copy of the sequence, so they can execute independently. 2) If you've got a GameObject in your scene with a sequence, you can then duplicate the GameObject, and then modify the sequence on the duplicated GameObject without modifying the sequence of the original GameObject. It behaves like any other Unity component.

    And lastly, as for getting info "out" of the sequence, it's possible, but possibly not as straightforward as you (or even I) would like. Your custom actions can take a reference to any GameObject (there's a GameObject variable type), and you can have that custom action write or send information to that GameObject, but the reverse might be tricky. Let that simmer in my brain for a bit, and I'll get back to you on it.
     
  10. jerrodputman

    jerrodputman

    Joined:
    Jun 4, 2008
    Posts:
    181
  11. thellama

    thellama

    Joined:
    Mar 25, 2010
    Posts:
    360
    Your answers were just what I wanted to hear. Logic in JavaScript, I'm sold! Where do I send my blank check, SS number and bank information?
     
  12. Jingle-Fett

    Jingle-Fett

    Joined:
    Oct 18, 2009
    Posts:
    614

    Edit: When's this coming out?
     
  13. jerrodputman

    jerrodputman

    Joined:
    Jun 4, 2008
    Posts:
    181
    Very soon, hopefully. We have some beta testing to do first and foremost, and we're also waiting on Asset Store approval. Of course, if that takes too long, we may just sell it directly.

    My best guesstimate is by the end of this month (but hopefully before that).
     
  14. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Hey cool logic editor! I was going to start writing my own very soon leveraging all my window tech but seeing as you have already done it I might not have to bother!

    How are you finding the API's and stuff to work with?
     
  15. jerrodputman

    jerrodputman

    Joined:
    Jun 4, 2008
    Posts:
    181
    The Editor APIs? For the most part, I quite like them. There are a few bugs though: The HideInHierarchy hide flag just... doesn't work; the EditorGUILayout.PropertyField doesn't work properly with vectors if it's called *after* drawing GUI windows; and I never quite got the data format I wanted for the sequences (though it works perfectly fine how it is). The best part is having all of the Mono/.NET stuff available. The plugin literally wouldn't be possible without some of the more advanced features of .NET.

    By the way: Love the shader editor you developed! It was sort of an inspiration to me that a tool like that could actually be done in Unity (and look like it fits).
     
  16. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Yeah. You may run into some issues in the future with the unity windowing system. We ended up writing our own and styling them like 'Windows'. There are a few gotchas and areas that could use better documentation / improvements but overall we are pretty happy with how it all turned out. Some time in the future I'll be packaging our windowing system into a dll. If you start running into issues I'll get you a copy of it.
     
  17. thellama

    thellama

    Joined:
    Mar 25, 2010
    Posts:
    360
    I can't be the only one still interested in this, any news on its release?