Commit Graph

72 Commits

Author SHA1 Message Date
mikko mononen
9174cf81d1 StateTree: Threadsafe shared data
- added thread safe access to shared instance data (each thread gets a copy)
- fixed Item->Node in the editor node API

#jira UE-153269
#rb Mieszko.Zielinski

[CL 21862712 by mikko mononen in ue5-main branch]
2022-09-07 17:12:18 -04:00
mikko mononen
cb367257d7 StateTree:
- Fixed potential crash in StateTree editor row
- Fixed StateTreeComponentSchema actor class not updating property on load

#rb Mieszko.Zielinski
#preflight 6315cd43ec45fbf3d7ae82d0

[CL 21791567 by mikko mononen in ue5-main branch]
2022-09-05 09:08:59 -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
mikko mononen
0d1ace8323 StateTree: StateTreeComponent improvements
- Added option to start the StateTree automatically on BeginPlay
- StateTreeComponentSchema: allow to specify which actor class to expect the StateTree to run on (allows to bind to Actor specific data directly)
- Fixed FStateTreeReference parameter update on BP instance (the struct gets copied, which cause issues with the delegate handle)

#rb Mieszko.Zielinski
#preflight 630c70bb0345de4ccf7c8b51

[CL 21685020 by mikko mononen in ue5-main branch]
2022-08-29 14:47:43 -04:00
mikko mononen
918ef3e1e2 StateTree: Fix potential nullptr reference
#rb trivial

[CL 21684959 by mikko mononen in ue5-main branch]
2022-08-29 14:45:47 -04:00
mikko mononen
dd5786afb4 StateTree: editor fixes
- enable binding extension on evaluator
- fix schema outer (schema would not get saved)
- removed need to tag bindable properties as parameters
- disallow binding to statetree nodes directly

#rb Mieszko.Zielinski
#preflight 630602fcc00af5e2945dbe95

[CL 21560970 by mikko mononen in ue5-main branch]
2022-08-25 05:16:12 -04:00
mikko mononen
2a196bac7c StateTree:
- Changed existing conditions to use the simpler instance data getter
- Added UObject based conditions
- Renamed condition file for consistency

#rb Mieszko.Zielinski
#preflight 6304879ca45b007ea268d917

[CL 21512046 by mikko mononen in ue5-main branch]
2022-08-23 13:04:52 -04:00
Zousar Shaker
3f4252aa56 ObjectPtr upgrade for engine plugins used from UnrealEditor -allmodules. Automated upgrade process.
#rb none
#preflight 62fe7f270601ad0504910c30

[CL 21447894 by Zousar Shaker in ue5-main branch]
2022-08-18 15:08:49 -04:00
Zousar Shaker
da1254fd35 Callsite upgrade pass for TObjectPtr use on plugins used when building UnrealEditor with "-allmodules".
#rb none
#preflight 62daee42ac71f3a225b744f9

[CL 21226921 by Zousar Shaker in ue5-main branch]
2022-07-22 15:06:06 -04:00
mikko mononen
3e852502b6 StateTree: Fixed failing test and missing validation
- fail compilation if linking to non-subtree
- fixed crash in linker if subtree does not have parameters
- fixed subtree test (subtree state was missing type)

#jira UE-155893
#preflight 62d90fd3d54af4b9a2fc04c0

#ROBOMERGE-AUTHOR: mikko.mononen
#ROBOMERGE-SOURCE: CL 21198999 via CL 21199006 via CL 21199009
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21199538 by mikko mononen in ue5-main branch]
2022-07-21 08:19:56 -04:00
ronald koppers
12979e53c2 FMessageLog::CriticalError has been deprecated.
FMessageLog::CriticalError has a delay before throwing an assert to allow compositing of the message. As a result the assert isn't thrown at the location of the problem, but somewhere in the surrounding area, which makes the problem harder to debug and generates misleading log entries. Due to these problems FMessageLog::CriticalError and EMessageSeverity::CriticalError have been deprecated. It's recommended to use checkf instead.

When FMessageLog goes out of scope or is destroyed explicitly it will flush its messages to the log, which in turn means the log may immediately use the messages. In a few places a reference to the message was kept that outlived the lifetime of the owning FMessageLog in order to add arguments later on. The found cases have been updated to make sure FMessageLog doesn't outlive the addition of the arguments so the arguments are correctly passed to the log.

#jira: UE-155605
#rb brooke.hubert francis.hurteau jerome.delattre
#preflight 62cc4fca9922f7e5129e4e0a

[CL 21042765 by ronald koppers in ue5-main branch]
2022-07-11 12:58:26 -04:00
mikko mononen
f9887f77bc StateTree: Added schema picker to new tree creation workflow
- Added BP-like class picker for schema when StateTree asset is created
- Added "CommonSchema" meta tag for schemas to allow them to be added to the common list
- Allow the asset on StateTree actor component to EditAnywhere
- Fixed compilation indication for empty StateTrees (was showing red)

#robomerge EngineMerge
#jira UE-151649
#rb Yoan.StAmant
#preflight 62beaeeb8d5e6787590a0921

[CL 20911820 by mikko mononen in ue5-main branch]
2022-07-01 04:36:16 -04:00
mikko mononen
fddc21a3ba StateTree Editor: Make tree rows as wide as the view.
#jira none
#robomerge EngineMerge
#rb Mieszko.Zielinski
#preflight 62bd47d11c0b75879704c7fb

[CL 20889937 by mikko mononen in ue5-main branch]
2022-06-30 03:06:38 -04:00
mikko mononen
841f7320c9 StateTree struct reference
- added functionality to allow to use property binding to get pointer to another struct property
- converted mass smart object and movement tasks to use struct ref

#jira none
#robomerge EngineMerge
#rb Yoan.StAmant
#preflight 62bc0d51e353c20ac23fbf39

[CL 20871790 by mikko mononen in ue5-main branch]
2022-06-29 04:52:18 -04:00
Matt Peters
803e794b36 AssetRegistryModule: Add TryGet function that can return null instead of asserting during Engine shutdown.
#jira UE-157056
#rb PJ.Kack
#rnx
#preflight 62b1d7fd827ccccb2cdec5a3

[CL 20758071 by Matt Peters in ue5-main branch]
2022-06-21 11:07:36 -04:00
Robert Manuszewski
ad58603f66 Fixing up short type names in property meta data
#jira none
#preflight none
#rb trivial

[CL 20572294 by Robert Manuszewski in ue5-main branch]
2022-06-09 03:11:27 -04:00
Ben Marsh
0b4cbb3621 Fix static analysis warning (pointer dereference before null check)
#preflight none
#fyi mikko.mononen

[CL 20486685 by Ben Marsh in ue5-main branch]
2022-06-03 11:06:39 -04:00
mikko mononen
abc2561ecf StateTree: Fix property binding for direct struct access
#jira none
#rb Yoan.StAmant
#preflight 6299c84c1941378d7c97e7aa

[CL 20484161 by mikko mononen in ue5-main branch]
2022-06-03 04:55:42 -04:00
robert manuszewski
d1443992e1 Deprecating ANY_PACKAGE.
This change consists of multiple changes:

Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used  in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values

AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes

Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names

#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32

#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
mikko mononen
cd197fcb3e StateTree: refactored index types
- Changed FStateTreeHandle to FStateTreeStateHandle, used only for indexing states
- Added uint16 and uin8 index types, which can represent invalid index (aka INDEX_NONE)
- Changed indices that can be optional to the index types above
- Added validation and error loggic when index types overflow during compile
- Removed 2 indirections (in common case) and halved the memory usage of property copies

#jira none
#rb Mieszko.Zielinski
#preflight 6295d26e91004dd61ced370b

[CL 20434838 by mikko mononen in ue5-main branch]
2022-05-31 04:51:18 -04: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
robert manuszewski
2a0e26f5fe Fixing bad merge
#jira none
#rb trivial
#preflight none

#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20315015 in //UE5/Release-Engine-Staging/...
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20315216 by robert manuszewski in ue5-main branch]
2022-05-22 10:30:17 -04:00
robert manuszewski
f8a812a32f Converting hardcoded short class/enum names to pathnames ahead of ANY_PACKAGE removal
#rb trivial
#jira UE-99463
#preflight 6288fd998828ea88c8aef3d0

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20314896 via CL 20314897 via CL 20314903 via CL 20314904
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20315214 by robert manuszewski in ue5-main branch]
2022-05-22 10:30:02 -04:00
mikko mononen
344561a7f0 StateTree: Fix for abstract classes showing up in class selector
- added condition to prevent abstract classes being selected
- made some base node types hidden

#jira UE-149895
#rb Mieszko.Zielinski
#preflight 62849197614041edb75978ea

[CL 20258008 by mikko mononen in ue5-main branch]
2022-05-18 02:35:34 -04:00
mikko mononen
a841531c2b StateTree: moved evaluators global to tree
- Deprecated per state evaluators and moved them to global to the tree
- Tick evals once per Tick()
- Updated editor node customizations to work on UStateTreeEditorData
- Added separate detail customization for UStateTreeEditorData

#jira UE-147508
#rb Yoan.StAmant
#preflight 62820e55046b81bf93911605

[CL 20221385 by mikko mononen in ue5-main branch]
2022-05-16 05:13:27 -04:00