Elitist Jerks
Register
Blogs
Forums


Go Back   Elitist Jerks » Public Discussion » Public Discussion

Reply
 
LinkBack Thread Tools
Old 02/26/08, 3:03 PM   #1
aos
Banned
 
Character
Human Paladin
 
Non-US/EU Server
Hitbox

I was working out an explanation of how hitboxes work below, after reading about all the ways you can take advantage of them. But this brought up a couple questions I was hoping someone knew.

http://flux.io/2008/02/18/hitbox/

Are hitboxes cylindrical or spherical? This is a pain to test and seems inconsistent.

Are hitboxes always as high as they are wide? The best I can tell is that they are, but the centers are sometimes shifted.

Do all aoe abilities calculate center to center or is it just some oddball ones like Demoralizing Shout?

Last edited by aos : 02/26/08 at 3:54 PM.

Offline
Reply With Quote
Old 02/26/08, 3:26 PM   #2
tedv
Observation: I am awesome
 
tedv's Avatar
 
Goblin Priest
 
Mal'Ganis
Originally Posted by aos View Post
I was working out an explanation of how hitboxes work after reading about all the ways you can take advantage of them. But this brought up a couple questions I was hoping someone knew.

Hitbox | Flux

Are hitboxes cylindrical or spherical? This is a pain to test and seems inconsistent.

Are hitboxes always as high as they are wide? The best I can tell is that they are, but the centers are sometimes shifted.

Do all aoe abilities calculate center to center or is it just some oddball ones like Demoralizing Shout?
I'm not a blizzard programmer, but I have done extensive programming on other 3d games (more specifically, First Person Shooter Artificial Intelligence), so I can tell you what standard practices are.

The summary is that actual bounding boxes are almost never used except for collision detection, and these are most likely axis-aligned rectangular structures, not spheres or cylinders. This is probably what they use to stop you from walking through walls and gates. Anything more complicated than this requires a ton of processing when computing collision against arbitrary surfaces, except spheres which don't really bound humanoid shapes very well.

If you only need to test distances, however, bounding boxes are generally ignored in favor of a standard distance check. This will result in the appearance of a spherical bound, because the set of points that will be close enough to the center will lie in a sphere. If you want to assume targets are larger than a singular point, you will generally approximate them as a sphere. For example, if the target has a radius of 1 yard and the ability has a radius of 20 yards, the ability hits the target if the target is closer than 21 yards to the source of the ability.

United States Offline
Reply With Quote
Old 02/26/08, 3:30 PM   #3
Nite_Moogle
I prefer the term treasure hunting
 
Nite_Moogle's Avatar
 
Orc Death Knight
 
Mal'Ganis
Originally Posted by aos View Post
Do all aoe abilities calculate center to center or is it just some oddball ones like Demoralizing Shout?
Bounding boxes for hit detection purposes are typically spheres as the only data you require is a radius and can do quick & dirty calculations with that information. Most AE abilities are edge to edge, but there are some that are center to edge (sweeping strikes has a shorter range than melee range).

Originally Posted by CheshireCat
Eh, my nostalgia goggles aren't as good as they used to be.

United States Offline
Reply With Quote
Old 02/26/08, 3:37 PM   #4
Whitemane
King Hippo
 
Orc Hunter
 
Tarren Mill (EU)
Originally Posted by Nite_Moogle View Post
Bounding boxes for hit detection purposes are typically spheres as the only data you require is a radius and can do quick & dirty calculations with that information. Most AE abilities are edge to edge, but there are some that are center to edge (sweeping strikes has a shorter range than melee range).
Not to mention they're a good deal faster, if I remember correctly.

Offline
Reply With Quote
Old 02/26/08, 3:48 PM   #5
aos
Banned
 
Character
Human Paladin
 
Non-US/EU Server
tedv, The term hitbox could be a misnomer with WoW. I think your right there is likely a bounding box for collision detection and a range check which feels like a 'box' because it defines edge range. I am not sure exactly what you should be calling the range check box. But since hitbox is in widespread use at the moment in the strategy guides I have been using that.

