51 Commits

Author SHA1 Message Date
Yoan StAmant
f74ec561de [StateTreeDebuggger] Frame details view update:
- replaced node details view by embedding property values in the tree view
- node exported text (e.g. Task, Conditions, etc) is no longer imported in struct or object to avoid problems with missing types or property types with specific requirements (e.g. Object base property needs to find the specified value). Goal is to always be able to inspect key/value pairs.
- improved hierarchy of event to improve readibility
- started adding some custom row widgets for the different event types
- reworked the toolbar to regroup the different concepts (Simulation controls, Trace recording, Trace analyzing)
#rnx
#rb mikko.mononen

[CL 26854347 by Yoan StAmant in 5.3 branch]
2023-08-04 14:23:12 -04:00
yoan stamant
0442a17cb8 [StateTreeDebugger]
- added option to disable state transitions
- added state transition breakpoints
- fixed scrubbing not using the right time (analysis time instead of world simulation time) when hitting a breakpoint
- fixed new instance auto selection on record when previous selection is a stale subtrack
- added console variable `statetree.displayitemids` to display states, tasks and transitions Ids in the StateTreeEditor (details view and state treeview)
#rb mikko.mononen

[CL 26147565 by yoan stamant in 5.3 branch]
2023-06-21 10:02:02 -04:00
mikko mononen
0308e0f04a StateTree: Fixed and improved transition status reporting
- Allow to specify the completion status and terminal state when calling Stop() on State Tree exection context
- Global task's execution status directly translates to stree state on global EnterState (previously could just fail)
- Report terminal state transitions for global tasks (allows to use same task erro handling on states and global)
- Tie global task exection to the tree status, global tasks get ExitState() when transitioning to terminal state
- RequestTransition() was errorneuously reporting TreeRunStatus (instead of LastTickStatus) in Transition.CurrentRunStatus, this made it impossible to detect failed transitions on ExitState()

#preflight 647dae328b08a8b7939102ab

[CL 25789064 by mikko mononen in ue5-main branch]
2023-06-05 06:33:07 -04:00
yoan stamant
05bc614a8e [StateTreeDebugger]
- Added trace event for Phase (Push + Pop) to make it easier to recreate the event hierarchy when analyzing the traces.
- Merged enums EStateTreeTraceInstanceEventType and EStateTreeTraceNodeEventType to EStateTreeTraceEventType which is mainly a list of verbs that could be reused for different events (States, Instances, Tasks, etc.)
- EStateTreeUpdatePhase is no longer used as flags and reduced to uint8
- Phase events are stacked when producing traces and sent only if meaningful events (Task, State, Transition, etc.) are sent during their scope. This is to avoid sending useless events when the StateTree is ticked without any changes
#rnx
#rb mikko.mononen
#preflight 6474a5e62e05bcc3309d093e

[CL 25663847 by yoan stamant in ue5-main branch]
2023-05-29 10:13:21 -04:00
yoan stamant
8155710fd1 [StateTree debugger]
- added traces for transitions
- support for recursive state selection
- fixed breakpoints not stopping execution since timelines were added
- added meta data to types used for event visualization
- forced expansion for all treeview items in frame details
#rnx
#rb mikko.mononen
#preflight 646cb538205f5d23d5206392

[CL 25582715 by yoan stamant in ue5-main branch]
2023-05-23 10:46:16 -04:00
yoan stamant
1cd242d1dc [StateTree] debugger update
- moved debugger related files to a dedicated directory
- trace provider now allows to read all timelines associated to a given state tree asset instance
- added multiple slate widgets to manage tracks and timelines (directly inspired from RewindDebugger to make it easier to integrate the tools together eventually).
- added synchronized lists of instance names and timelines
- converted EStateTreeUpdatePhase to enum flags used to build frame details hierarchically
#preflight 645a57584c3ec54e6e65f494

[CL 25390252 by yoan stamant in ue5-main branch]
2023-05-09 12:57:56 -04:00
yoan stamant
c478e602b3 [StateTree] debugger updates:
- replaced log listing by treeview (as a prototype but will be replaced by a timeline)
- added event for conditions
- added details view for Condition and Tasks instance data
#rb mikko.mononen
#preflight 644002eea35280ed4f7a6afe

