22 Commits

Author SHA1 Message Date
yoan stamant
8392b4ee6b [SmartObjects]
- RemoveComponentFromSimulation is now properly unbinding the component
- Unbinding a component from the simulation won't invalidate the registered handle anymore; this is handled by the FSmartObjectContainer.
- Removed obsolete RuntimeCreatedEntries that was replaced by the registration type.
- Added IsBoundToSimulation to the SmartObjectComponent to differentiate a registered component (valid Handle) from a registered component bound to the simulation (linked to its runtime instance)
- DebugUnregisterAllSmartObjects will no longer cause an ensure when calling EndPlay with the previous fixes.
- Added unit tests for IsBoundToSimulation and RemoveComponentFromSimulation+UnregisterSmartObject sequence to simulate the EndPlay issue.
#tests PIE, rebuild collection, WorldPartition levels, used cheats multiple times
#rb mieszko.zielinski
#preflight 64709c8a893dadf035e51c75

[CL 25647084 by yoan stamant in ue5-main branch]
2023-05-26 12:48:38 -04:00
yoan stamant
ca4d7ba5fd [SmartObject] moved registration to BeginPlay/EndPlay for components used in a Game world. This will allow conditions to rely on a fully initialized actor in case they need to access other components. It will also make it easier to spawn a SmartObject actor and setup its definition before finishing the spawning.
#jira-none
#rb mieszko.zielinski
#preflight 644001d0bf10538466b1aa0d

[CL 25116704 by yoan stamant in ue5-main branch]
2023-04-19 17:32:09 -04:00
luciano ferraro
afb48ac56d Added an exposed native C++ event on the SmartObject component, fired when a StateTree runtime event is fired
#jira
[FYI] Mikko.Mononen, phil.cole, wojciech.madry, Parker.Linn
#preflight 63f8defddd78dd50f67b1ae3

[CL 24406726 by luciano ferraro in ue5-main branch]
2023-02-24 14:59:17 -05:00
yoan stamant
adf6cb0a20 [SmartObjects]
- Added new methods to the API to filter a list of request results or slot handles by evaluating the selection preconditions
- Filter methods can accept external data as a struct with properties which name and type match the WolrdConditionContext.
- FSmartObjectUserContext has been introduced to cover the common case of passing in a user actor to the context.
- Stored UserDescriptor as instanced struct in the runtime slot
- Claim methods now receive a user descriptor
- Removed slot event delegate and reuse the runtime instance one instead. Listeners can filter for a given slot using 'Event.SlotHandle'
- Removed UserTags from the SmartObjectWorldConditionSchema. The user tags are part of the query filter. Conditions requiring user tags could fetch them from the actors passed in the context.
#rb mikko.mononen
#jira UE-157763
#preflight 63dbe99f797b029c0add9806

[CL 23984054 by yoan stamant in ue5-main branch]
2023-02-02 18:43:13 -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
yoan stamant
bb96d7229f [SmartObject] fixed typo
#rb trivial
#rnx
#preflight 63cef923544e5bb075681b18

[CL 23824442 by yoan stamant in ue5-main branch]
2023-01-23 18:47:59 -05:00
yoan stamant
1f6c7d722f [SmartObjects]
- Removed synchronization logic between ability system component and smartobject instance tags.
- Added SmartObject subsystem to the SmartObjectWorldConditionSchema to help fixing unit tests where we use a derived subsystem. Updated existing SmartObject world conditions to use it.
- Added support for world conditions to the main smart object instance (in addition to those in each slot). Slots could be also disabled by their parent conditions.
- Removed object tags filter from the definition and replaced it by the newly added condition (FWorldCondition_SmartObjectActorTagQuery)
#rb mikko.mononen
#preflight 63c6c3530b358b97d198a121

[CL 23756420 by yoan stamant in ue5-main branch]
2023-01-18 10:52:51 -05:00
bob tellez
09e68111e3 [Backout] - CL23741166
[FYI] Yoan.StAmant
Original CL Desc
-----------------------------------------------------------------
[SmartObjects]
- Removed synchronization logic between ability system component and smartobject instance tags.
- Added SmartObject subsystem to the SmartObjectWorldConditionSchema to help fixing unit tests where we use a derived subsystem. Updated existing SmartObject world conditions to use it.
- Added support for world conditions to the main smart object instance (in addition to those in each slot). Slots could be also disabled by their parent conditions.
- Removed object tags filter from the definition and replaced it by the newly added condition (FWorldCondition_SmartObjectActorTagQuery)
#rb mikko.mononen
#preflight 63c6c3530b358b97d198a121

