godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.07k stars 69 forks source link

Add a selection panel for AnimationTree state machine node transitions #10064

Closed elXill closed 1 week ago

elXill commented 1 week ago

Describe the project you are working on

Character experiment which heavily relies on state machine.

Describe the problem or limitation you are having in your project

I am having hard time selecting and examining transitions with transition lines alone. And comparing transitions, for similar states (like movement states) is even harder.

When using state machine for a project anything other than small. People may want to organize states neatly, which makes transitions harder to select (especially when states are lined in straight lines). Most of the time you need to slide nodes to be able to select the transition you need.

ex_sm

Describe the feature / enhancement and how it helps to overcome the problem or limitation

When clicked on a node, it shows all it's transitions on a side panel in animation state machine. All the transitions can be seen as big buttons, it can show other information too; such as priority, a from or to transition, Xfade value, and maybe others. And it will have filters for from-to and according to visibility. This will be just for selecting and checking transitions or some of their values, so no editing will be done here. I made a mock up showing Priority, Next/Prior Node Name, Xfade, and Transition Direction (with arrow icon), but I am open to suggestions for which properties should be seen or not. But subjectively I think transition direction is a must and priority value would be really convenient for comparing with other transitions in the node. ex-a

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Just with some UI additions.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I'm not sure sometimes somethings in state machine can't be accessed from outside afair.

Is there a reason why this should be core and not an add-on in the asset library?

I think state machine needs more accessibility and ease of use for bigger state machines; this should help in this regard.

TokageItLab commented 1 week ago

I have given my opinion before, but I comment again.

  1. It is confusing because it makes use of the inspector and the bottom panel for settings doubly since Transition has already delegated the editor of the configuration to an inspector
  2. Listing Transitions is not useful. The list does not show at a glance what the graph is about

So I suggest rather you should consider a function which adjusts the look of the graph. For example, displaying numbers below the line of transitions, or only showing transitions connected to a specific Node by a shortcut or some toggle mode.

Godot's philosophy is to keep the implementation to a minimum with respect to the objective.

This proposal should aim to solve the following two problems: difficulty in selecting a transition when there are many lines, and difficulty in comparing multiple transitions connected to a single node. So it should be enough to display a single Node and transitions which is connected it in solo mode temporarily, and showing the number string of the priority and fading duration below the transition lines temporarily, as I noted above.

elXill commented 1 week ago

If I could understand it correctly.

  1. This is just for selecting. Nothing will be edited here it will be just a big button. Would it be confusing for making transitions selectable with buttons? Since they can already be selected in state machine?
  2. For ex; in the picture it can be seen that 2 transitions is going out with priority of 1 and 3 is coming in with priority of 1 for selected node. I'm not sure if you meant seing this is not useful or the way buttons present this info is not conveying information?

This can be solved with your suggestion but I imagine it may be bit harder to see things and may work a bit slower. I feel like I don't understand you correctly about the points above, but I think this may also be solved with below too.

What about when a state node is selected, making its transitions a similar list in inspector with some info which is selectable. And being able to select "from" or "to" state node from inspector for transition? (Selecting transitions from inspector for state nodes and vice versa selecting end or start node from transition). With this same thing can be done with no major UI changes what would you think about this?

TokageItLab commented 1 week ago

What about when a state node is selected, making its transitions a similar list in inspector with some info which is selectable. And being able to select "from" or "to" state node from inspector for transition? (Selecting transitions from inspector for state nodes and vice versa selecting end or start node from transition). With this same thing can be done with no major UI changes what would you think about this?

What you are trying to do is not filter information or add shortcuts, you are trying to complicate the GUI by adding more information.

So I am strongly against displaying the list. In general, too many entries that can be jumped from each dock can be confusing. It is never worth putting it in the core and could be implemented well as an add-on. Keep in mind that increasing the number of ways to manipulate a selection is not equivalent to increasing the convenience of the selection, but may create complexity.

elXill commented 1 week ago

I agree with that. Just tought you may find less ui change more aproachable.

A bit off topic but what about making things in state machine editor more accesible from inside godot to make plugins? Just keeping visibility bool in there to help with visibility just for plugins? My original intention was just making a plugin but couldn't do some things within editor it.

TokageItLab commented 1 week ago

As with the entire GodotEditor, except for the StateMachineEditor, it usually takes an advanced coding such as the custom module to interfere with the built-in editor.

Maybe this is partly to be safe from breaking the built-in functionality and crashing, but it is also because it requires a fundamental architectural improvement to begin with. If it were possible to expose it, it would be a setter or getter that would select a specific AnimationNode or something like that. Some editors may allow it.

For now, what I can say for this proposal is that the only button that needs to be added to the bottom panel is a toggle to enable "solo display with transitions" mode, and the rest is an implementation of some drawing to change the visibility and display of numbers. This is the proper meaning of a minimal GUI implementation.

elXill commented 1 week ago

Gothca.