Commit Graph

27 Commits

Author SHA1 Message Date
Ben Marsh
727313243d Fix non-unity compile errors.
#preflight none

[CL 20469864 by Ben Marsh in ue5-main branch]
2022-06-02 11:03:50 -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
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
mikko mononen
3077ab6616 StateTree: Commandlet to compile all StateTree assets
- Added StateTreeCompileAllCommandlet
- Fixed StateTree editor compile button indication

#jira UE-151007 UE-150881 UE-150883 UE-149897
#rb Yoan.StAmant
#preflight 627e31b9d445061f2a881a4f

[CL 20179071 by mikko mononen in ue5-main branch]
2022-05-13 06:32:28 -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
Yoan StAmant
5875739cb2 [StateTree] added StateTreeReference type customization
- StateTree asset allowed by a StateTreeReference can be filtered by using "meta=(schema="SomeSchema")" on the UPROPERTY of type StateTreeReference.
#rnx
#rb mikko.mononen
#preflight 627a6fd7e713fc6e2c4cddae

[CL 20122645 by Yoan StAmant in ue5-main branch]
2022-05-10 10:15:17 -04:00
Yoan StAmant
35cf1ec0cb [StateTree] NamedExternalDataDescs are now copied from schema to the StateTree at compilation. Schema derived classes need to override only one method to provide their descriptors.
#rnx
#rb mikko.mononen
#preflight 6274282203269096abd41d8f

[CL 20063572 by Yoan StAmant in ue5-main branch]
2022-05-05 15:58:09 -04:00
Yoan StAmant
af7394cf27 [StateTree] replaced StateTreeParameters by InstancedPropertyBag
#rnx
#rb mikko.mononen
#preflight 6273ec0f03269096abc99574

[CL 20059078 by Yoan StAmant in ue5-main branch]
2022-05-05 12:02:47 -04:00
mikko mononen
90b9339cda StateTree fixes
- Fixed unset index check in UStateTree::Link() and FStateTreeExecutionContext
- Changed FStateTreeExecutionContext to call ExitState() from leaf-to-root
- Fixed handling of empty sources in FStateTreePropertyBindings::CopyTo()

#jira none
#review
#preflight 6273c1005b05fb4f601353b4

[CL 20056497 by mikko mononen in ue5-main branch]
2022-05-05 08:44:57 -04:00
mikko mononen
f6770cf154 StateTree: Parametrized states
- Added specific "subtree" states which can be linked to via a "linked" state
- Subtrees can only bind data back to the their root state (or tree "global" data)
- Added property bag based parameters to subtree and linked states
- Update (transient) property bag structs before resolving property paths
- Linked states reflect their parameters from the state they link to
- Added property binding to and from parameters
- Relaxed the property binding to fail if the source data is not available
- Allow enter conditions to bind to tasks, and fail the expression if trying to access unaccessible data
- Added icon for linked and subtree states
- Added source type for all binding source structs
- Added UStateTreeEditorData::VisitHierarchy to simplify iterating over all states

#jira UE-147507
#rb Yoan.StAmant
#preflight 626a47182d28b9d0f77223f5

[CL 19954567 by mikko mononen in ue5-main branch]
2022-04-28 03:54:07 -04:00
Yoan StAmant
c135ebcd95 [StateTree]
+ Added StateTree parameters usable for data bindings and that could be overriden on context initialization by a StateTreeReference
+ Added StateTreeReference struct to hold a reference to a StateTree asset along with a list of values to parameterized the tree.
+ Added named external data items that are defined bt the Schema and for which values must be provided at runtime through the execution context.
+ Added delegate OnPostCompile after successful compilation. The StateTreeReference listens to it to validate its parameters
+ EditorData now contains its own version of the schema and parameters. On successful compilation they are copied over the StateTree own properties.
#rnx
#rb mikko.mononen
#preflight 6255d281647ad886b3593cb0

[CL 19727363 by Yoan StAmant in ue5-main branch]
2022-04-12 15:55:39 -04:00
Yoan StAmant
b4f64a59e0 [StateTree] external data validation from schema supported types
- fixed external requirements set by StateTreeBrainComponent to find more specific actor classes first before defaulting on AActor
- added missing supported type FMassSharedFragment for MassStateTreeSchema
- moved StateTreeLinker to it own file and handle its potential failures
#rb mikko.mononen
#rnx
#preflight 624d98fd8e5ae00f0aca3123

