Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

What exactly is a hit box? Is there any way that knowing about hit boxes could help in a game?

share|improve this question
add comment

3 Answers 3

up vote 27 down vote accepted

Definition

A hitbox is an invisible box-like area that when penetrated, counts as a "hit". It's different than the model (the visible character and his colors that you see). The hitbox is meant to compensate for lag and movement. When a character is moving, his hitbox is usually farther from the model. When a character is still, his hitbox is located directly on top of his model.

Contrary to the name, a hitbox is actually composed of several boxes that represent the character's different areas (head, arm, torso).

Hitboxes, and You

You should definitely know how the hitbox affects you. It's the source of nearly all bizarre "WTF, how did I die?", and impossible shots that you see other players making. Understanding the hitbox is key to understanding how you die (and possibly getting better at your game).

Demonstration

A picture is worth a thousand words, so here's an excellent video from Team Fortress 2:

http://www.wegame.com/watch/TF2_Hitboxes/

Watch how the hitbox moves according to the model, where it moves and when, and lastly, understand where you need to shoot to penetrate that hitbox (and score).

Illustration

Below is a picture of hitboxes in Counter Strike. As these models are sitting still, the hitboxes are right on top of them.

share|improve this answer
12  
Counter Strike? Looks like Day Of Defeat. –  Denilson Sá Mar 11 '11 at 14:57
add comment

The main reason they use a hitbox for collision detection is that computing a hit based on geometry is increasingly expensive as the geometry gets more complicated. Typically there are actually multiple bounding boxes that are used. Partly, this is because a hit test against a rectangular box uses simple math and is very fast. If it misses the outermost box, they can shortcut the process and simply stop checking any further. A hit on the outermost box prompts a check for a closer box. However, they also don't want to recurse too far, or else it becomes too expensive (in time spent). At some point they must say, "that's close enough - it's a hit!"

One technique sometimes used for this is called an "octree", where 3D space is defined in terms of a recursive hierarchy of cubes. If two objects are in completely different branches of the octree, there is no possibility of them colliding so the detection can halt there. As they get closer to one another, the hit test becomes increasingly refined until the system knows that they have intersected or collided.

share|improve this answer
1  
Excellent technical explanation. –  Neil Aitken Jul 9 '10 at 22:25
add comment

A hit box is a region inside of which a character is placed.

It is an optimization used to speed up collision detection.

In a 3d shooter, for example, if you know what shape and size the hit boxes are, you could potentially aim for them, rather than the actual enemies. This could allow you to compensate for lag properly, or to get a head-shot when no part of the head is visible.

Here is an example:

Hitbox

share|improve this answer
    
Note that this is generally seen as cheating, especially in CS:S. –  user56 Jul 9 '10 at 21:32
2  
Really? I'm not a CS:S player, but I have a hard time imagining anyone considering knowing game mechanics to "cheating". I don't think "bunny-hopping" is thought of that way. –  Jeffrey Jul 10 '10 at 3:59
    
I'm an Ex-CAL:M, and it was never considered cheating there. –  John Gietzen Jul 10 '10 at 16:28
1  
where are the free hand cir... ahem hitboxes? –  Mechko Jul 12 '10 at 3:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.