[CL 23752170 by bob tellez in ue5-main branch]
2023-01-18 01:06:45 -05:00
yoan stamant
853ad94e66 [SmartObjects]
- Removed synchronization logic between ability system component and smartobject instance tags.
- Added SmartObject subsystem to the SmartObjectWorldConditionSchema to help fixing unit tests where we use a derived subsystem. Updated existing SmartObject world conditions to use it.
- Added support for world conditions to the main smart object instance (in addition to those in each slot). Slots could be also disabled by their parent conditions.
- Removed object tags filter from the definition and replaced it by the newly added condition (FWorldCondition_SmartObjectActorTagQuery)
#rb mikko.mononen
#preflight 63c6c3530b358b97d198a121

[CL 23747892 by yoan stamant in ue5-main branch]
2023-01-17 18:37:13 -05:00
mieszko zielinski
2da21261b0 Deprecated ESmartObjectUnregistrationMode and its use in SmartObjectComponent registration and unregistration and introduced two explicit paths for smart object removal:
* Unregister - keeps or deletes the runtime SO information based on SmartObjectComponent.RegistrationType
* Remove - called on SmartObject's EndPlay and ends up removing runtime data regardless of the registration type.

Also:
* SmartObjectSubsystem unfriended SmartObjectComponent - it was a toxic relationship anyway! ;)
* Made changes towards simplification of how things are done - Registering, Unregistering, Binding SO Component to a RuntimeInstance.

#preflight 6390906fbb6fefa4721822e4

[CL 23431219 by mieszko zielinski in ue5-main branch]
2022-12-07 13:05:23 -05:00
mieszko zielinski
bccb817a3f SmartObject registrations changes.
- SmartObject gained knowledge whether it was registered as a part of a colleciton, or as a dynamic smart object.
- cleaned up SmartObjectComponents SOHandle setting an resetting - there's a separate function for invalidating the handle.
- added handling of SmartObjectComponent's destruction (as opposed to unregistration due to being streamed out, potentially temporarily)

#preflight 638a25c74c3ce8ae5d20ba60

[CL 23389318 by mieszko zielinski in ue5-main branch]
2022-12-05 08:19:29 -05:00
mieszko zielinski
bf25520ccc SmartObject collection rework, introducing a FSmartObjectContainer type that encapsulates SmartObjectComponent registration and storage. The SmartObjectSubsystem now stores a Container that aggregates all other containers supplied by loaded/streamed in SmartObjectPersistentCollection instances.
In addition:
* SmartObjectCollection got deprecated and there's a auto-update path triggered in SmartObjectCollection::PostLoad
* SmartObjectComponent component can opt out of being a part of a collection with `bCanBePartOfCollection`
* Right now we limit SmartObjects to be registered with at most a single Collection. This might change in the future if required.

Note that this is the first change in a series, we're going to support miltiple collections per level with convenient ways of assigning SmartObjects to individual collections.

#jira UE-168977
#preflight 637f8faa4004f73f627ecaca

#preflight 637fa5378b12eb83a77ad7d9

[CL 23262132 by mieszko zielinski in ue5-main branch]
2022-11-24 14:53:52 -05:00
luciano ferraro
8d81044051 Fixed issue with actors that initialize the ability system component after the OnRegister phase
#jira
[REVIEW] [at]Mikko.Mononen
[FYI] Josselin.Francois, Loic.Devaux
#preflight 632c46ebc7791417aa78bd37

[CL 22165506 by luciano ferraro in ue5-main branch]
2022-09-23 20:48:44 -04:00
yoan stamant
4b56d97931 [SmartObject] added support for GameplayTags on runtime instance
+ SmartObjectComponent acts a bridge to sync tags from the RuntimeInstance and the AbilitySystemComponent (if present on the owning actor)
+ Component streamed out and back it will be bound with their persistent counterpart from the simulation and will synchronize their tags
+ RuntimeInstance and Slot now have a dedicated state when they are disabled when the instance tags don't pass the restrictions defined in the SmartObjectDefinition (ObjectTagFilter)
+ Made a pass to improve consistency in error reporting and methods descriptions
+ Added methods to validate if the object/slot associated to a FSmartObjectClaimHandle and FSmartObjectSlotHandle is still valid when those are stored and not used immediately after a call to any of the 'Find' or 'Claim' methods
#rnx
#rb mikko.mononen
#preflight 6230a0b4e65a7e65d68741e4

