Comments in graphs

Lazlo Bonin (Lead Developer) 4 years ago updated by Crystalius 4 years ago 43

Even though you can add labels to groups and descriptions to states, it might sometimes be useful to leave a comment for future-you to remember how or why you organized some part in some way.

I want to hear your input on how these comment "nodes" should work.

How should they be created? (Keyboard shortcut like groups? Menu?)

How should they look? (Like a post-it? Custom coloring?)

Should they be collapsed by default and show on hover, or always visible but resizable?

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Exactly like that. I recall Unreal BP and a few other Visual assets had the exact or similar option. I would like to see it simply added as a right click option on the node if you want to add it, if you want a shortcut as well all good. Collapisble to be tidy is needed, and color coding never hurts as well as resizing or expandable. 

Under Review

Changing this back to under review for now. In all my use of Bolt, I have never yet needed textual graph comments to explain what was going on, because named groups and graph title/summary were always enough.

comments are worth when you need to come back to your graphs after long time. Or when you work in workgroups. So I think having comments in groups don’t hurt and could come in handy in some situations 


If anything, just add a summary inspector option for groups.


Added a comment field for groups. Not displayed anywhere at the moment, but it'll show up when you select the group in the graph inspector!


I created that "group" as a demo. I would like to be able to add a huge box like that with comments. While you can add a summary here:

That summary is way to small for me to explain the whole logic behind a graph. Would it be possible to implement something like this?

Like a notepad in a graph.

Yes. Sometimes I like to write stuff like:

Purpose of this graph is to XYZ.
Its called in ABC.
This is how it's done:
- bla bla
- bla bla

Yea sometimes it's not indicated to do this because you will also need to "maintain" your comments :D But I would really like this option.

I have a simple note pad in editor, can even attach notes directly to a game object in scene, but yes having a better option in a Graph can come in handy.

What note pad editor is that?

I'll post the link. 

If it's a comment that explains the whole graph, it should be put in the graph's summary.

If it's a comment that explains an area, it can go in the textbox for a group in the graph inspector.

Actually now that Lazlo brings it up, the comment box on a group does expand with text, so, we could minimize the box, so only the text appears I imagine.

Then, would it be possible to have what is written in the Graph's Summary, somewhere in the actual graph window?
I monstly want to have a way to add comments in the actual graph.

Nope, scratch my idea, just tested, it does not scale and no carriage return so limited to just that one line.

From Behavior Designer.


Sorry I know this is marked completed, but wasn't sure on the plan - is there a possibility of having comment nodes please?  Something similar to this maybe?

I really would like comments in the graph, just like comments are located immediately next to code to say what that section is about?


How would this do? I'm just not sure if there is a way to disclude a unit from being compiled. Otherwise this works and does nothing but provide a unit and a text box.

That would probably serve the need nicely Jason, good job again. I assume it is set to expand or can be dragged to do so. Now we just need for Lazlo to include it in the main codebase.


That will take a little more figuring out. I did this in like seconds. The icon took longer lol Its literally inherit from unit. declare a string and add attribute above string. But thanks. I'll work on the expanding idea. The state graph units can be dragged, so its possible. I'll just have to dig through the source a bit. As many lines as you want as well, so it'll keep going at least downward.


I figured. You'll end up making a few people happy.


I knew it would not take you long to chime in, ha.

A node like that is exactly waht I would want.

I could plop them around writing poems and love letters.


Excellent, I am not going to do the stretching at the moment. It is proving too time consuming trying to figure it out right now. I just have one question before I upload. Should we ditch the visuals on the unit itself? It still selects where the unit technically is, just the alpha is 0.


I like it like this. That icon and just that box with the text. Make it appear more clean.

Ha ha nice one Jason - literally just started to kind of figure out the API - is this a unit without any declared control inputs/outputs?  Wasn't sure if that would have caused a node to dim on validation.  I guess to drag it you'd end up having to modify the Ludiq code that deals with the GUI events etc, and yes that would be long if you're trying to crack on with your game :)  Could you upload both nodes please please please?  I personally prefer a node in the usual sense, but PET would like the transparent one "Comment Node/Transparent Comment Node".

Yeah, it's practically an empty unit, just a declared string with Inspectable and UnitHeaderInspectable attributes. I'lll double check on that validation, I forgot because I keep dimming off, other than when connecting something. I'm just going to upload the C# files without an assembly. You just need to not include the editor widget and it'll end up as a normal block. Just waking back up, but I'll upload as soon as I'm not in zombie mode. 

Ive got a comment node inheriting from Unit, how have you disabled the dimmed validation as there is no control inputs/outputs added to relations?

No clue, I've run into that with units that don't have a control input, but have a control output. I keep mine with dimming off in the editor prefs not in the unit itself. As far as I know, it needs an enter port for Relations.

figured this one out. If you do this:

public override bool isControlRoot { get { return true; } protected set => base.isControlRoot = value; }

Great thanks Jason :)

Adapting something like Lazlo's Group box and comment is what I was trying to adapt but with no expansion or carriage return and just the one line was not suitable. This will at least give him a better idea what we are looking for so he can hopefully add it himself..

Yup, that's my intention. I don't expect this to stick around if Lazlo ends up doing it. Just something we can use in the meantime. I wanted it like groups too, but the GUI stuff is confusing, I've only managed to successfully learn a certain set of things, like coloring, and modifying title, icon code, ect. Once getting a little deeper, I am lost. Still got some stuff to learn.

I'm going to re-add in a custom color before I upload. It'll start transparent, but can be changed to whatever color as a unit in the graph inspector, the exception being it can only use a mix of unity colors, so the behaviour in the color picker isn't normal. Full colors are accurate. But the more black, the more transparent it becomes. And less saturation, that effects it too unfortunately. But if it's fully saturated, and you just change base color, it'll behave as expected.


Jason's Comments would be amazing in official Bolt! It is really good when you want to put the Comment node near the stuff you want to explain.
Group comments doesn't satisfy, especially when group is large.

It would be similar to simple c# //comments. And that is important!


I agree, comments in groups are fine, but they're really *not* a replacement for standalone comments.

It would also be awesome if they could be wired up, as some sort of placeholder unit to diagram out a rough sketch of what you want to do; useful when working with multiple people too.


Sketch nodes sounds cool! And with cool design it would be awesome.That kind of things are important for visual coders, to make your code unique piece of art:)