Commit Graph

133 Commits

Author SHA1 Message Date
yoan stamant
67c4a8f7ac [SmartObject] added config to clear world preconditions for client builds
#rb mikko.mononen
#rb francis.hurteau

[CL 30410807 by yoan stamant in ue5-main branch]
2023-12-20 08:17:55 -05:00
justin peterson
fe10e8a1ec [Backout] - CL30398852 - CIS Stage Warning
[FYI] Yoan.StAmant
Original CL Desc
-----------------------------------------------------------------
[SmartObject] added config to clear world preconditions for client builds
#rb mikko.mononen, francis.hurteau

#virtualized

[CL 30406910 by justin peterson in ue5-main branch]
2023-12-19 19:47:10 -05:00
yoan stamant
649766d866 [SmartObject] added config to clear world preconditions for client builds
#rb mikko.mononen, francis.hurteau

#virtualized

[CL 30398918 by yoan stamant in ue5-main branch]
2023-12-19 12:59:33 -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
yoan stamant
203a091b6c [SmartObjects] unified the global UE::SmartObject namespace
#rb mikko.mononen

[CL 29934918 by yoan stamant in ue5-main branch]
2023-11-27 10:57:29 -05:00
mikko mononen
cc737f3eef [SmartObject] Added method to update SO transform
- Added UpdateSmartObjectTransform() to allow to update the Smart Object location at runtime
- Change spatial partitioning Add() to take ref to the handle to avoid alloc when readding

#rb Yoan.StAmant

[CL 29884931 by mikko mononen in ue5-main branch]
2023-11-22 04:49:00 -05:00
yoan stamant
a788975f6b Fixed type conversion warnings
#rb mikko.mononen

[CL 27890994 by yoan stamant in ue5-main branch]
2023-09-14 15:23:22 -04:00
ben hoffman
04773d7a0d Add a Find Smart Object from Targeting System request to smart objects. The targeting system is often used for player interactions to determine what the player is "targeting", so being able to find the smart objects that a player is looking at will make using smart objects for player interaction easier!
#jira UE-188874
#rb Yoan.StAmant
#prelight 64f791edf140ae6e397ecdd3

[CL 27611983 by ben hoffman in ue5-main branch]
2023-09-05 16:59:33 -04:00
ben hoffman
8c35dff059 Add Find Smart Object functions that take in AActor's and avoid using the normal QueryBox.
This is more friendly to the UE Gameplay Framework and lets you pass in specific actor's that you case about. If you had to use a spatial query, then you may get results from objects that you don't explictly want if they are overlapping objects.

Add a function to check if the subsystem is running on the server or not to make doing some future replication checks easier

#jira UE-180500
#rb mikko.mononen

[CL 27597760 by ben hoffman in ue5-main branch]
2023-09-05 11:29:58 -04: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
42fea863f2 - Add a ToString function for FSmartObjectClaimHandle in Blueprints
- Add a static accessor to an invalid FSmartObjectClaimHandle in blueprints so that you can easily set default values and compare handles to check validitiy.

#rb Yoan.StAmant
#rnx

[CL 27319965 by ben hoffman in ue5-main branch]
2023-08-23 16:55:48 -04:00
ben hoffman
62ceb709ea Fix the display name on K2_GetSlots to be pretty
#rb trivial
#rnx

[CL 27283535 by ben hoffman in ue5-main branch]
2023-08-22 16:00:16 -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
mikko mononen
43048ec34c [SmartObjects] Added events to listen to Smart Object Component bind/unbind
- Exposed USmartObjectComponent.IsBoundToSimulation() to BP

[CL 27197315 by mikko mononen in ue5-main branch]
2023-08-18 03:54:54 -04:00
mikko mononen
b5f6447b2d [SmartObjects] Made USmartObjectSubsystem::QueryAllValidatedEntranceLocations() static so that it can be used even if SO subsystem is not available.
[CL 27064404 by mikko mononen in ue5-main branch]
2023-08-14 03:40:42 -04:00
mikko mononen
33bb4fe2c0 [SmartObjects] Added ability to validate a smart object definition and return all validated entries.
- Added Object enabled/disabled events to Smart Object lifetime to make it easier to react to the Smart Object enabled status
- Changed FSmartObjectSlotEntranceLocationRequest to be a BP type
- Changed FSmartObjectSlotEntranceLocationRequest.UserCapsule optional to invalid default value to make it easier to interface with BP
- Added FSmartObjectSlotEntranceLocationResult.bIsValid to be able to return results where the validation fails
- Added USmartObjectSubsystem.QueryAllValidatedEntranceLocations() which allows to validate SO definition, but does not require a registered Smart Object (can be used e.g. got object placement UI feedback)
- Added some helpers to allow to reuse validation between multiple methods in USmartObjectSubsystem

