Commit Graph

121 Commits

Author SHA1 Message Date
yoan stamant
08b5314641 [StateTreeDebugger] replaced WITH_STATETREE_DEBUGGER by WITH_STATETREE_TRACE and WITH_STATETREE_TRACE_DEBUGGER to allow different targets to use only one of the two functionalities. For example consoles can only output traces while Desktop targets can output traces and analyse them.
#rb Mieszko.Zielinski

[CL 33398309 by yoan stamant in ue5-main branch]
2024-05-02 11:47:26 -04:00
mikko mononen
eda018b6bd StateTree: Fix accessing state captured event
#rb Yoan.StAmant

[CL 33228442 by mikko mononen in ue5-main branch]
2024-04-25 08:50:27 -04:00
jacob wang
60131c19b5 [State Tree] StateTreeInstanceData RandomStream variable Initialization Fix/Improvement
- When duplicating the Component, RandomStream was always copied from the one on Component CDO and wasn't constructed with the current time as expected. We now initialize RandomStream at FStateTreeExecutionContext::Start(), where the InstanceData is going to persist till Stop().
- Moved RandomStream variable to FStateTreeExecutionState as it better reflects the window it persists now.
- Fixed non-deterministic default-constructed value of RandomStream variable in UStruct LogError by the above

#jira UE-212551
#rb mikko.mononen

[CL 33174826 by jacob wang in ue5-main branch]
2024-04-23 14:17:24 -04:00
mikko mononen
0580cb723a StateTree: Remove debug code left in by mistake.
[CL 33162735 by mikko mononen in ue5-main branch]
2024-04-23 03:28:39 -04:00
yoan stamant
9f4886944e [StateTreeDebugger]
allowed to provide verbosity to STATETREE_TRACE_LOG_EVENT and STATETREE_LOG_AND_TRACE so the debugger can add custom icons accordingly.
#jira UE-210505
#rb mikko.mononen

[CL 33140307 by yoan stamant in ue5-main branch]
2024-04-22 11:34:53 -04:00
mikko mononen
533e9f7eb7 StateTrees: Made empty linked asset a valid setup.
[CL 33135868 by mikko mononen in ue5-main branch]
2024-04-22 07:44:19 -04:00
mikko mononen
02f386fc88 StateTree: Fix crash when transitioning into linked tree.
[CL 33135580 by mikko mononen in ue5-main branch]
2024-04-22 07:02:22 -04:00
guillaume arruda
bdfff2913f Make FStateTreeExecutionContext::AreContextDataViewsValid properly account for optional external data.
#rnx
#rb mikko.mononen

[CL 33033068 by guillaume arruda in ue5-main branch]
2024-04-17 07:49:42 -04:00
mikko mononen
b5f3e45d9b StateTree: Debugger fixes and improvements
- Another fix for stuck timeline
- Removed exec context to emit  EStateTreeUpdatePhase::TickStateTree scope, to allow cleaner logs for parallel STs

[CL 33030889 by mikko mononen in ue5-main branch]
2024-04-17 04:18:52 -04:00
jacob wang
c641fa607f [State Tree] Uniformly Random State Selection
- Added a new option for selecint child at uniform random in StateTreeStateSelectionBehavior
- Added RandomStream in StateTreeInstanceData and relevant APIs to get stream and set seed
#rb mikko.mononen

[CL 33006455 by jacob wang in ue5-main branch]
2024-04-16 13:30:24 -04:00
mikko mononen
9bcda384a4 StateTree: Fix parameter handling entering to a subtree directly.
- When transitioning to a subtree directly, self host the parameters
- Made transitioning to a subtree directly a warning, may make it an error in future versions

#jira UE-211189
#rb Yoan.StAmant

[CL 32969399 by mikko mononen in ue5-main branch]
2024-04-15 08:23:17 -04:00
mikko mononen
2b93815d0a StateTree: Improved event handling
- Added support for shared event buffer, so that multiple instance data can use the same
- Added API to consume events
- Removed double buffering from events
- Treat TriggerTransitions() as event handler (events flushed after each call to the method)
- Event handlers (including tasks) are executed in priority order
- Transitions and event capturing states can consume events on successful selection
- Added API to tick a StateTree in two passes (update tasks and trigger transitions)
- Change parallel tree tasks to do the task update in Tick(), and event handling in TriggerTransitions()
- Small improvements to the ST debugger to display events
- NOTE: this is breaking change for implementations that has relied events emitted during tick to be available on next EnterState()

