Problem: A Round of Ground Pound for Everyone!


Reported By: David Tarnowski

October 5th, 2023

THE PROBLEM


Figure A: The problematic block of code

During recent playtests, a glaring issue with the ground pound ability was detected. While the ability was designed to devastate enemies within its damage range, we noticed that it was unfortunately a double-edged sword. It killed every character within its effective radius, including the very player initiating the ground pound. On digging into the root cause, I pinpointed the culprit: our OnTriggerEnter() function.

This function was designed to detect collisions and then perform checks based on the tags of the colliding objects (Figure A). We did this in the hopes of being able to use the functionality for both  enemies and players. Ideally, it would discern between enemies and the player, but due to the fact that it was called upon every collision, both if checks - one for the player and one for the enemies - were being passed. This, in effect, was leading to a catastrophic outcome where everyone, without exception, was getting eliminated.

THE SOLUTION


Image B. Shhhhhh. Go to sleep.

In response to this, I revamped our collision handling logic. To ensure a more discerning and specific response, I partitioned the OnTriggerEnter() checks, delegating them to two separate scripts: one for the enemy and another for the player. This segregation ensures that only the relevant tag check gets triggered based on the character involved in the collision.

With this new structure, the ground pound ability now works as originally intended. The player can execute this ability without fearing self-destruction, and enemies caught within its radius face the anticipated consequences. This modification not only addressed the gameplay issue but also enhanced the game’s overall experience, making the ability satisfying and impactful to use (Image B).

As we continue our journey of refining the gameplay mechanics, we remain committed to ensuring that every feature, big or small, performs at its best, offering players an engaging and seamless experience.

Get Psyche

Leave a comment

Log in with itch.io to leave a comment.