17 Commits

Author SHA1 Message Date
yoan stamant
6d66e2376c [StateTree] moved some types to the execution types header
#rb mikko.mononen

[CL 26255567 by yoan stamant in 5.3 branch]
2023-06-27 09:09:35 -04:00
mikko mononen
764e166e5b StateTree: Fixed crashes when compiled data is not loaded properly (e.g. some structs not loaded)
#rb Yoan.StAmant
#preflight 6409ade0a450329d6c1750b0

[CL 24573646 by mikko mononen in ue5-main branch]
2023-03-09 06:35:16 -05: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
christopher waters
2285d21e63 Removing TaskGraphInterfaces.h include from CoreDelegates.h
[CL 23836502 by christopher waters in ue5-main branch]
2023-01-24 15:07:59 -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
fb1a0fad3d StateTree: Fix mutable uses of instanced structs and struct views.
#jira UE-172049
#rb Mieszko.Zielinski
#preflight 63c002ab577437afe6358e84

[CL 23662521 by mikko mononen in ue5-main branch]
2023-01-12 09:45:58 -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
fe252a1f95 StructUtils: Renamed FInstancedStructArray to FInstancedStructContainer
#jira UE-170863
#rb Mieszko.Zielinski
#preflight 638debbb7e0feab0b7da3359

[CL 23389832 by mikko mononen in ue5-main branch]
2022-12-05 09:16:27 -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
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
bbd34dd782 StateTree Events
- Added StateTree events, which allows e.g. transitions based on internal or external events
- Clarified transition nomenclature
- Update UI to support transition events
- BP support for events
- Renamed UStateTreeItemBase to UStateTreeNodeBase for consistency with FStateTreeNodeBase

#jira UE-156543
#rb Mieszko.Zielinski
#preflight 631077ef660db81edbd068ca

[CL 21738918 by mikko mononen in ue5-main branch]
2022-09-01 09:06:53 -04:00
UnrealBot
73409369c0 Branch snapshot for CL 21319338
[CL 21319338 in ue5-main branch]
2022-08-10 16:03:37 +00:00
mikko mononen
66e1f36595 StateTree: Changed runtime data to contain only active tasks
- Commented and cleaned up the members of UStateTree a bit
- Changed StateTree Node storage to FInstancedStructArray (contiguous memory)
- Changed StateTree SharedData to FInstancedStructArray
- Changed StateTree instance data to use FInstancedStructArray
- StateTree statistics shows estimated mem usage per state and max for tree (heaviest linked chain)
- Added explicit bLinked state for UStateTree
- Cleaned up UStateTree::ResetCompiled()/ResetLinked()
- Changed StateTree execution context to allocate task instance data on Start() and EnterState()
- StateTree tick uses execution order counters to access the instance data instead of compile time specific index

#jira  UE-153269
#rb Stephen.Holmes Yoan.StAmant
#preflight 628df39faf7a2e956bb45dc5

[CL 20361823 by mikko mononen in ue5-main branch]
2022-05-25 05:34:50 -04:00
mikko mononen
97d82b0cb0 StateTree: shared instance data
- Separated condition instance data into a shared instance data (mutable but no persistent state)
- Made BP TestCondition() const, conditions should not hold state
- Added macro to define runtime data POD for faster init
- Added custom serialization version for UStateTree, older assets need recompile
- Updated memory reporting to be a bit more accurate, separated shared and unique data

#jira UE-147508
#rb Mieszko.Zielinski
#preflight 627b657d2d608c533b5cde15

[CL 20134929 by mikko mononen in ue5-main branch]
2022-05-11 04:04:58 -04:00
mikko mononen
49de6cb549 StateTree: Fix for instance data when compiling BP classes
- Moved instance object directly on FStateTreeInstanceData to make easier to access
- Internal instance data on FStateTreeExecutionContext is not property to simplify handling
- Link & resolve properties on UStateTree when objects are replaced (to refresh cached property pointers)
- Moved instance data initialization out from FStateTreeExecutionContext
#preflight 623b0bff10251d53d5823f3e

[CL 19477789 by mikko mononen in ue5-main branch]
2022-03-23 08:06:00 -04:00
mikko mononen
95cec28098 StateTree: Moved instance data out from framents
- Added new struct to hold instance data
- Removed on the fly created customs struct for storing the instance data
- The Mass StateTree instance data is not a fragment anymore
- Fixes crash when using StateTreeBrainComponent directly on actor
- Moved StateTree activation processor settings to Mass Behavior settings

#jira UE-133870
#rb Yoan.StAmant
#preflight 62178318db60b6b592190db8

[CL 19112506 by mikko mononen in ue5-main branch]
2022-02-24 08:19:23 -05:00