The Behavior Editor and the Crowd Visual Feedback are able to report Behaviors, Channel Operators and Triggers status at initialization or during the simulation through visual feedbacks. During a simulation, click on an entity in the Maya Viewport in order to get a live visual debug of the Behavior Graph and Trigger Graph process in the Behavior Editor and Behavior Visual Feedbacks in the Crowd Visual Feedback.
Crowd Visual Feedback and Behavior Editor Feedback on a picked Entity
Behavior Graph Visual Feedback
Opening the Behavior Editor when the simulation runs and an entity has been selected, provides additional information on what happened on last frame, highlighting which nodes have been started, updated or stopped. Let's consider this Behavior Graph :
Idle - behavior graph as shown while editing
When not running, it displays two bePhysicalizeShape behaviors, and some "dummy" alternative nodes for the demonstration purpose only.
The first Physicalize sets a static mode, while the second will wait for a collision trigger, to go into ragdoll mode.
Let's see what happens when we hit play for a single frame :
Frame 1 - behavior graph after playing first frame, on a selected entity
The Initial node has been triggered, which has directly forwarded the runtime flow to the first behavior. The first behavior has evaluated its start trigger which was true, and went to "running" status. Then its stop trigger was false, so the behavior stayed in running state and stopped the runtime flow there.
Running nodes are displayed as green.
Stopped nodes are displayed as a yellow to green gradient, depending on their traversal order (yellow = older, green = newer).
Frame 2
The first behavior stop trigger switched to true, releasing the runtime flow which will continue to the next behavior. The next behavior has its start trigger false, so it won't start and stop the runtime flow here.
Starting nodes are shown in cyan
Frame 3, and few next frames
The second behavior has a collision detection as start trigger. While it is waiting for this trigger, it remains in a "starting" status, and continue displaying as blue. Note that the previously stopped nodes are not highlighted anymroe as they have not been triggered on the same frame.
Collision frame - Collision trigger activated
The second behavior start trigger finally goes true, and put the behavior in a running state. Once updated, the stop trigger is not true yet, so the runtime flow will stop there.
Exit of second behavior, passing through different operators up to the final node.
Finally the second behavior stop trigger becomes true, releasing the runtime flow, which goes through the operators (just here to show the gradient in debug view, they don't actually do anything) which won't block, up to the final node. If this graph was the content of a composite behavior, the execution flow would continue in to the parent graph.
Behavior graph has reached its end.
Once the behavior graph has been totally traversed, it does not show any debug status, until the next trigger of its initial node (a scene replay, or for composite behavior, another trigger of the composite entry).
Simulation Behavior Coloring
It is also possible to control an Entity color based on the last Behavior which has been starting. This option can be enabled in the Simulation Attributes of the Crowd Field and the color of each Behavior can be controlled in its Visual Feedback Attributes. Notice that when a new Behavior starts it overrides the Entity color and this color remains even if the same Behavior has stopped. Finally the influence of the color in the viewport can be controlled with the Display Color Weight of the Entity Type Node:
Channel Operator Visual Feedback
When running a Channel Operator Behavior, it is sometimes useful to be able to check the output values for each Channel Operator. This is something the
Channel Operator Editor Visual Debugger can easily do.
Trigger Graph Visual Feedback
Opening the Trigger Editor on a Trigger Graph being evaluated (ie attached to a Behavior or a Behavior Operator being evaluated) when the simulation runs and an entity has been selected, provides additional information on what happened on last frame, highlighting which trigger nodes have been returning true / false. Let's consider this Trigger Graph attached to the stopping condition of a running Motion Behavior with Entity 1001 being selected:
The Expression trigger returns True for this frame while all the others return False. Let's run the simulation at frame 30:
At frame 30, the Frame Trigger returns true. As the Fade Trigger also returns True at the same frame, the AND trigger operator returns true and the OR trigger operator as well. This triggers the stop of the Motion Behavior. As this Trigger Graph does not need to be evaluated anymore, the status of the Trigger nodes will not be updated. Only the latest status will be displayed despite the current situation. The visual feedback will look like this at frame 31:
At frame 31, all the trigger nodes which were true before and lead to the success of the relative Behavior / Behavior Operator are displayed as yellow to give a trace of what happened.