I wonder if the range test was originally a circle (X-Y plane only) for even greater simplicity before they decided to add flying mounts to the game. Could you hit someone at any vertical distance, say from a steep cliff, before flying mounts? If not, then it would seem likely it's been a sphere all along.

What other AE abilities are not melee range, but center to center? These seem like the most likely to take advantage of in boss fights when fighting a large hitbox creature or if you are a Tauren or Dranei.

Offline
Reply With Quote
Old 02/26/08, 4:00 PM   #6
Riallatar
Von Kaiser
 
Night Elf Druid
 
Arthas
Not sure how accurate it is, but I recall back when the teleport hacking was rampant, seeing screenshots of players floating in the air being hit by mobs below them, so I'm guessing that at some point it was a flat 2-dimensional check.

Offline
Reply With Quote
Old 02/26/08, 4:07 PM   #7
Nite_Moogle
I prefer the term treasure hunting
 
Nite_Moogle's Avatar
 
Orc Death Knight
 
Mal'Ganis
Originally Posted by aos View Post
Could you hit someone at any vertical distance, say from a steep cliff, before flying mounts? If not, then it would seem likely it's been a sphere all along.
No. You could always jump over someone autoattacking you without being hit so long as you were sufficiently out of range (like off an upper level of a tower). After the Sleeper's Tomb bridge shenanigans back in EQ nobody has been silly enough to design a MMO with no z-axis considerations. I'd guess the z-axis check first involves a purely vertical comparison (i.e. is it within 5 yards vertically) before a diagonal zxy check would be made. There are undoubtedly some shortcuts involved in this as evidenced by the fix to jumping while AEing causing a temporary range extension, and being able to melee characters who were never actually in range based on predictive client movement.

Originally Posted by Riallatar View Post
Not sure how accurate it is, but I recall back when the teleport hacking was rampant, seeing screenshots of players floating in the air being hit by mobs below them, so I'm guessing that at some point it was a flat 2-dimensional check.
If anything this would suggest there is a seperate Z value for hitbox size, but the XY plane is almost certainly a circle.

Last edited by Nite_Moogle : 02/26/08 at 4:13 PM.

Originally Posted by CheshireCat
Eh, my nostalgia goggles aren't as good as they used to be.

United States Offline
Reply With Quote
Old 02/26/08, 4:12 PM   #8
Glaurong
King Hippo
 
Glaurong's Avatar
 
Goblin Hunter
 
Hyjal
Don't you get a 5 yard extension on your melee range while moving? Same with point blank AE effects?

I always figured all of this stuff was simple range checks. Not like a 3 dimensional range check is computationally expensive (addition, subtraction and multiplication).

Edit for clarity:

