A small Unreal Engine 5 gameplay subsystem demonstrating clean C++ structure, modular design, and data-driven tuning through a lightweight “Ability System”.
This is intentionally not a full gameplay prototype. The focus is a reusable gameplay framework component that could live inside a real project.
For better quality showcase refer to
Docs/AbilitySystemSampleShowcase_Compressed.mp4.
-
Separation of responsibilities
- AbilityComponent owns abilities, routes activation requests, tracks cooldowns, and exposes events.
- Ability base class defines a polymorphic interface (
CanActivate,Activate) for concrete abilities. - AbilityData (DataAssets) provide tuning/configuration without recompilation.
-
Non-trivial logic
- cooldown end timestamps + timers
- ID-based ability registry
- activation failure reasons
- event broadcasting / defensive checks
-
Minimal Blueprint usage
- DataAssets for tuning
- Projectile uses a BP child for visuals/debug (C++ drives logic; BP hooks are optional)
- Open the
.uprojectin Unreal Engine 5.3 - Build (Development Editor is fine)
- Play In Editor (PIE)
- 1 →
Dash - 2 →
Projectile - 3 →
PulseScan
Output is observable via:
- Character movement (Dash)
- Spawned projectile (Projectile)
- Debug sphere + log listing scanned actors (PulseScan)
- Output Log + optional on-screen debug messages (activation/cooldowns/failures)
Impulse-based forward movement. Tunable in DA_DashAbility (strength, cooldown).
Spawns a projectile actor. Collision/impact is handled in C++ and can optionally trigger Blueprint events for debug/FX. Tunable in DA_ProjectileAbility (speed, lifespan, cooldown, etc.).
Instant sphere query around the player; logs found actors and optionally draws a debug sphere. Tunable in DA_PulseScanAbility (radius, channel, debug draw).
-
Lives on the actor (player character)
-
Builds the runtime registry of abilities from
AbilityDataAssets -
Public entry point:
TryActivateAbility(FName AbilityId)
-
Cooldowns:
- stored as end timestamps in a map
- remaining time computed from
WorldTimeSeconds
-
Events (C++ multicast delegates):
OnAbilityActivatedOnAbilityFailed(includes fail reason + cooldown remaining)OnCooldownChanged
- Instanced as a UObject owned by
UAbilityComponent - Holds:
AbilityIdUAbilityData*pointer (tuning/config)- owner component reference
- Overridable surface:
CanActivateActivate
- DataAssets define:
AbilityIdAbilityClassCooldownSeconds(+ optional duration field for future extension)
- Ability-specific derived DataAssets define tuning fields (e.g. dash strength, projectile speed, scan radius)
-
Create a new ability class:
class UMyAbility : public UAbility -
Create a new data asset type:
class UMyAbilityData : public UAbilityData -
Implement behavior in
CanActivate/Activate(read tuning fromGetData()cast) -
Create a DataAsset instance in the editor:
- set
AbilityId,AbilityClass, cooldown/tuning values
- set
-
Add the DataAsset to
AbilityComponent.AbilityDataAssets -
Bind an input to
TryActivateAbility("MyAbilityId")
This repo includes minimal required assets:
- DataAssets:
DA_Dash,DA_Projectile,DA_PulseScan - Blueprint projectile (visual/debug child):
BP_AbilityProjectile
Source/.../Abilities/– ability framework and implementationsContent/Abilities/Data/– DataAssetsContent/Abilities/– minimal BP projectile + any small supporting assets