[CL 19646871 by Yoan StAmant in ue5-main branch]
2022-04-06 10:04:05 -04:00
mikko mononen
b156e83342 StateTree: Renamed baker to compiler
#jira none
#rb Yoan.StAmant
#preflight 624c465da64871f1a10a2ee6

[CL 19624175 by mikko mononen in ue5-main branch]
2022-04-05 09:44:28 -04:00
mikko mononen
1e28b99891 StateTree: Condition expressions
#jira UE-146925
#review-19478890
- Added ability to combine conditions into expressions
- Added editor UI for the expressions
- Replaced condition description with a name (makes the expressions faster to skim)
#preflight 62417309361866e20ffa6320

[CL 19524558 by mikko mononen in ue5-main branch]
2022-03-28 04:48:50 -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
julien marchand
f07cb02ce7 StateTree: Fix StateTree asset getting dirtied after PIE
- Mark the StateTree instance data standalone and transient
- Mark references to StateTree instance data struct transient

#jira UE-144758
#rb mieszko.zielinski
#preflight 6228846e0d5a90e98eb5fb0e
#lockdown nick.whiting

#ROBOMERGE-OWNER: julien.marchand
#ROBOMERGE-AUTHOR: mikko.mononen
#ROBOMERGE-SOURCE: CL 19320692 in //UE5/Release-5.0/... via CL 19323985
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19348060 by julien marchand in ue5-main branch]
2022-03-10 21:51:53 -05: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
mikko mononen
841dd874f1 StateTree: Renamed item to node
- Renamed uses of item to node
- Added base class for Conditions, Evals & Tasks

#jira UE-140363
#rb mieszko.zielinski
#preflight 61fa4083db42673a6020f1fb
#lockdown julien.marchand

#ROBOMERGE-AUTHOR: mikko.mononen
#ROBOMERGE-SOURCE: CL 18841581 in //UE5/Release-5.0/... via CL 18841871 via CL 18842048
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18842354 by mikko mononen in ue5-main branch]
2022-02-03 09:13:49 -05:00
mikko mononen
3f4f44a364 StateTree: UObject and BP support
- connect GetWorld() of FStateTreeExecutionContext explicitly to the owner
- take MassSignalSubsystem as parameter to FMassStateTreeExecutionContext directly
- separated DataViewIndex (what others see) and InstanceIndex/bInstanceIsObject (where the pointert comes from) on StateTree items
- allow item instance to be a struct or object
- added editor support for both struct or object based instance
- added Blueprint base classes for Eval, Task and Condition
- Update UStateTreeBrainComponent

#jira UE-135723
#review-18267822
#robomerge 5.0

[CL 18280804 by mikko mononen in ue5-main branch]
2021-11-24 04:26:12 -05:00
mikko mononen
9cb403b9ab StateTree: allow task/evaluator/condition to have separate data for isntance and item in the tree.
- Changed conditions to use the same code structure as tasks and evals
- Tasks, Evaluators, and Conditions can have separate struct for instance and tree item
- Converted existing tasks/evals/conds to use the new setup
- Updated the UI to use the new setup
- Limited the property binding to only first level properties in the instance struct
- Removed StateTreeConditionItemDetails (uses the same details customization as tasks/evals)
- Removed bunch of old test tasks and evals

#jira UE-133870
#rb Yoan.StAmant
#robomerge 5.0

[CL 18165353 by mikko mononen in ue5-main branch]
2021-11-12 05:48:11 -05:00
mikko mononen
541195b2f4 StateTree: Fixed validation crash in GetExternalItem()
#jira none
#rb Mieszko.Zielinski
#robomerge 5.0

[CL 18083196 by mikko mononen in ue5-main branch]
2021-11-08 06:38:40 -05:00
mikko mononen
fc5be99181 StateTree: calculate external item indices correctly
#jira none
#review-18030584
#robomerge 5.0

[CL 18031381 by mikko mononen in ue5-main branch]
2021-11-03 07:01:08 -04:00
mikko mononen
a434bdedfb StateTree: Resolve external dependecies at load time instead of bake time
- added StateTree linker
- added Link() method to tasks and evaluators
- added templated item reference which makes getter code less error prone

#jira none
#review-17921724
#robomerge 5.0

[CL 17941680 by mikko mononen in ue5-main branch]
2021-10-27 06:10:12 -04:00