[CL 25110578 by yoan stamant in ue5-main branch]
2023-04-19 13:26:23 -04:00
mikko mononen
51aa286c45 State Tree: Added new selection behaviors for states
- Added selection behavior None (not selectable)
- Added selection behavior TryEnterState (enters the specific state, does not consider child states)
- Added selection behavior TryFollowTransitions (follows transitions when state is tried to be selected)
- Brushed up a bit the state representation in editor (added icons, cleaned up layout)

#preflight 6436843df12d5de705595942

[CL 25005118 by mikko mononen in ue5-main branch]
2023-04-12 07:59:16 -04:00
yoan stamant
64c8dca7cb [StateTreeDebugger]
Initial version of the debugger
- currently compiled by StateTreeModule and StateTreeEditorModule using WITH_STATETREE_DEBUGGER
- currently not exposed to UI by StateTree settings 'bUseDebugger'
- in this version only one instance per asset can be debugged
- using Trace services to read events generated by statetree instances.
- can connect to any traces (Editor, Client, Server) as long as the compiled statetree matches
#rb mieszko.zielinski
#preflight 641088a30e1f02786b509663

[CL 24639409 by yoan stamant in ue5-main branch]
2023-03-14 13:35:46 -04:00
stephen holmes
97766341ea Refactored FSructView and FConstStructView as per recent meetings. Both are now const correct in the same way TArrayView and TArrayConstView are (ie const FStructView and const FConstStructView) the view can not point at another view.
Also removed the Mutable named functions and replaced with the constness being part of the template.

#preflight 63ea4fbaec50523134d85665

[CL 24197313 by stephen holmes in ue5-main branch]
2023-02-13 20:06:02 -05:00
henrik karlsson
9a1d5b1ad4 [Engine/Plugins]
* Ran IWYU on ~170 plugins to remove includes not needed. Public api still keep old includes inside #if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2

#preflight 63d09351574ab9cae4670216
#rb none

[CL 23844750 by henrik karlsson in ue5-main branch]
2023-01-25 02:42:36 -05:00
mikko mononen
e2fd3455a9 StateTree: Allow tasks to request transitions
- Added ability for tasks to request transitions
- Added buffered transition requests
- Added callback method to FStateTreeTaskBase which is called during transition triggering
- Allow FStateTreeStateLink to be added to tasks and conditions (resolved automatically during compile)

#jira UE-174250
#preflight 63ca7ee8977c62635603afcb

[CL 23815873 by mikko mononen in ue5-main branch]
2023-01-23 12:48:04 -05:00
mikko mononen
57a0d8a492 StateTree: More graceful handling of GetStateTreeRunStatus()
- Calling GetStateTreeRunStatus() on unintialized instance is not error anymore, returns failed
- Made UStateTreeComponent::GetStateTreeRunStatus() to return failed instead of unset to be consistent with FStateTreeExecutionContext
- Allow to access execution state directly from instance data without exec context
- Do no crete exec context in UStateTreeComponent when sending events

#jira UE-173207
#preflight 63bfec4af02e72c08cab1811

[CL 23661828 by mikko mononen in ue5-main branch]
2023-01-12 09:00:45 -05:00
mikko mononen
ab3816dd30 StateTree: Added global tasks
- Added global tasks which are run at tree level similar to evals (will replace evals)
	- allows initial state selection to rely in calculated data (e.g. world conditions)
	- allows better reuse of existing logic
- Call evaluator stop in reverse order
- Use some uses of mutable instanced structs
- Copy bindings along with ST nodes
- Remove bindings when removing a ST node, so that undo can restore them

#rb Yoan.StAmant
#preflight 63bd2c7968068a8bd6395d2c

[CL 23632408 by mikko mononen in ue5-main branch]
2023-01-10 15:44:28 -05:00
foobit
7c8f7ac6fe PR #9830: [StateTree] StateTreeComponent.GetStateTreeRunStatus method and status delegate (Contributed by foobit)
#rb Mikko.Mononen
#preflight 639c374143330e63e5bb8fd0

[CL 23536754 by foobit in ue5-main branch]
2022-12-16 05:45:13 -05:00
Stephen Holmes
2f18773caa Addressing the remaining AI numeric conversion issues.
#jira UE-166285
#review
#preflight 638a031b35192facc1c0fd77

