Damage System

Generic, extendable and easy to use damage system for any game.

Damage System is part of Game Dev Tools Plugin.

Features

  • Created using UE4 SubSystem,
  • Damage Data can be extended and modified during damage,
  • Helper functions: ModifyDamage, MultiplyDamage, GetBackstabDot, GetDotToTarget, GetCreatedTime,
  • Using interface to deal damage,
  • Works with Health Component

Documentation

Example Map

Example map can be found here:
\Plugins\GDMegaPack\Content\Health\Maps\Showcase_GDHealthAndDamage.umap

Applying Damage

To Apply damage use ApplyDamage function from DamageSubsystem. You need to create DamagaData and pass it. Apply damage will call Damage Receiver Interface.

To apply damage it in C++:

Receiving Damage

To receive damage Actor need to implement GDDamageReceiver Interface.

This can be done in Blueprints in Class Settings:

Then you will have two functions. CanTakeDamage and TakeDamage:

Normally Apply Damage do nothing you need to plug in your health system. You can use Health Component from Plugin like here:

To receive damage in C++ you need to add interface to your Actor and override interface functions:

FAQ

Why not use UE4 Apply Damage?

Default UE4 Damage implementation have two problems:

  • You can’t extend damage structure in Blueprints. For example if you want to use your data you need to create your own functions to deal damage with your custom structure ignoring UE4 Damage implementation,
  • Damage informations can’t be changed during runtime as it’s const,

Damage System can be easyly extendable: create your own Damage Data, override ApplyDamage functions and use interface to receive damage.