Fun with DoTs


Author: Tyler Clardy

Date Posted: 5/10/2024

The last week of development I was heavily focused on creating new and interesting content. To start with I did spend some time bug-fixing previous features and fine-tuning some abilities, but my attention quickly turned towards implementing new traps, SFX, and VFX. I created, first, a landmine trap with a large area-of-effect damage and explosion VFX/SFX. Next, I moved onto what I was really excited about, creating a damage over time system and implementing it on two new traps!

First I created a Fire Trap, with a low duration, but high damage, flame effect. Then I created a Poison Trap, with a high duration, but low damage, poison effect. I added VFX to the enemies for when they have either DoT effect active, and I added nice VFX and SFX to the traps themselves. Feeling pleased with myself, I set about testing them out.. And discovered this:

Dancing Death State?!

Long story short, the damage over time effects had a serious bug! They broadcast a TookDamage cue every time they applied damage to an enemy. Once the enemy had died, they continued to tick and broadcast that cue. This would interrupt the TookDamage logic, restarting it over and over and never letting the death state logic fully play out. So they did a funny little dance, and spawned way too many pickups.

The solution to this was to learn how to assign Gameplay Tags uniquely to specific Gameplay Effects, and then to clear all Gameplay Effects with a specific tag - in this case, DamageOverTimeEffect - the moment an enemy was detected to have 0 health. This would delete the fire or poison DoT effect from the enemy and allow their death logic to play out successfully. 

This bug was a bit of a fun one to me, in that it took me completely by surprise and I found the unintended behavior to be unintentionally hilarious. Thankfully, it was not a hard fix. Just took a bit of research and some common sense to work out. 

Leave a comment

Log in with itch.io to leave a comment.