#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 19386803 via CL 19389419 via CL 19398538 via CL 19398590
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19403765 by yoan stamant in ue5-main branch]
2022-03-16 03:47:02 -04:00
yoan stamant
dca951147a [SmartObject] added component instance data for SmartObjectComponent so component can properly register itself while re-running the construction scripts.
This is required since the newly created components in the process will try to register before the Definition asset gets set.
#rb maxime.mercier
#rnx
#preflight 61faf0935e35b9215bfedaab

#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 18841643 via CL 18842123 via CL 18842168 via CL 18845170 via CL 18845776
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18845836 by yoan stamant in ue5-main branch]
2022-02-03 13:28:03 -05:00
yoan stamant
2bc6238d48 [SmartObject] allow component instances to set the Definition to use
#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 18793780 via CL 18794498 via CL 18795751 via CL 18800967 via CL 18801136
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18801271 by yoan stamant in ue5-main branch]
2022-01-31 18:38:28 -05:00
yoan stamant
04214fbc78 [SmartObject] allow custom definitions (FSmartObjectSlotDefinitionData) and transient state data (FSmartObjectSlotStateData) per slot using MassEntity
+ replaced all methods Describe by LexToString
+ unified naming from "*ID" to *Handle
#preflight 61e85d121000e8c59a78c886
#rb mikko.mononen

#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 18662203 in //UE5/Release-5.0/... via CL 18662234 via CL 18662264
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18662291 by yoan stamant in ue5-main branch]
2022-01-19 14:16:16 -05:00
Yoan StAmant
0733debda8 [SmartObjects] merged USmartObjectDefinition with FSmartObjectConfig and replaced references to config
#preflight 61a118b7664cbb92c762f37b

[CL 18301080 by Yoan StAmant in ue5-main branch]
2021-11-26 12:55:06 -05:00
Yoan StAmant
380fe67325 [SmartObject] SmartObjectConfig is no longer part of the component and content will instead be stored in a Definition asset.
#rb mikko.mononen
#preflight 61a0df88f70a9e92db9ac90f

[CL 18300133 by Yoan StAmant in ue5-main branch]
2021-11-26 09:52:13 -05:00
Yoan StAmant
8c6eb76fe0 [SmartObjects]
* Collection entry holds the Transform, Bounds and Index to the shared configuration. This removes the dependency on components being loaded to create runtime data for partitioned worlds.
* Removed commented references to SparseClassData since that approach won't be used (actor component not supported)
* Runtime data now points to a shared configuration from the collection instead of holding a copy
* Subsystem tracks components registered at runtime so the collection can be updated accordingly since those entries won't persist outside of loading range
* Moved most initialization code for the subsystem to the OnWorldComponentsUpdated callback since active level collection is set and actors from the persistent level registered.

[WorldPartitionBuilder]
* Added OnPartitionBuildStarted/OnPartitionBuildCompleted virtual methods
* New UWorldPartitionSmartObjectCollectionBuilder to build SmartObjectCollection in partitioned worlds

#preflight 61814a46fc786a0001447995
#jira UE-105113
#rb maxime.mercier
#robomerge FnMain

[CL 18019580 by Yoan StAmant in ue5-main branch]
2021-11-02 11:09:09 -04:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
mieszko zielinski
31a5065342 Moved GameplayBehaviors out of restricted folder over to Experimental
Moved SmartObjects out of restricted folder
Moved StateTree out of restricted folder
Moved ZoneGraph out of restricted folder
Moved ZoneGraphAnnotations out of restricted folder

#jira UE-115297

#ROBOMERGE-OWNER: mieszko.zielinski
#ROBOMERGE-AUTHOR: mieszko.zielinski
#ROBOMERGE-SOURCE: CL 17648223 via CL 17648246 via CL 17648261 via CL 17648385 via CL 17648390
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v875-17642767)
#ROBOMERGE-CONFLICT from-shelf
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17648742 by mieszko zielinski in ue5-release-engine-test branch]
2021-09-28 13:33:00 -04:00