playMaker

Author Topic: Interface/Usability: State/Action Hashtags  (Read 2661 times)

Thore

  • Sr. Member
  • ****
  • Posts: 480
Interface/Usability: State/Action Hashtags
« on: September 11, 2017, 01:26:35 PM »
What does it try to solve?
Where did I trigger the animation? Where do I wait for input? Where did I use this variable again? Where was the FSM state that I wanted to improve? You know these problems. You have to click through FSMs which can be quite laborious, and you cannot see at a glance what's relevant for you.

Solution!
The solution comes in several stages. The basic one is a solution, the others make the feature even better.

Basic: Introducing State/Action Tags. The user can #hashtag words in the State Comment, which are then searchable. That way you can instantly see, and find, whatever is relevant for you.

Improved: In the improved version, the hashtags on a state are added automatically, when certain actions are added to a state (and removed accordingly). The user has to switch on an option, and then determine somewhere which actions should automatically add the hashtag to the state they're in. It's probably unwieldy to maintain a huge list, so how about an input field that is directly next to the manual and options button at the actions (but once set on an action, it obviously counts for all identical actions anywhere). It's first blank, but there you can set the tag's name and a label colour. See my quick mockups how it could function.

Use Case 1: You have a few places you aren't quite happy with. You simply add #WIP to the state's comment field. Weeks later, you have no idea where you wanted to make improvements. Luckily, you can use the tiny search bar, type in # and it shows you the hashtags you have used, or you when you remember that it was #WIP, you can type that in straight away. Click through the list in the hamburger menu next to it, and quickly go to the correct state.

Use Case 2: Suppose, you have some FSM and you are interested to know precisely where stuff is sent off to the animator. This can be quite hard to see, especially not at a glance, unless you use colour-coding which can be quite cryptic. Luckily, Playmaker now offers automatic hashtags! You go to the options and switch them on. Now a tiny label icon appears right next to the manual and options icon on the actions. You go find just one instance, say "Set Animator Bool", hit the label button, where you define the tag and a label colour. Et voila! Now everywhere where "Set Animator Bool" is used, you see the labels appended after the comment (if no comment, at the same place).

Use Case 3:   Oh noes! You just cannot find any instance where you used "Set Animator Bool". No problem, just make a state anywhere, add the action, and then set the label. If you used the action already, they're now all visible. If not, fine, all future instances will be automatically labelled.


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Interface/Usability: State/Action Hashtags
« Reply #1 on: September 11, 2017, 10:58:25 PM »
Hi,
you can kinda do this already :)

if you have a state that you want to change.
On that FSM go to the state that has the 'Start' Global Transition, name it with Something easy to see (##WIP##) or add it to the current name.
also you can do this on the State inside that fsm.

then to find it go to :
Playmaker/Edtior Window and open FSM Browser.
there you can see all the fsms on the left and on the right you can see the name of the start state from each fsm.

you could also add a ##WIP## on the fsm name in front of the original name which would make it even easier to find as the fsms are alphabetically ordered.

next, click on the fsm that you want, it will redirect to the fsm.
then go to :
Playmaker/Edtior Window and open 'State Browser' there you an select the state you want.

For actions you can right-click on an action inside the action browser and select find  to see where the actions are used.

A good feature would be to have a category with all the used actions. :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Interface/Usability: State/Action Hashtags
« Reply #2 on: September 12, 2017, 01:52:08 AM »
Hi,

 yes, some good points.

 I am currently cooking for some time now an introspection system that process the whole project, Scenes, prefabs, Assets and produce an Xml description of everything, it's PlayMaker centric of course, and the goal is to then use this introspection result to do all the things you mentioned and a lot more, using predefine requests such as @find all FsmString variables named *xx or where it's content is exactly "yyy"

because all the introspection is in xml, everything is text based in plain English and so you can even do regular text searches. Everything is cross references so you will get the usage of each actions and you can then do searches like give me all the state where action XXX has field YYY set to ZZZ.

This also deeply cross reference Unity features and scripts such as Enums, or other components that PlayMaker is using.

 The other major benefits is that third party assets can also write plugins for this introspection and their stuff will be features then in that xml.

For example a typical proper real world project produces a xml file that is around 30 MB with 750,000 lines!

Bye,

 Jean

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Interface/Usability: State/Action Hashtags
« Reply #3 on: September 13, 2017, 07:27:35 AM »
That sounds like a cool feature. Though, it would also be cool to see certain things at a glance, in Playmaker spirit, rather than running search queries.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Interface/Usability: State/Action Hashtags
« Reply #4 on: September 15, 2017, 02:33:55 AM »
Hi,

The plan is to wrap search queries into something visuals, like predefined rules that would list results etc etc. then you could save search queries and run them, edit them quickly.

 From experience, even Unity and pur c# have major issues with proper introspection, especially with loose coupling approach style of coding, which is all what Unity is about with so many visual drag and drop features, there isn't anything built in that will connect the dots for you unfortunatly.

And so a proper text based description of everything gives the ability in the long run to properly show these connections, despite the lack of such tools in the environment itself. It does mean a brute force ( parsing everything first) approach yes, but I know no other ways as of today.

Based on that, how the results and queries will be shown and presented is really a matter of how much effort will go into this.

 Bye,

 Jean