35 Commits

Author SHA1 Message Date
yoan stamant
9563f11f2f [SmartObject]
- allow smart object creation from definition, transform and owner descriptor struct that will use dynamic ids
- moved FSmartObjectHandleFactory to the SmartObjectTypes and added method to get a dynamic id
- replaced registration type `WithCollection` by `BindToExistingInstance` in USmartObjectComponent since it can also be used for objects not tied to a component lifetime created from CreateSmartObject
- allow subsystem component accessor to force hydrate the actor associated to a smart object.
- fixed automation test to use the right property to set a definition asset now that it has been renamed
#rb Mieszko.Zielinski, mikko.mononen
#tests QAGame, unit tests, Juno

[CL 31295548 by yoan stamant in 5.4 branch]
2024-02-08 13:21:26 -05:00
yoan stamant
79e7604b96 [SmartObject] use runtime instance to fetch component for a given handle instead of the smartobject container to not rely on the object path.
#rb mikko.mononen

[CL 31006734 by yoan stamant in 5.4 branch]
2024-01-30 10:11:23 -05:00
mikko mononen
e4b5036e07 SmartObject: Added per object definition data
- added definition data for the whole object
- added GetDefinitionData() & GetDefinitionDataPtr() for the SO definition and slot definition
- Renamed FSmartObjectSlotDefinitionDataProxy -> FSmartObjectDefinitionDataProxy (removed slot)
- Renamed FSmartObjectSlotDefinitionData -> FSmartObjectDefinitionData (removed slot)

[CL 30077219 by mikko mononen in ue5-main branch]
2023-12-04 07:36:52 -05:00
mikko mononen
096756af13 SmartObject: Added claim priority which allows higher priority claims to override lower priority claims.
#rb Yoan.StAmant, Mieszko.Zielinski

[CL 30010180 by mikko mononen in ue5-main branch]
2023-11-30 02:26:33 -05:00
yoan stamant
5e375112b9 [SmartObject] added reasons to control the enabled states of smart objects:
- Gameplay tags are used to identify a reason
- Default reason "SmartObject.EnabledReason.Gameplay" is a tag (UE::SmartObject::EnabledReason::Gameplay) provided by the plugin and used by default if no other reason is specified
- Tags are converted to bit masks and stored as disable flags in runtime instance
- External systems can declare new Gameplay Tags for the specific needs. System currently allows 16 different reasons (1 default + 15 custom)
- A Smart Object  instance is considered disabled as soon as at least one reason is set
#rb Luciano.Ferraro, mikko.mononen

[CL 29989734 by yoan stamant in ue5-main branch]
2023-11-29 11:23:11 -05:00
mikko mononen
6c2279e57d SmartObject: Added outliner to asset editor
- Changed Smart Object definition slot data to contain GUI per data (allows to identify the data using ID)
- Added outliner to the editor, displays slots and definition data
- Made slots and definition data selectable in the details view
- Sync selection across details, outliner and 3D view for faster navigation

[CL 27440600 by mikko mononen in ue5-main branch]
2023-08-29 07:48:32 -04:00
ben hoffman
c3fe7f0458 Expose some smart object component, definition, and runtime options to blueprints to make it possible to have some very basic interactions with them inside a blueprint.
Mark the handle and SO definiton as replicated on the base Smart object Component class. For now, this won't do anything. Going forward we will create an "Online Smart object Component" that actually stores the additional replication data as to not add a bunch of unused data on existing uses of the component.

#jira UE-188873
#jira UE-180500
#rb Yoan.StAmant

[CL 27274296 by ben hoffman in ue5-main branch]
2023-08-22 12:17:21 -04:00
yoan stamant
d05f8826ea [SmartObject] Removed dependency on MassEntity to store slots
#rb mikko.mononen

[CL 26431776 by yoan stamant in ue5-main branch]
2023-07-18 08:42:51 -04: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
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
mikko mononen
2f2f301d65 WorldCondition: Allow query state to be bitwise relocatable, make tie to definition safer
- stored the whole condition cached state into the allocated memory to allow state to be bitwise relocated
- made definition UObject, and store reference to the definition directly into the state
- keep instantiated definitions alive (create new object)
- added query invalidation handle which is used to invalidate the query