#okfirgithub public
#rb Yoan.StAmant

[CL 32924765 by mikko mononen in ue5-main branch]
2024-04-12 06:04:01 -04:00
mikko mononen
551d9cb46d StateTree: Fix stack-use-after-scope
#jira UE-210969
#rb Mieszko.Zielinski

[CL 32876371 by mikko mononen in ue5-main branch]
2024-04-11 04:38:59 -04:00
mikko mononen
d5ede881de StateTree: Fix FStateTreePropertyRef example to guide correct type usage
- Fix FStateTreePropertyRef types in Env Query Task
- Fix too eager PVS warning

[CL 32754191 by mikko mononen in ue5-main branch]
2024-04-05 02:53:00 -04:00
mikko mononen
5e4d3a8a6c [Backout] - CL32744797
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL32723276
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Made parent state required events and enter conditions to be evaluated when transition leads directly to it's child. (contributed)

[CL 32754072 by mikko mononen in ue5-main branch]
2024-04-05 02:16:32 -04:00
bob tellez
adaa2e290a [Backout] - CL32723276
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Made parent state required events and enter conditions to be evaluated when transition leads directly to it's child. (contributed)

[CL 32744822 by bob tellez in ue5-main branch]
2024-04-04 17:51:12 -04:00
mikko mononen
b67864e0ad StateTree: Made parent state required events and enter conditions to be evaluated when transition leads directly to it's child. (contributed)
[CL 32723281 by mikko mononen in ue5-main branch]
2024-04-04 07:01:38 -04:00
guillaume arruda
83b26c43f3 Add support for state tree override in StateTreeRunParallelStateTreeTask
#rnx
#rb mikko.mononen

[CL 32693651 by guillaume arruda in ue5-main branch]
2024-04-03 07:16:44 -04:00
mikko mononen
91012bfa0b StateTree: Added linked state overrides.
- Added ability to describe override table for linked state tree references
- This allows to override parts of the tree e.g. based on character type
- Fixed visibility of the State parameter button when in fixed mode

#rb guillaume.arruda

[CL 32572125 by mikko mononen in ue5-main branch]
2024-03-28 05:18:19 -04:00
mikko mononen
0cdc2e12b9 StateTree: Fix active instance data access when during selection.
#rb Mieszko.Zielinski
#lockdown julien.marchand

[CL 32545460 by mikko mononen in ue5-main branch]
2024-03-27 11:51:13 -04:00
guillaume arruda
7fb2ffb953 Fix LinkedAsset schema check that was inversed leading to subtree with looser requirement being rejected
#rnx
#rb Yoan.StAmant

[CL 32435908 by guillaume arruda in ue5-main branch]
2024-03-22 11:44:33 -04:00
mikko mononen
d92da1ba2f StateTree: Fixed non initialized state params when checking it's enter conditions
[CL 32429459 by mikko mononen in ue5-main branch]
2024-03-22 06:34:36 -04:00
guillaume arruda
c3b7786a73 Create state tree task Run Parallel tree allowing a state to run a subtree while child state can still to be selected and entered.
#rb mikko.mononen, Yoan.StAmant

[CL 32362634 by guillaume arruda in ue5-main branch]
2024-03-20 08:28:58 -04:00
mikko mononen
a82ca89e98 StateTree: Added support for event payload in transitions and event capture for states. (contributed) [take 2]
- Transitions can now be set up to require a specific payload type and/or a gameplay tag
- Required transition event payload is visible to property bindind for transition conditions
- States can require an event type as enter condition, the event is captured when state is selected
- Required state event payload is visible to binding for state enter conditions, tasks and transistions

[CL 32150454 by mikko mononen in ue5-main branch]
2024-03-11 04:54:44 -04:00
bob tellez
0189872e84 [Backout] - CL32082262
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Added support for event payload in transitions and event capture for states. (contributed)
- Transitions can now be set up to require a specific payload type and/or a gameplay tag
- Required transition event payload is visible to property bindind for transition conditions
- States can require an event type as enter condition, the event is captured when state is selected
- Required state event payload is visible to binding for state enter conditions, tasks and transistions

[CL 32113027 by bob tellez in ue5-main branch]
2024-03-07 23:49:50 -05:00