Unit Attack Range

Talk about anything here.
Post Reply
CRC
Posts: 22
Joined: Thu Sep 21, 2006 3:31 am

Unit Attack Range

Post by CRC »

This might be FAQ, but I couldn't find post or article written about this. So just giving me a pointer to it might be enough.

I'm inspecting Unit parameters then find that dwarf and dwarf hero has same Maximum Range in Attacks of Monster tag. Dwarf hero must have longer range than normal dwarf so I varied other parameters to see what really determines actaul range. Then I find that Velocity affects actual range. When I set same value to both dwarf and dwarf hero, their range went to same.

But then, I tried same manner to other types of unit, dwarf mortar, bowman, and fetch. Dwarf mortar and bowman looks like almost same range with same velocity, but fetch had longer range. I varied other parameters in Monster and Projectile but couldn't find which affects actual range.

So, what determines actual range?
Deqlyn
Posts: 387
Joined: Thu Dec 13, 2007 6:27 pm

Re: Unit Attack Range

Post by Deqlyn »

Are you testing these distances on flat ground?
CRC
Posts: 22
Joined: Thu Sep 21, 2006 3:31 am

Re: Unit Attack Range

Post by CRC »

Yes, almost flat map (used starting point of level 4), but yea there can be negative revise even on flat map to non-magical projectile. I will test it later.

Thanks for head up.
Deqlyn
Posts: 387
Joined: Thu Dec 13, 2007 6:27 pm

Re: Unit Attack Range

Post by Deqlyn »

I believe you answered your own question.

Maximum Range determines within how many world units(wu) or minimum wu's is allowed for a unit to fire.

Velocity determines how fast it will get there. THere is a help page for this somewhere explaining all features I just dont have it on this PC. I'll try and post it later.


You are also probably looking at one piece of the puzzle. You need to look at Projectile Group as well depending on what the unit is firing.

Last thing is Fetch has an Area of Effect(AOE) Along with the dwarf that would increase the range by half the WUs it is set at.

*Awaits Pyro correction post*
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Re: Unit Attack Range

Post by Pyro »

Heh, I was correcting one of your other posts, Deq. Then I come to this one and see what you said last, and wondered... how did he know!?

He doesn't need to look up the projectile group tags. Those only tell the projectiles what to create (detonate to or promote to). Fetch's lightning will not make dwarf bottles go farther, you are thinking about TFL.

The range values seen in the monster's attacks tell the unit how far or how close to try to attack. If I am not mistaken if the velocity is too slow, the monster would try to get closer so that its attack can reach the target location. There are certain flags that alter this behavior so that the unit could ignore that calculation and just attack.

The more velocity an attack has, the farther it can reach (assuming it is allowed to target from such distances). Also consider that if you are on a hill, a unit can target farther if the location is downhill and vice-versa. Gravity is also a factor as well as inertia. So if you alter the inertia of say a dwarf bottle to be half of what it is then the bottle will have less range.
Zeph
Posts: 1019
Joined: Wed Apr 13, 2005 4:57 pm
Location: Montreal

Re: Unit Attack Range

Post by Zeph »

to complete pyro's answer. Some attacks, like dwarfs, are set to "fixed pitch" which means they always fire at the same angle. What this mean is that the projectile will have different velocity depending on the range of the attack. A normal dwarf might have a velocity of 0.250, but if you fire very close to him, the projectile will maybe reach 0.150 velocity. What happens is that the default velocity 0.250 is not enogh to reach the maximum range a dwarf can have while the dwarf hero has more velocity avalaible (bigger arm?) :)

While using fixed pitch, I find that there's is a limit on the speed which is around 0.350 I think.
CRC
Posts: 22
Joined: Thu Sep 21, 2006 3:31 am

Re: Unit Attack Range

Post by CRC »

Thanks pyro for the answer. Tried these four (range, velocity, inertia, gravity) factors and they are exactly what affect actual range.

I tried to find fomula to determine actual range with the knowledge of basic physics but I coundn't. So I changed my stratergy just to measure them for all units. Altering fetch's range was used as a measure, map was totally enflatted, target dummy was used as target which is slightly taller than normal units. Below is what I measured;

Code: Select all

unit name             max range  actual range
---------------------------------------------
bowman                 20.000    15.3 - 17.9
bowman (flaming)       20.000    15.3 - 17.9
bowman hero            20.000    20.0 - 20.0
bowman hero (flaming)  24.000    23.4 - 24.0
bre'Unor               16.000     9.9 - 11.6
dwarf                  10.000     6.3 -  8.3
dwarf hero             10.000    10.0 - 10.0
dwarf pathfinder       10.000    10.0 - 10.0
dwarf mortar           15.000    11.2 - 12.2
dwarf mortar hero      20.000    15.7 - 17.9
fetch                  10.000    10.0
ghol (bottle or puss)   8.000     6.9
mrkridia big           16.000    16.0
soulless               20.000    12.4 - 14.1
warlock                12.000    12.0
warlock (net)          14.000    14.0
warlock hero           12.000    12.0
Actual range is what I measured. Some units have random range of velocity, so it has range too.
Post Reply