Elitist Jerks
Register
Blogs
Chat
Forums
New Posts


Go Back   Elitist Jerks > Public Discussion > Public Discussion

Reply
 
LinkBack (1) Thread Tools
Old 02/26/08, 3:03 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 3:26 PM   #2 (permalink)
Great Tiger
 
tedv's Avatar
 
Undead 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.
 
User is offline.
Reply With Quote
Old 02/26/08, 3:30 PM   #3 (permalink)
"The Enforcer"
 
Nite_Moogle's Avatar
 
Tauren Warrior
 
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).

Gurgthock: the time taken to implement the 10 hugs achievement could have been used to make a new 5-man
 
User is offline.
Reply With Quote
Old 02/26/08, 3:37 PM   #4 (permalink)
King Hippo
 
Tauren Druid
 
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 3:48 PM   #5 (permalink)
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 4:00 PM   #6 (permalink)
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 4:07 PM   #7 (permalink)
"The Enforcer"
 
Nite_Moogle's Avatar
 
Tauren Warrior
 
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.

Gurgthock: the time taken to implement the 10 hugs achievement could have been used to make a new 5-man
 
User is offline.
Reply With Quote
Old 02/26/08, 4:12 PM   #8 (permalink)
King Hippo
 
Glaurong's Avatar
 
Orc 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
 
User is offline.
Reply With Quote
Old 02/26/08, 4:21 PM   #9 (permalink)
Don Flamenco
 
Zifna's Avatar
 
Tauren Shaman
 
Bloodscalp
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 4:26 PM   #10 (permalink)
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 4:48 PM   #11 (permalink)
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).
 
User is offline.
Reply With Quote
Old 02/26/08, 4:53 PM   #12 (permalink)
Great Tiger
 
tedv's Avatar
 
Undead 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.
 
User is offline.
Reply With Quote
Old 02/26/08, 5:44 PM   #13 (permalink)
Bald Bull
 
manly's Avatar
 
Undead Mage
 
Mal'Ganis
As any melee that has done Onyxia will tell you, you can attack her in 'melee range' during phase 2.

<superblotto> Last I heard the Arcane Believers were going to burn the Infidel normal people at the stake but refused to use fire. Things went down hill from there
<arioch> arcane blast the firewood
<Blackpatch> they tried
<Blackpatch> but went OOM

Manly <Jet Silk Tires> / Lich King
 
User is offline.
Reply With Quote
Old 02/26/08, 6:08 PM   #14 (permalink)
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 6:17 PM   #15 (permalink)
Don Flamenco
 
Tauren Druid
 
Thaurissan
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).
 
User is offline.
Reply With Quote
Old 02/26/08, 6:22 PM   #16 (permalink)
Piston Honda
 
Night Elf Rogue
 
Silver Hand
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.
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 6:35 PM   #17 (permalink)
WTB Terocone
 
Latito's Avatar
 
Orc Rogue
 
Ner'zhul
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 6:47 PM   #18 (permalink)
Don Flamenco
 
Tauren Druid
 
Thaurissan
Originally Posted by Latito View Post
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 6:59 PM   #19 (permalink)
WTB Terocone
 
Latito's Avatar
 
Orc Rogue
 
Ner'zhul
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.
 
User is offline.
Reply With Quote
Old 02/26/08, 7:11 PM   #20 (permalink)
Don Flamenco
 
Troll Warrior
 
Aggramar
Originally Posted by seminarca View Post
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."
 
User is offline.
Reply With Quote
Old 02/26/08, 7:18 PM   #21 (permalink)
aos
Banned
 
Character
Human Paladin
 
Non-US/EU Server
Originally Posted by seminarca View Post
Only with specials though, white damage won't connect if I recall correctly.

edit: 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).
They have probably made changes since then, but it would be strange if specials connected and white hits didn't now. My understanding is that now the only time one does and the other doesn't is when a creature jumps behind you but you are still in their hitbox. The game doesn't check strictly that your subsequent white hits are done facing them but it checks strictly on specials. So it's possible to connect with white hits while facing the wrong way but not with specials.

Last edited by aos : 02/26/08 at 9:28 PM.
 
User is offline.
Reply With Quote
Old 02/26/08, 7:20 PM   #22 (permalink)
WTB Terocone
 
Latito's Avatar
 
Orc Rogue
 
Ner'zhul
On a small tangent regarding white vs. yellow hit boxes, if you spin your character to be at roughly 90 degrees to the mob you are attacking, you will still be able to yellow-attack, but not white. This has proven very helpful for testing various procs as you can control exactly when you swing. Yellow and White attacks most certainly use different code to determine if you are able to attack.
 
User is offline.
Reply With Quote
Old 02/26/08, 7:28 PM   #23 (permalink)
Piston Honda
 
Tauren Warrior
 
The Venture Co
The game doesn't check strictly that your white hits are done facing them but it checks strictly on specials.
The game also doesn't check at all for LOS on white hits. It's pretty hilarious in the Horde AV towers; you can melee people on the flag from the outside.
 
User is offline.
Reply With Quote
Old 02/26/08, 7:33 PM   #24 (permalink)
aos
Banned
 
Character
Human Paladin
 
Non-US/EU Server
Originally Posted by Mode View Post
The game also doesn't check at all for LOS on white hits. It's pretty hilarious in the Horde AV towers; you can melee people on the flag from the outside.
And maybe why you can attack archers outside the wall of the Horde towers while you are safely inside.