Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
quick:debug [2018/05/29 11:36] pedroquick:debug [2020/09/03 09:27] pedro
Line 1: Line 1:
 +<markdown>
 # Debug Mode Quick Start Guide # Debug Mode Quick Start Guide
  
Line 12: Line 13:
 The Behavior Bricks editor enters debug mode automatically when playing a scene in the Unity editor, substituting the `Behavior` tab of the Behavior Bricks editor with the `Debug` tab, as shown in the Figure: The Behavior Bricks editor enters debug mode automatically when playing a scene in the Unity editor, substituting the `Behavior` tab of the Behavior Bricks editor with the `Debug` tab, as shown in the Figure:
  
-{{ :images:debug:debug.png }}+![]( :images:debug:debug.png )
  
 To watch the execution flow for a particular behavior tree of a given entity in the scene, you must open the behavior tree in the Behavior Bricks editor, and select the entity to debug in the Unity´s `Hierarchy` panel. Alternatively, the entity can be selected in the `Debug` tab, by first clicking on the `Refresh List` button and then clicking on the entity name. The `Debug` tab shows a list of the entities in the scene being played which contain a `Behavior Executor` component, grouped by the behavior assigned, as shown in the Figure: To watch the execution flow for a particular behavior tree of a given entity in the scene, you must open the behavior tree in the Behavior Bricks editor, and select the entity to debug in the Unity´s `Hierarchy` panel. Alternatively, the entity can be selected in the `Debug` tab, by first clicking on the `Refresh List` button and then clicking on the entity name. The `Debug` tab shows a list of the entities in the scene being played which contain a `Behavior Executor` component, grouped by the behavior assigned, as shown in the Figure:
  
-{{ :images:debug:debug_entity.png }}+![]( :images:debug:debug_entity.png )
  
 Once the behavior and the entity have been selected, the state of each node is depicted by changing the color of its bounding box: Once the behavior and the entity have been selected, the state of each node is depicted by changing the color of its bounding box:
Line 43: Line 44:
 {{ :images:debug:watch_blackboard.png }} {{ :images:debug:watch_blackboard.png }}
  
-With this feature you can pause the execution of the game when a node for a concrete behavior tree of a specific entity reach one of the following states:+### Breakpoints
  
-- Success +Behavior Bricks also features a simple type of breakpoint that allows to pause the execution of the scene whenever a given condition is reached in a particular node of a behavior tree in a given entity.
-- Failed +
-- Aborted +
-- Launched+
  
-To add a breakpoint you just need to right click in a node and select `Add Breakpoint`:+In order to set a breakpoint you just need to right click in a node and select `Add Breakpoint`, and this can be done while in edit or play mode of the Unity editor:
  
-![Adding a breakpoint](images/DebugModeQuickStartGuide/AddBreakpoint.PNG "Adding a breakpoint")+{{ :images:debug:breakpoint_add.png }}
  
-You can configure what events the breakpoint should be triggered in the `Node` tab by marking the desired events.+Then, in the `Node` tab, it is possible to select the event(s) triggered by the node that will make the breakpoint to have effect:
  
-![Breakpoint events](images/DebugModeQuickStartGuide/BreakpointConfig.PNG "Breakpoint events")+{{ :images:debug:breakpoint.png }}
  
-In case all events are unmarked the breakpoint will be displayed as disabled with a grey color:+Finally, for the breakpoint to have effect, the scene has to be played, an entity containing the tree with the breakpoint has to be selected in the `Debug` tab, and the behavior tree has to be opened in the Behavior Bricks editor (it is not required it to be in the active tab of the editor). When the breakpoint is reached, the execution of the scene will be paused.
  
-![Disabled breakpoint](images/DebugModeQuickStartGuide/DisabledBreakpoint.PNG "Disabled breakpoint")+A node with a breakpoint may be in three possible states: inactive with some event selected (left), inactive with none event selected (middle), active (right)
  
-Remeber that a breakpoint can only be triggered when:+{{ :images:debug:breakpoint_state.png }}
  
-- You are on Play Mode +</markdown>
-- Behavior Bricks Editor is open +
-- A valid entity is selected +
-- The behavior that contains the node with the breakpoint attached is open, but you don´t need the behavior to be the active tab. +
- +
-![Triggered breakpoint](images/DebugModeQuickStartGuide/TriggeredBreakpoint.PNG "Triggered breakpoint")+