+1
Answered

Is it possible to search through machines?

NeedsLoomis 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 9

Say I want to find all flow machines that use variable X, or contain event Y, is there an easy way to do this?

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

Hi!

Unfortunately, there's no dialog to do that at the moment. You could suggest it as an Idea post. Is there a specific reason why you need to do this? It might help me design around your need better.

Cheers,

Lazlo

Just nice to have when doing things like finding the origin of a runaway coroutine, or figuring out which items are listening/broadcasting custom events.  Searching in Visual Studio is a snap, which makes me hesitant to do anything too robust in visual scripting apps.

I see. I'm not sure how you picture the search results. A list? Of graphs or of units? Dimming out the units that don't match, like the Unity editor search? What search terms would yield which results? 

For example, if I search for a variable name, what should it return? 

+1

Honestly Im not sure, haven't really considered the user experience.  The only experience I have with visual FSMs in Unity is Playmaker.  They handle it pretty simply, you just go to your events or variables pane, and right click one of them to bring up a window containing a list of all of states throughout your scene that use it.  

Something simple, like the unity scene search, would also be great. Im not sure what would be best on both the user end as well as yours.

I agree. I'll keep it in mind, but the UX needs to be further fleshed out before I can consider developing the feature.

Hi, I am also interested in this functionality. Just throwing an idea, perhaps at the beginning the design can start with a simple number in a red bubble next to the variable name, like the number of notifications in a smartphone, then if right click the variable name, a list of the graphs and units will popup, if then click a row of that list, the corresponding graph will come to the front and focus directly into the Unit with the variable used

It would be nice to also search custom event names in graphs and across scene.

This is beneficial when the graphs in the game keep growing and variables sometimes are no longer in use 


Thanks,

+1

I'd like to search for anything I could search for in text based code. Old graphs and graphs by others aren't as self documenting as one would wish for. You need to know where a certain variable was used if you want to find bugs or refactor the code/graph.

The UX could be similar to the fuzzy finder but with a bit more bells and whistles.

Checkboxes (or better?) to select what you want to search: units, groups (titles + descriptions), variables, transitions, ...

Then you type into a search field and the result is a list of breadcrumbs to the unit (or group, etc.)
With the current breadcrumbs as we know them and maybe the first unit of a flow like "... Update > ... > [keyword]" so you know it is in the Update part of the graph.

Perhaps you have a complex graph and need to do multiple things with an object your player collided with. You are looking for the variable "CollidedWith" and you get

  • Player > Running > On Exit State > ... > Set Object Variable "CollidedWith"
  • Player > Standing > (Transition)Had collision > Update > ... > Get Object Variable "CollidedWith"

The search window needs to stay until you close it yourself so that you could return and look at the search result again and choose a different result or have an overview over the use of a variable or super unit. Ideally floating even over expanded (shift+space) graphs. Nice to have: You could shrink the result so it isn't blocking the current view. And then you expand it again to see the other results.

Saving a search could be a nice feature, too.


If Bolt would gain comment units one could even use the popular "XXX" and "TODO" comments and fix parts of the graphs later.

These are interesting ideas! Please continue this conversation in the Refactoring & Analysis Tools discussion thread:

https://support.ludiq.io/communities/5/topics/1152-analysis-refactoring-tools