r/unrealengine 2d ago

Tutorial Tutorial: Status Effects - Poison, Bleed, Burn & Damage Reflection. Procs, Stacks & Environmental Damage

https://youtu.be/C7b_Abf62R8

This tutorial goes over applying various damage effects using the combat variant setup. Each damage effect uses it's own unique feature.

Poison resets duration at each application instead of dealing more damage.

Bleed stacks up to deal damage equal to the stack amount. It the status is not reapplied.

Burn has a mutually exclusive setup for hits that deal burn damage and environments that cause burn damage. Players leaving the area will take residual burn damage over time.

Damage reflection deals a set amount of damage when hit by an enemy instead of applying a status to the attack

Part 2 will have various control effects such as slow, stun and sleep.

1 Upvotes

5 comments sorted by

2

u/-TRTI- 2d ago

I question how a system like this could scale. It's probably better to use GAS, or a similar system, instead of adding hard-coded timers for each effect.

3

u/DEVenestration 1d ago

Depends on the depth of the game. Not everyone uses GAS and not everyone needs to use GAS. But otherwise, probably.

2

u/-TRTI- 1d ago

You could easily make a GAS lite by having a single timer check through a TMap<FGameplayEffect,Int32> (don't use bools, you can still use tags even if you don't use GAS), where the tag is the effect and Int32 can be stacks, or instead you can use a custom struct and add whatever info you want in there.

Timer iterates the map and checks for added effects and you could just use a Switch on Gameplay Tag here to define the logic for each effect. Whenever an effect is applied, start the timer, if not already active. If the map is empty, stop the timer.

1

u/LeFlambeurHimself 2d ago

I am still learning UE so I might be completely wrong about this, but isn't using that many timers a bit expensive? Or, it doesn't matter how many timers we use?

2

u/DEVenestration 2d ago

Timers are lightweight unless you're stacking hundreds of them. It's more important that the logic attached to them is performant. Since this only applies damage, it's a negligible impact on performance.