[CL 26987173 by mikko mononen in ue5-main branch]
2023-08-10 07:02:20 -04:00
luciano ferraro
4dfa27e83f Exposed a setter/getter SO enable method to the SO Component
[REVIEW] [at]Mikko.Mononen, [at]Yoan.Stamant
[FYI] Phil.Cole, Parker.Linn

[CL 26952120 by luciano ferraro in ue5-main branch]
2023-08-09 07:28:41 -04:00
ben hoffman
40d759dcf7 Add some more Blueprint Functionality to the Smart Object system.
- BP functions for checking if slot handles are equal or not
- to string functions for slots and handles
- is valid functions for slot handles

#rb Yoan.StAmant

[CL 26642750 by ben hoffman in ue5-main branch]
2023-07-27 11:52:42 -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
ben hoffman
176e409bd8 Add two Smart Object Request Filter options to return claimed and/or disabled slots too
#rb Mikko.Mononen, Yoan.Stamant

#ushell-cherrypick of 26314489 by kristof.morva1

[CL 26329438 by ben hoffman in ue5-main branch]
2023-06-29 17:44:56 -04:00
yoan stamant
753667ce6d [SmartObject] some cleanup in the blueprint API for SmartObjects
- replaced 'SmartObjectSubsystem.Claim' by 'MarkSlotAsClaimed' for native code and 'USmartObjectBlueprintFunctionLibrary::MarkSmartObjectSlotAsClaimed' for Blueprints
- replaced 'SmartObjectSubsystem.Use' by 'MarkSlotAsOccupied' for native code and 'USmartObjectBlueprintFunctionLibrary::MarkSmartObjectSlotAsOccupied' for Blueprints
- replaced 'SmartObjectSubsystem.Release' by 'MarkSlotAsFree' for native code and 'USmartObjectBlueprintFunctionLibrary::MarkSmartObjectSlotAsFree' for Blueprints
- deprecated 'UGameplayBehaviorSmartObjectsBlueprintFunctionLibrary::UseGameplayBehaviorSmartObject' in favor of the aync task based versions
- UFUNCTION versions are redirected directly to the new names. Native versions are deprecated.
- updated 'AITask_UseGameplayInteraction' and 'AITask_UseGameplayBehaviorSmartObject' to be as close as possible since they are two similar use cases but for different plugins.
   - both tasks now propose blueprint callables to create an "interact on spot" or "move to and interact" tasks:
      - 'UseSmartObjectWithGameplayBehavior' and 'MoveToAndUseSmartObjectWithGameplayBehavior'
      - 'UseSmartObjectWithGameplayInteraction' and 'MoveToAndUseSmartObjectWithGameplayInteraction'
   - 'AITask_UseGameplayBehaviorSmartObject::UseClaimedGameplayBehaviorSmartObject' is redirected to 'MoveToAndUseSmartObjectWithGameplayBehavior' to preserve current behavior
   - 'AITask_UseGameplayInteraction::UseClaimedGameplayInteractionSmartObject' is redirected to 'UseSmartObjectWithGameplayInteraction' to preserve current behavior
#jira UE-187209
#rnx

[CL 25871194 by yoan stamant in ue5-main branch]
2023-06-08 10:34:40 -04:00
mikko mononen
1cd2e0af30 GameplayInteractions: added entrance handle to interaction context
- Added entrance handle to the data that is passed to the interaction context, exposed to state tree
- Changed entrance tags to a tag container
- Added State Tree task to get entrance tags from an entrance handle

[CL 25813984 by mikko mononen in ue5-main branch]
2023-06-06 09:07:47 -04:00
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