•

# Hitbox

47 replies to this topic

### #1 aos

aos

Banned

• Banned
• 17 posts

Posted 26 February 2008 - 08:03 PM

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?

### #2 tedv

tedv

Observation: I am awesome

• Allied Members
• 1796 posts

Posted 26 February 2008 - 08:26 PM

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.

### #3 Nite_Moogle

Nite_Moogle

I prefer the term treasure hunting

• Allied Members
• 11288 posts

Posted 26 February 2008 - 08:30 PM

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).

Eh, my nostalgia goggles aren't as good as they used to be.

### #4 Whitemane

Whitemane

King Hippo

• Members
• 698 posts

Posted 26 February 2008 - 08:37 PM

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.

### #5 aos

aos

Banned

• Banned
• 17 posts

Posted 26 February 2008 - 08:48 PM

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.

### #6 Riallatar

Riallatar

Von Kaiser

• Members
• 56 posts

Posted 26 February 2008 - 09:00 PM

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.

### #7 Nite_Moogle

Nite_Moogle

I prefer the term treasure hunting

• Allied Members
• 11288 posts

Posted 26 February 2008 - 09:07 PM

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.

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.

Eh, my nostalgia goggles aren't as good as they used to be.

### #8 Glaurong

Glaurong

King Hippo

• Members
• 666 posts

Posted 26 February 2008 - 09:12 PM

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).
Log Parser for BM Hunters (Right click, save as) - Updated 10/11/2007

### #9 Zifna

Zifna

Don Flamenco

• Members
• 294 posts

Posted 26 February 2008 - 09:21 PM

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.

### #10 aos

aos

Banned

• Banned
• 17 posts

Posted 26 February 2008 - 09:26 PM

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?

### #11 Anedris

Anedris

King Hippo

• Members
• 749 posts

Posted 26 February 2008 - 09:48 PM

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).

### #12 tedv

tedv

Observation: I am awesome

• Allied Members
• 1796 posts

Posted 26 February 2008 - 09:53 PM

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.

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.

### #13 manly

manly

Soda Popinski

• Guild Members
• 3595 posts

Posted 26 February 2008 - 10:44 PM

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

### #14 Harwin

Harwin

Piston Honda

• Members
• 222 posts

Posted 26 February 2008 - 11:08 PM

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.

### #15 seminarca

seminarca

Don Flamenco

• Members
• 454 posts

Posted 26 February 2008 - 11:17 PM

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:

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).

### #16 Cos-

Cos-

Piston Honda

• Members
• 238 posts

Posted 26 February 2008 - 11:22 PM

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.

I'd agree with you, stuff like supremus trash and hyjal gargoyles have tiny hitboxes and need to be basically standing on the ground before you hit them not like that wench who scraped her ceiling while getting hit by instants.

### #17 Latito

Latito

Don Flamenco

• Members
• 459 posts

Posted 26 February 2008 - 11:35 PM

Having done Onyxia less than a month ago, I can say with absolute certainty that both yellow AND white melee attacks can land on Ony during p2. In fact, I was the only dps on her for all of p2.

I can say, rather anecdotally that the hitbox on her seemed to be spherical, not cylindrical. I would need to be almost directly under her to attack during p2, but could backup a good distance in p1 and p3 while still being able to dps.

### #18 seminarca

seminarca

Don Flamenco

• Members
• 454 posts

Posted 26 February 2008 - 11:47 PM

Having done Onyxia less than a month ago, I can say with absolute certainty that both yellow AND white melee attacks can land on Ony during p2. In fact, I was the only dps on her for all of p2.

Was this changed recently? I remember back in the day, in all the Onyxia raids I ever did it was emphasized for Rogues to stay on her in Phase 2 so they could use specials to bring her down quicker.

The last time I did Onyxia was around 6 months ago, and we had slow Phase 2 DPS. We had 2 Warriors, 1 Enhancement Shaman and one caster for DPS (could've been a Warlock or Mage). In Phase 2, it was pretty much just myself (in Cat Form) and the caster DPSing, Holy Priest and Resto Druid threw up DoTs too and the Shaman could Stormstrike once every 10 seconds.

### #19 Latito

Latito

Don Flamenco

• Members
• 459 posts

Posted 26 February 2008 - 11:59 PM

Might of been, I never did Ony pre-BC. In fact, that run 1 month ago was my first ever Onyxia kill. The other 3 people present were a Prot warrior (tanking the adds), a Frost mage (killing the adds) and a Holy priest healing people.

P2 went relatively quickly, given I'm in full T6-level gear.. basically just chased her around keeping SnD up.

### #20 Machinator

Machinator

Don Flamenco

• Members
• 498 posts

Posted 27 February 2008 - 12:11 AM

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.

This is something odd I have noticed elsewhere too. I can be standing still and white hits work but specials give an out of range. I dont know why, but I guess they use different ways of determining range. Though it seems more like it could be sloppy code rather than intended. Or an artifact of racial scaling, I am a troll.
"Information is ammunition."

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users