• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

DPS vs Range

Status
Not open for further replies.
Level 3
Joined
Jun 17, 2007
Messages
62
Hi,

everyone should know how to calculate effective damage per second.

Damage / Attackspeed

But does anyone knows how to add range to that calculation ?
I mean a unit with more range deals more damage, doesnt it ?

I would like to get an idea of how range modifies dps.

Maybe one of you already has a formula for this.

Or maybe set a custom range to 1 and if a unit has double range it will double dps and half range means half damage.... thats a little bit too easy... or ?

I hope you can help me.
 
Level 4
Joined
Feb 23, 2006
Messages
63
answer

I think it depends on 2 things.
1- range of unit
2- speed and distance of attacking unit

formula should be > distance/speed of attacking unit = time for your "extra" attack

- by "distance" i mean distance between your unit and attacking unit
- "time for extra attack" means time when attacking unit is coming

This should work in case that attacking unit is melee unit, otherwise (if attacking unit is ranged unit) just subtract range of attacking unit from distance
 
Level 4
Joined
Nov 26, 2006
Messages
61
Ok, what it depends on is how many seconds it takes for the attacked unit to escape your range. Let's set everything to one for an example!

If your attack range is 700 and your tower (I'm assuming you want to know this for a TD), is "floating" above the path (not possible but I'm simplifying it), a unit with a speed of 1400 (1400 units per second) will be able to leave the tower's range in one second, meaning the tower gets to attack the unit for one second. Remember the attacking range is the radius and the target's "escape range" is the diameter. If the tower attacks once per second and deals one damage per second, it will be able to deal only one damage to one unit.

Now, a unit with a movespeed of 1400 is not likely at all unless you want your game to crash. Most units have a movement speed of 300. If your tower's range is a little over 600 and it's NOT floating, and it's on a flat edge that's not near any turns in the path or corners, then its range of attack (as far as the path is concerned) is 1200. If the tower attacks twice per second with a damage of 50 (100 dps), it will deal 400 damage to one unit.

Don't forget -- range actually doesn't change the damage per second, only the total damage it can deal to one unit. The total damage is the DPS multiplied by the number of seconds, rounded down to a multiple of the attack cooldown (because if it attacks once every 1.3 seconds, and you have 3 seconds to attack, it's really the same as having 2.6 seconds since you can't get the next attack at 3.9 seconds)

Range is a major factor in determining total damage dealing capability, but only in theory. In my example, there is only one unit being attacked. In a real TD, some towers have splash damage; others have slowing attacks. Also large waves of creeps will come so the tower cannot attack every creep that comes into its range unless it has a multiple-strike power like in Green TD.

The terrain also changes the effective range of a unit or tower. A tower has more effective range if it's placed on a roundabout or a corner, for example, than if it is placed on a flat side or next to the unit spawn point (which usually makes the units invulnerable while standing there).
 
Level 3
Joined
Jun 17, 2007
Messages
62
My real problem is the balancing of my map.

I want towers to be really worth what they cost.

I just made a random value of 1 dps per gold.
Splash costs about 1/5 of the total dps... and so on

Now what should I use for range ?

600 range = 1 x value
1200 range = 2 x value

Creeps move with 300 movement

Would you agree with such a system ?

300 range would be 0.5 x value and so on.....

I mean we all know that this is just theorie and it wont be perfect. But I just want to start with a really good rough system and then tweak it where it needs tweaking.
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
In TDs damage output is not linear with range (except if you only have one enemy in range at a time). If you have a line 3000 units long, and moves with 300 movement, then a tower of 600 range will attack for a length of 4200 (time of 14 seconds), while one of 300 range will attack for a length of 3600 (time of 12 seconds).
 
Status
Not open for further replies.
Top