range^2 = (x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2

The above implementation saves you the square root computation which is expensive (multiplication isn't so bad).

Last edited by Glaurong : 02/26/08 at 4:23 PM.

Log Parser for BM Hunters (Right click, save as) - Updated 10/11/2007

Offline
Reply With Quote
Old 02/26/08, 4:21 PM   #9
Zifna
Don Flamenco
 
Zifna's Avatar
 
Tauren Shaman
 
Nathrezim
Originally Posted by aos View Post

I wonder if the range test was originally a circle (X-Y plane only) for even greater simplicity before they decided to add flying mounts to the game. Could you hit someone at any vertical distance, say from a steep cliff, before flying mounts? If not, then it would seem likely it's been a sphere all along.
No--there has always been underwater combat in WoW which follows precisely the same rules as midair combat, albeit with slower motion.

Offline
Reply With Quote
Old 02/26/08, 4:26 PM   #10
aos
Banned
 
Character
Human Paladin
 
Non-US/EU Server
Originally Posted by Glaurong View Post
Don't you get a 5 yard extension on your melee range while moving? Same with point blank AE effects?
From what I can tell melee doesn't get any range bonus while moving same with AE. Does anyone have something that shows differently?

Last edited by aos : 02/26/08 at 4:41 PM.

Offline
Reply With Quote
Old 02/26/08, 4:48 PM   #11
Anedris
King Hippo
 
Troll Priest
 
Steamwheedle Cartel
Mobs are certainly capable of bending the z-axis restrictions on some occasions. I've been attacked by aggroed mobs through the floor of a structure (but usually only a few times - they swing at me when I'm directly above them, but then they path out of x/y-axis reach as they make their way towards a ramp to get up to me). There is also the spectacle of the tauren attacking a frost wyrm in Hyjal (every now and then their "run in panic" script that they do when get attacked by an air mob fails and they happily melee away at the bone dragon 20 yards above their heads).

I do not think I have seen this behaviour when using a flying mount however, which would point to perhaps a range limitation (they were "in melee range" of my feet despite the intervening floor). Regards taurens versus wyrms this may be a bug (since they're supposed to run around panicked when the wyrm is attacking near them) or mob vs. mob attacks may be treated differently, or instance mobs may react differently (since they never leash - world mobs will leash as soon as you get out of their reach, most of the time).

Offline
Reply With Quote
Old 02/26/08, 4:53 PM   #12
tedv
Observation: I am awesome
 
tedv's Avatar
 
Goblin Priest
 
Mal'Ganis
Originally Posted by Anedris View Post
Mobs are certainly capable of bending the z-axis restrictions on some occasions. I've been attacked by aggroed mobs through the floor of a structure (but usually only a few times - they swing at me when I'm directly above them, but then they path out of x/y-axis reach as they make their way towards a ramp to get up to me). There is also the spectacle of the tauren attacking a frost wyrm in Hyjal (every now and then their "run in panic" script that they do when get attacked by an air mob fails and they happily melee away at the bone dragon 20 yards above their heads).
That's not a Z axis problem. That's the monster ignoring line-of-sight from obstacles and walls, which doesn't have anything to do with distance checks.

Originally Posted by Anedris View Post
I do not think I have seen this behaviour when using a flying mount however, which would point to perhaps a range limitation (they were "in melee range" of my feet despite the intervening floor). Regards taurens versus wyrms this may be a bug (since they're supposed to run around panicked when the wyrm is attacking near them) or mob vs. mob attacks may be treated differently, or instance mobs may react differently (since they never leash - world mobs will leash as soon as you get out of their reach, most of the time).
I suspect rather that monster AI works differently when you are flying. I've been 10 yards away from a melee-only monster while flying and had it ignore me, even though it could walk close enough to melee. Of course try that with a caster monster and you'll definitely aggro it.

United States Offline
Reply With Quote
Old 02/26/08, 5:44 PM   #13
manly
Soda Popinski
 
manly's Avatar
 
Troll Mage
 
Mal'Ganis
As any melee that has done Onyxia will tell you, you can attack her in 'melee range' during phase 2.

<Eej> YOU"RE GONNA PULL
<Eej> IF YOU SQUEEZE OFF ANOTHER ARCANE BLAST
<Spectear> You've obviously never played with Manly.
<Spectear> That's hardly a reason to stop DPS.
Very Manly Staff

Canada Offline
Reply With Quote
Old 02/26/08, 6:08 PM   #14
Harwin
Piston Honda
 
Night Elf Hunter
 
Mannoroth
Originally Posted by manly View Post
As any melee that has done Onyxia will tell you, you can attack her in 'melee range' during phase 2.
But that could be true also because her "hitbox" was so large that it could brush the ground. I know it was ridiculously big because I had to press way up against the wall to be far enough away to shoot her.

Offline
Reply With Quote
Old 02/26/08, 6:17 PM   #15
seminarca
Don Flamenco
 
Retired
Tauren Druid
 
No WoW Account
Originally Posted by manly View Post
As any melee that has done Onyxia will tell you, you can attack her in 'melee range' during phase 2.
Only with specials though, white damage won't connect if I recall correctly.

edit:
Originally Posted by Harwin View Post
But that could be true also because her "hitbox" was so large that it could brush the ground. I know it was ridiculously big because I had to press way up against the wall to be far enough away to shoot her.
She did have a huge hitbox, but I don't think that's it. While she was still grounded, you could easily hit her with white damage and specials from a fairly long distance, in the air white damage wouldn't connect but specials would still work. And I'm pretty sure she flew high enough that even the huge hitbox would be vertically out of range (if assumed to be spherical).

Offline
Reply With Quote
Reply

Go Back   Elitist Jerks » Public Discussion » Public Discussion

Thread Tools