[CL 23372606 by Stephen Holmes in ue5-main branch]
2022-12-02 10:07:29 -05:00
mikko mononen
df359ce99e StateTree: Transition improvements
- Removed gated delay (transition will be delayed until it has been "pressed" for N seconds)
- Delay now triggers after the delay duration has passed (single trigger, not "pressed", works with events too)
- Added random variation for the delay
- Tick/Event transitions has precedence over completion transitions (that is, they are handled before completion transitions)
- Removed delay and blocking from completion transitions
- Small improvements for transitions UI

#rb Mieszko.Zielinski
#preflight 6389e0b435192facc1b95cdb

[CL 23371519 by mikko mononen in ue5-main branch]
2022-12-02 07:57:31 -05:00
mikko mononen
1cc286a596 StateTree: Add indirection to FStateTreeInstanceData so that it can be bitwise relocated.
#rb Mieszko.Zielinski
#preflight 63872b0d3377450900b579a6

[CL 23325782 by mikko mononen in ue5-main branch]
2022-11-30 07:17:26 -05:00
mikko mononen
e450d18a9f StateTree Fixes and Improvements
- Use hierarchical GamplayTag match when matchin transition event tags
- When returning succeed/failed fomr a subtree, handle it as if the linked state was completed
- Call Stop() before initializing the instance data on Start() to avoid the instance data to be overritten by Stop()
- Early out Stop() if the tree is not running
- Fixed failed transition not setting OutTransition.CurrentActiveStates correctly

#preflight 637e12ee8b12eb83a71bb694

[CL 23248889 by mikko mononen in ue5-main branch]
2022-11-23 09:22:14 -05:00
mikko mononen
2c797f2adb StateTree: Changed completion transitions to trigger at the state that was first completed.
- record the first completed state on EnterState() and TickTasks()
- returning succeeded on any node in EnterState() now behaves the same as returning succeeded on Tick()

#rb Mieszko.Zielinski
#preflight 637caf2df514e1ded9f280e4

[CL 23233890 by mikko mononen in ue5-main branch]
2022-11-22 08:13:54 -05:00
mikko mononen
0bc7b2da87 StateTree
- restored deprecation (was comments out due to submitting code via multiple CLs)
- cleaned up logging
- skip property binding to not take place when task is not ticked

#rb Mieszko.Zielinski
#preflight 636373961608da6ba1c3a8f2

[CL 22959061 by mikko mononen in ue5-main branch]
2022-11-03 14:21:53 -04:00
mikko mononen
186e03b32e StateTree: Improved event handling
- Moved event queue to it's own struct
- Changed the SendEvent() API to accept struct view to prevent instanced struct copy in common cases
- Fixed event handling in case EnterState() fails.
- Added option for Tasks to disavble ticking, or to be ticked only when there are events
- Added option for Tasks handle when properties are copied
- Changed DebugText to use external Actor reference
- Changed DelayTask to use the new GetInstanceData which does not need type
- Added TStateTreeInstanceDataStructRef which can be used to access struct instance data in delegates

#rb Maxime.Mercier Luciano.Ferraro
#preflight 6360dd302b5338aceb2d0343

[CL 22888708 by mikko mononen in ue5-main branch]
2022-11-01 15:11:19 -04:00
mikko mononen
51faf8eed8 StateTree: Fix comment on execution context SendEvent()
#rb trivial

[CL 22272720 by mikko mononen in ue5-main branch]
2022-09-30 12:21:42 -04:00
mikko mononen
5825321872 StateTree: Removed evaluator deprecations and TStateTreeInstanceDataPropertyHandle.
#jira UE-156544
#b Mieszko.Zielinski
#preflight 633549033041fbb56646450c

[CL 22260609 by mikko mononen in ue5-main branch]
2022-09-29 20:26:53 -04:00
mikko mononen
b24ef66a2f StateTree: Removed internal instance from StateTree execution context.
#rb Mieszko.Zielinski
#preflight 632d72ca1003050806b168c2

[CL 22163646 by mikko mononen in ue5-main branch]
2022-09-23 20:02:42 -04:00