Turret Design

For this post, I want to talk about the main feature that I will be working on for the portfolio project, turrets. Obviously for a tower defense game, the turrets play a major role in the game as they are the main line of defense against the incoming waves of enemies. Typically the turret starts out as very cheap to build and can be upgraded over the course of the game to deal more damage or have unique abilities such as area effect damage or slows. What my team is most focused on about the turret design is its targeting decision: which enemy should it focus on. Normally the turrets are coded to focus on the closest target within the turret’s range and will only change target by either the current targeting dying or leaving the turret’s range and then the turret will prioritize the next closest enemy. However, a teammate had a suggestion that instead of that particular design for the turret, we’ll track the lifetime and movement speed of the enemy unit and the tower will prioritize enemies with the highest values. The discussion devolved into whether it was worth it to implement such an idea, in which case my answer was no. My reasoning for this is that while the enemy unit that is attacking all have their own individual health bars and movement speed and other unique characteristics, they all collectively constitute an attacking wave and that wave is what the player is defending against. With either algorithm whether it be prioritizing the closest target or the one that has the higher health pool and movement speed, if the turrets in both scenarios have 100% uptime in shooting the enemy, suggests to me that a change is not needed and that the game is working as intended which is to have the player strategize a defense. While this discussion was rigorous, I am sure more discussions will be had on this topic in the coming weeks.

Leave a comment

Your email address will not be published. Required fields are marked *