#rb Mieszko.Zielinski
#preflight 63872b143377450900b57a46

[CL 23325777 by mikko mononen in ue5-main branch]
2022-11-30 07:17:21 -05:00
mikko mononen
37681817c0 SmartObjects: expose Smart Object owner actor for world conditions
- Store weak pointer to the owner actor when Smart Object is initialized
- Pass owner actor to world conditions
- Changed Smart Object logging to use full names where applicable

#preflight 637e0f082a05dabce9c5cd0e

[CL 23248750 by mikko mononen in ue5-main branch]
2022-11-23 09:11:13 -05:00
mikko mononen
924b989973 SmartObject: World conditions for SmartObject slot precondition
#rb Mieszko.Zielinski Luciano.Ferraro
#preflight 6375ef0b1c114bec053ccbe7
#preflight 6375fe028f4cb2e4dc8c4e4c

[CL 23174492 by mikko mononen in ue5-main branch]
2022-11-17 07:44:24 -05:00
mikko mononen
c06beb8571 SmartObject improvements
- Fixed hashing when adding shared fragment for smart object slot definition
- Added per slot Runtime Tags
- Added common event handling for Smart Object and Slot changes and events
- Added annotations, which are slot definition data that has visualization
- Added linked slot annotation which allows behavior reuse on slots
- Added editor only ID for each slot so that they can be identified during edits
- Added SmartObject slot reference type that can be used to reference other slots in the Smart Object
- Changed Smart Object bDisable to bEnabled
- Added separate enabled state for slots
- Changed Smart Object disable to send an event, not forcefully unclaim
- Added more visualization support for Smart Object editor (canvas, visualize annotations)
- Changed Smart Object editor to use the commonly transform for slots
- Remove Smart Object Component instance from the asset editor as it was not needed

#rb Stephen.Holmes
#preflight 6360f0cf63608aee36e01ba5

[CL 22888712 by mikko mononen in ue5-main branch]
2022-11-01 15:11:25 -04:00
Mieszko Zielinski
d55575b7d8 Added USmartObjectSubsystem.FindSmartObjectsWithLocations that similarly to FindSmartObjects fetched smart object slots matching given filter, but the result also contains smart object locations
Also added a handy "CanBeClaimed" function for testing individual slots.

#review-21737223
#preflight 6310808ae54ec9d581d0fade
#preflight 6310a9eae1124837759bf70f

[CL 21738872 by Mieszko Zielinski in ue5-main branch]
2022-09-01 09:03:19 -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
Mieszko Zielinski
d69aa84834 Separated "entity management" and USubsystem stuff of UMassEntityManager. Now UMassEntityManager hosts a shared ref of newly created FMassEntityManager, and users are free to create their own FMassEntityManager instances to create isolated entity pools.
Updated Mass code to reflect FMassEntityManager introduction

#jira UE-147658
#review-21335324
#review-21335330
#preflight 62f6384acf7afa018b93b9b5

[CL 21353355 by Mieszko Zielinski in ue5-main branch]
2022-08-12 07:56:27 -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
Yoan StAmant
9363b181ee GameplayBehaviorSmartObjects plugin to create and use SmartObjects using GameplayBehaviors as their default runtime instances.
#rnx
#preflight 626feb8f264f78f46f775c92

[CL 20008771 by Yoan StAmant in ue5-main branch]
2022-05-02 10:59:07 -04:00
yoan stamant
7641c72060 [SmartObject] updated API to remove all ensure and allow caller to provide unset handle or handle to object/slots that may not longer be registered in the simulation.
#rnx
#rb mikko.mononen
#rb josselin.francois
#preflight 623385990820efd0945e69d2

#ROBOMERGE-OWNER: yoan.stamant
#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 19425613 via CL 19431559 via CL 19435646 via CL 19436095
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19437148 by yoan stamant in ue5-main branch]
2022-03-18 12:31:49 -04:00
yoan stamant
478d81a61b [SmartObject] handles for SmartObject and SmartObjectSlot passed by value
#rnx
#rb trivial
#preflight 62322b8c6e25767a218d46b0

#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 19410090 via CL 19412659 via CL 19426193 via CL 19426309
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19429514 by yoan stamant in ue5-main branch]
2022-03-17 19:07:54 -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