Motion 2.0 Preview 1
This version represents a major refactoring focused on improving modularity, ease of integration, multiplayer readiness (via the Gameplay Ability System), and adherence to standard Unreal Engine practices.
DANGER
This is a preview version. It is only intended for evaluation purposes and should not be used to upgrade an existing project!
Major Changes & Refactoring
- Gameplay Ability System (GAS) Integration:
- Core state management (e.g., Crouching) and attribute modification (e.g., Speed) are now expected to be handled via GAS Gameplay Tags, Gameplay Abilities, and Gameplay Effects. This leverages GAS's built-in replication features.
- Components like
UMotionCrouchComponentnow primarily react to replicated GAS tags rather than managing state internally. - Removed custom
UMotionAbilitySystemComponent. Users should use the standard engineUAbilitySystemComponentor their own subclass. - Requirement: Using features like replicated crouching now implicitly requires the user's project to have GAS enabled and configured (ASC, AttributeSet).
- Decoupled Components: Components are designed to be more self-contained and have fewer dependencies on specific base classes or sibling components.
- Input System Overhaul:
- Input binding is now the user's responsibility, typically handled in their Character or PlayerController's
SetupPlayerInputComponentfunction using the standardUEnhancedInputComponent. - Removed
UMotionInputComponent. Helper functionBindActionByTag(which relied onUMotionInputConfig) removed fromUMotionAbilitySystemHelper. - Removed
UMotionInputConfigData Asset. Users should manage input action references directly or via their own configuration methods.
- Input binding is now the user's responsibility, typically handled in their Character or PlayerController's
- Base Class Removal (
AMotionCharacter):- Removed the
AMotionCharacterC++ class entirely from the plugin source. It is no longer required or recommended for direct inheritance. - Users should inherit directly from
ACharacter(or their own base character) and add Motion components manually. - The provided
B_MotionCharacterBlueprint now serves as the primary example demonstrating component setup and integration.
- Removed the
- Movement Component Removal (
UMotionCharacterMovementComponent):- Removed the custom
UMotionCharacterMovementComponentclass entirely. - Users should use the standard
UCharacterMovementComponent. - Speed Management: Functionality like additive speed modifiers (previously handled by the custom CMC) must now be implemented using GAS Attributes (e.g.,
MaxWalkSpeed) and Gameplay Effects applied by user Gameplay Abilities. The final attribute value needs to be synced back to the standard CMC'sMaxWalkSpeedproperty by the user. Checks likeState.Movement.Haltedshould also be implemented via Gameplay Effects modifying the speed attribute. A sample component that implements this behaviour ships with Motion (SpeedSyncComponent).
- Removed the custom
- Camera Component Refactoring (
UMotionCameraComponent):- Removed the dependency on the separate
UMotionCurveManagercomponent. - The component now manages and evaluates its own internal curve arrays (
CameraLocationCurves,CameraRotationCurves) via itsTickComponent. - Added Blueprint-callable functions for managing these internal curves dynamically.
- Removed the dependency on the separate
- Crouch Component Refactoring (
UMotionCrouchComponent):- State management (
bIsInCrouch) removed; now reacts to theState.Movement.CrouchingGameplay Tag on the ASC. - Input handling (
SetCrouch,DoCrouch,DoUncrouch) removed; input should trigger a Gameplay Ability. - Speed modification removed; expects a Gameplay Ability to apply/remove speed-modifying Gameplay Effects.
PerformCapsuleResizefunction added to handle physical changes based on tag state changes.CanUncrouchfunction remains for server-side ability checks.
- State management (
- Native Gameplay Tags:
- Implemented standard native Gameplay Tag definition (
MotionGameplayTags.h/.cpp,Config/DefaultGameplayTags.ini, initialization inStartupModule). - Code now references tags via the static getter (e.g.,
FMotionGameplayTags::Get().State_Movement_Crouching).
- Implemented standard native Gameplay Tag definition (
- Asset Referencing: Consistently uses
TSoftObjectPtrfor asset references (UInputAction,UMetaSoundSource) in configuration structs/assets where appropriate. - Extensibility: Key component functions marked
virtual. - Code Quality: Added more logging (
UE_LOG) and improved comments. - Sprint Component Refactoring
UMotionSprintComponent: Added a C++ sprint component (Source/MotionCore/Components/MotionSprintComponent.h/.cpp) designed to work with GAS. It reacts to theState.Movement.Sprintingtag, primarily for triggering cosmetic effects (like camera curves) or providing a hook point. Does not manage speed. - Movement Sound Component Refactoring
UMotionMovementSoundComponent:- Added optional throttling for footstep and landing effects (
MinTimeBetweenFootsteps,MinTimeBetweenLandings). - Added basic environmental context detection via sphere overlap (
EnvironmentCheckRadius,EnvironmentCheckChannel,WetEnvironmentActorTag) and passes detected tags (e.g.,Motion.Environment.State.Wet) to the Gameplay Cue viaAggregatedSourceTags. - Passes character Effect Profile tags (
Motion.Character.EffectProfile.*) from the ASC to the Gameplay Cue viaAggregatedSourceTags. - Uses a custom
FMotionMovementEffectContextto passHitResult,SurfaceType,Speed, andImpactVelocityZviaParameters.EffectContext. The context now also stores a pointer to the resolvedFSurfaceEffectAssetsdata row to simplify Cue logic.
- Added optional throttling for footstep and landing effects (
- Updated
FMotionMovementEffectContextStruct: AddedEffectAssetsDatapointer member. - New
UMotionGameplayCueNotify_StaticBase Class: Added a C++ base class (AbilitySystem/MotionGameplayCueNotify_Static.h/.cpp) for the generic movement FX cue. This class contains the core logic for parsing context, selecting sound variations based on weight/type, and spawning effects (sound, decal, particle), simplifying user implementation. Users should inherit their Gameplay Cue Blueprint from this class. - New Gameplay Tags: Added tags for Effect Profiles (
Motion.Character.EffectProfile.*) and Environmental Context (Motion.Environment.State.*,Motion.Environment.Location.*) toFMotionGameplayTags. - Jump Component Refactor
UMotionJumpComponent: Added a C++ jump component (Source/MotionCore/Components/MotionJumpComponent.h/.cpp) designed to work with GAS. It reacts to theState.Movement.Jumpingtag, primarily for triggering cosmetic effects (like camera curves). Does not manage jump height/speed. - Breathe Component Refactor
UMotionBreatheComponent: Converted from Blueprint. Now ticks to check velocity and adds/pauses a breathing curve directly onUMotionCameraComponent. Removed dependency onUMotionCurveManagerandAMotionCharacterdelegates. - New
EMotionAbilityInputIDEnum: Added a C++ enum (Public/AbilitySystem/MotionAbilityInputID.h) for defining logical ability input IDs, used for binding Enhanced Input to GAS. - New/Updated
UMotionAbilitySystemHelper: Added static Blueprint-callable helper functions:BindEnhancedInputActionToASC: Binds Enhanced InputStarted/Completedevents toASC::AbilityLocalInputPressed/Releasedusing anEMotionAbilityInputID.GetEnhancedInputComponentFromActor: Gets and casts the input component from an actor.TriggerAbilityInputReleased: Explicitly callsASC::AbilityLocalInputReleased(workaround for potentialWaitInputReleaseissues).
- Updated
UMotionSprintComponent: Added functions and state variables (StartRampDown,StopRampDown,GetCurrentSprintDuration,GetRampDownElapsedTime,GetPeakSprintBonus,IsRampingDown,bIsRampingDown,RampDownStartTime,PeakSprintBonus) to support gradual ramp-down logic driven by a Gameplay Ability.
Deprecations / Removals
BPC_WalkComponent.uasset: Removed. This component is considered redundant in the new GAS-focused architecture. Base walking speed should be managed via GAS Attributes, state is implied by the absence of other movement tags (Sprint, Crouch), and cosmetics are handled by other components (MovementSound, Camera) or AnimBP.BPC_BreatheComponent.uasset: Replaced by the refactored C++UMotionBreatheComponent. Users should ensure aUMotionCameraComponentexists on the character and configure the breathing curve on theUMotionBreatheComponent.BPC_SprintComponent.uasset: Replaced by the new C++UMotionSprintComponent. Users should migrate any custom logic and use the new component with a correspondingGA_Character_SprintGameplay Ability.BPC_JumpComponent.uasset: Replaced by the new C++UMotionJumpComponent. Users should migrate any custom logic and use the new component with a correspondingGA_Character_JumpGameplay Ability.BPC_MovementSoundComponent.uasset: Replaced by the refactored C++UMotionMovementSoundComponent. Users need to migrate to the new Gameplay Cue based system, creating aSurfaceEffectsTableDataTable (usingFSurfaceEffectAssets), implementing a generic Gameplay Cue Blueprint, and updating Anim Notifies.FStructMovementSound: Replaced byFSurfaceEffectAssets.EMovementSoundTypes: Enum removed fromMotionEnums.h(replaced by Gameplay Tags).UMotionInputComponent: Removed entirely (.hand.cpp). Helper functionBindActionByTag(which relied onUMotionInputConfig) removed fromUMotionAbilitySystemHelper. Users should use the standardUEnhancedInputComponent.UMotionAbilitySystemComponent: Removed entirely (.hand.cpp). Users should use the standardUAbilitySystemComponentor their own subclass. Dependency inUMotionAnimInstanceremoved.AMotionPlayerController: Removed entirely (.hand.cpp). Users should use the standardAPlayerController.AMotionGameMode/B_MotionGameMode.uasset: Removed entirely (.h,.cpp,.uasset). The plugin does not require a specific GameMode.UMotionCurveManager: Removed entirely (.hand.cpp). Functionality integrated intoUMotionCameraComponent.AMotionCharacter: Removed entirely (.hand.cpp). Functionality moved to components or documentation examples.UMotionCharacterMovementComponent: Removed entirely (.hand.cpp). Users should use the standardUCharacterMovementComponent. Speed/state logic moved to user-implemented GAS Attributes/Effects/Abilities.UMotionInputConfig: Removed entirely (.hand.cpp). Users manage input actions directly.UMotionCrouchComponent's internal state management, direct input handling (SetCrouch,DoCrouch,DoUncrouch), and direct speed modification.- Removed hard
TObjectPtrreferences toUInputActionandUMetaSoundSourcein config/structs (replaced withTSoftObjectPtr).
Known Issues / Important Notes
- This version requires the Gameplay Ability System (GAS) and Enhanced Input plugins to be enabled for full functionality, especially replication.
- Users must now handle input binding and ability granting within their own project setup. Example code and documentation should be consulted.
- Users need to provide Gameplay Abilities (like
GA_Character_Crouch,GA_Character_Sprint,GA_Character_Jump) and Gameplay Effects (likeGE_Movement_CrouchSpeed,GE_Movement_SprintSpeed) to drive the component logic via GAS tags and attributes. Example assets should be provided. - Users need to create a DataTable based on
FSurfaceEffectAssetsand create a Gameplay Cue Blueprint inheriting fromUMotionGameplayCueNotify_Static(or implement similar logic) to use theUMotionMovementSoundComponent. - The example Blueprint
B_MotionCharacter(now inheriting directly fromACharacter) serves as the primary example and must be updated by the plugin provider to reflect the new architecture (using C++ components, GAS integration, correct input binding).