FMockAbilityInputCmd

Mock Ability Simulation This is meant to illustrate how a higher level simulation can build off an existing one.

Windows
MacOS
Linux

Inheritance Hierarchy

FFlyingMovementInputCmd

FMockAbilityInputCmd

References

Module

NetworkPredictionExtras

Header

/Engine/Plugins/Runtime/NetworkPredictionExtras/Source/NetworkPredictionExtras/Public/MockAbilitySimulation.h

Include

#include "MockAbilitySimulation.h"

Syntax

struct FMockAbilityInputCmd : public FFlyingMovementInputCmd

Remarks

Mock Ability Simulation This is meant to illustrate how a higher level simulation can build off an existing one. While something like GameplayAbilities is more generic and data driven, this illustrates how it will need to solve core issues.

This implements:

Stamina "attribute": basic attribute with max + regen value that is consumed by abilities.

Sprint: Increased max speed while sprint button is held. Drains stamina each frame.

Dash: Immediate acceleration to a high speed for X seconds.

Blink: Teleport to location X units ahead

Notes/Todo: -Cooldown/timers for easier tracking (currently relying on high stamina cost to avoid activating each frame) -Outward events for gameplay cue type: tying cosmetic events to everything -More efficient packing of input/pressed buttons. Input handling in general should detect up/down presses rather than just current state

MockAbility Data structures

Variables

Name Description

Public variable

bool

 

bBlinkPressed

Public variable

bool

 

bDashPressed

Public variable

bool

 

bSprintPressed

Functions

Name Description

Public function Const

void

 

Log

Public function

void

 

NetSerialize

(
    const FNetSerializeParams& P
)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss