Commit Graph

28 Commits

Author SHA1 Message Date
mikko mononen
44c58a9a25 StateTree: Manually merged 31902376, 32435826, 32969383, and 33135570 from Main.
Merging important crash fixes which happened past 5.4 deadlines but severely affect the new features in 5.4.
The fixes were made on top of functionality that is not yet in 5.4. so had to be merged manually.

#jira UE-211189
#rb Mieszko.Zielinski

[CL 33463624 by mikko mononen in 5.4 branch]
2024-05-06 14:19:15 -04:00
mikko mononen
f1104edd5f StateTree: Introduced TStateTreePropertyRefExternalHandle.
- also InstanceDataStorage is stored as a sharedptr now

[CL 31000297 by mikko mononen in 5.4 branch]
2024-01-30 06:46:14 -05:00
mikko mononen
dd16540a54 StateTree: Storing global parameters data in instance storage.
- Implies that parameters are only set once at start
- Allows parameters to be safely mutated if needed, e.g. via property references

[CL 30765232 by mikko mononen in ue5-main branch]
2024-01-22 05:38:03 -05:00
mikko mononen
16962d6a2f StateTree: Added Linked Asset state type, which allows to link another asset as subtree.
- Added LinkedAsset State Tree State Type
- Allow to pick nested tree asset on LinkedAsset states
- Changed how linked state params are accessed using ParentFrame
- Added temporary instance data
- Temporaries are kept around until state selection
- Create temp instance data during state selection for state parameters (allows to create enter conditions based on subtree state params)
- Instantiate and Start linked State Trees global tasks and evaluators during state selection
- Matching temporary instances created during state selection are moved to instance data on state change (rest are discarded)
- Per node instance data is looked up just once, and FStateTreeExecutionContext::GetInstanceData() only serves the specific instance data.

#rb Mieszko.Zielinski, Yoan.StAmant

[CL 30012308 by mikko mononen in ue5-main branch]
2023-11-30 07:03:20 -05:00
mikko mononen
a500b14b6a StateTree: Changed how instance data is accessed
- Remove DataView concept
- Added FStateTreeExecutionFrame, which defines an active branch of a specific state tree that is running
- Added FStateTreeDataHandle, which allows frame relative access of instance data (replaces the DataViews)
- Changed linked states to spawn new frames (will later extend to handle linked trees on other assets)
- Bumped StateTree data version number, requires recomplation of StateTrees

#rb Yoan.StAmant

[CL 29884503 by mikko mononen in ue5-main branch]
2023-11-22 04:08:33 -05:00
grant medine
74338326da [Backout] - CL29805076
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Changed how instance data is accessed
- Remove DataView concept
- Added FStateTreeExecutionFrame, which defines an active branch of a specific state tree that is running
- Added FStateTreeDataHandle, which allows frame relative access of instance data (replaces the DataViews)
- Changed linked states to spawn new frames (will later extend to handle linked trees on other assets)
- Bumped StateTree data version number, requires recomplation of StateTrees

#rb Yoan.StAmant

[CL 29810071 by grant medine in ue5-main branch]
2023-11-17 11:42:17 -05:00
mikko mononen
72c488d0cf StateTree: Changed how instance data is accessed
- Remove DataView concept
- Added FStateTreeExecutionFrame, which defines an active branch of a specific state tree that is running
- Added FStateTreeDataHandle, which allows frame relative access of instance data (replaces the DataViews)
- Changed linked states to spawn new frames (will later extend to handle linked trees on other assets)
- Bumped StateTree data version number, requires recomplation of StateTrees

#rb Yoan.StAmant

[CL 29805087 by mikko mononen in ue5-main branch]
2023-11-17 07:41:08 -05:00
yoan stamant
36d1541ccf [StateTree] moved some types to the execution types header
#rb mikko.mononen

[CL 26255500 by yoan stamant in ue5-main branch]
2023-06-27 09:07:17 -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
mikko mononen
2e9d640c0a StateTree: Handle objects in instance data migrationvis serialization
#preflight 63e49577797b029c0aad7cce

[CL 24094030 by mikko mononen in ue5-main branch]
2023-02-09 04:20:54 -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
bob tellez
6e7878c698 #StateTree Downgrade warning to display for now
[FYI] mikko.mononen
#preflight trivial

[CL 23827147 by bob tellez in ue5-main branch]
2023-01-24 00:27:06 -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
henrik karlsson
9183978e29 [Engine/Plugins]
* Removed includes (using IWYU) in private files

#preflight 63c79978ac35a0e9dabbe408
#rb none

[CL 23770038 by henrik karlsson in ue5-main branch]
2023-01-19 00:48:07 -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
d2a74f6f7c StateTree: Fix missing include.
#rb trivial
#preflight 638dac9a976b1644cb0efe80

[CL 23388195 by mikko mononen in ue5-main branch]
2022-12-05 05:01:48 -05:00
mikko mononen
de58b75795 StateTree: Be more resilient when loading out of date BP data
- Try to convert to latest version when duplicating data
- Convert property binding source/target classes to latest version on link
- Handle BP reference replace in instanced structs

#rb Mieszko.Zielinski
#preflight 638d97e0303395f6c97629fd

[CL 23387730 by mikko mononen in ue5-main branch]
2022-12-05 03:19:45 -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
bryan sefcik
50d4fac9e0 Updated ../Engine/Plugins/... to inline gen.cpp files
Before:
3548 unity files
Total CPU Time: 47343.578125 s
Total time in Parallel executor: 494.60 seconds

After:
3445 unity files
Total CPU Time: 46044.671875 s
Total time in Parallel executor: 468.51 seconds

#jira
#preflight 63336159b20e73a098b7f24f

[CL 22218213 by bryan sefcik in ue5-main branch]
2022-09-28 01:06:15 -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
24df3e11e6 StateTree: Fixed handling of missing instance data types
- Fixed alignment of null structs from 0 to 1
- 0 causes the offset to reset, which in turn could could cause 0 size malloc

#jira none
#rb Yoan.StAmant
#fyi Yoan.StAmant
#preflight 6285fbb67a2503cd8986ce1f

[CL 20277269 by mikko mononen in ue5-main branch]
2022-05-19 04:24:56 -04:00