• FEATURED
• FEATURED
• FEATURED
• FEATURED
• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Formula for damage calibration RTS tower defence game

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1GiroKa  Members

Posted 30 January 2013 - 12:23 PM

Trying to establish a formula to figure out how many enemies should I load per level?

Variables:
Total Game time (sec)
Tower DPS
Tower Range
Enemy HP

Time Tower deployed (sec) = total Game time - Avrg Deployment time for all Tower.

Percent of Map in range = Total range area X 100 / total Level surface.

Actual Total Tower DPS = Total Tower DPS X Percent of Map in range.

Total HP for all enemy = Time Tower Deployed (sec) X Actual total Tower DPS

This does not take into account overkills so an arbitrary multiplier value should be added … .

Am I overthinking this?

### #2BLM768  Members

Posted 30 January 2013 - 09:02 PM

It looks like you've mostly got it figured out. However, there are some things you might want to tweak just a bit:

• You might want to calculate actual tower DPS for each tower individually, then just add all the values up to get the total DPS.
• This will help to account for issues such as overlap between towers' ranges.
• It will also remove the need to calculate the total map area that's within range of your defenses.
• Using fractional numbers is easier mathematically than using percentages because you can avoid having to constantly multiply and divide by 100. For example, instead of 50%, use 0.5.
• Since no defense setup is perfectly efficient, having some extra padding between the total enemy HP and the maximum theoretical damage is important; much of the time, enemies will be out of range. Multiplying each tower's DPS by the fraction of the field's area that's within its range (which is basically what you were doing for the DPS calculation, but see the above point) fixes most of this issue quite nicely, but random variation in the enemies' formations can still cut the towers' efficiency below the theoretical maximum, leading to a potentially overpowered wave.
• Adding some types of random  and/or periodic variation to the enemies' power level could create an ebb and flow of tension that will make the game more engaging to the player.

Overall, it looks like you're off to a good start. Once you've implemented the algorithm, you'll probably see things you'd like to tweak; in fact, most of the tuning for this type of algorithm will involve playing with different formulas and values. It's hard to predict how humans' skill level will affect the game, but enough tweaking can give a system that generally works pretty well.

### #3GiroKa  Members

Posted 31 January 2013 - 07:05 AM

Thank for you for your answer I have started implementing the algorithm in a quick and dirty simulation program and I’ll be tweaking it along because like you said user behavior is tough to predict. The game level engine is built with triggers based on user behavior to keep the future gamers on their toes, so it makes each game level a slightly different experience for each player depending on their approach. Which make the algorithm a little more tricking. But it’s looking good so far. Thanks again.

Edited by GiroKa, 31 January 2013 - 07:09 AM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.