# Hitbox

Simplified 2-dimensional representation of a simple and a more complex hitbox with hit zones

A hit box (also hit box ; Engl. For "matching box") describes a predefined virtual, usually not visible to the user area to a 3D model in a 3D engine (or game engine ), which for the calculation of Collisions and / or hit queries is used. Hitboxes are mainly used to simplify calculations, since 3D models, especially those of people, consist of a large number of polygons . The more complex the engine, the more similar the hitbox becomes to the corresponding 3D model.

## history

Even if hitboxes in modern engines are much more complex than a simple box, the word originally derived from exactly this meaning. In fact, in the early days of gaming history , every 3D object was described as a simple box. Even today, so-called bounding volumes , which are basically simple geometric shapes ( sphere , cylinder , cuboid / circle , rectangle ) are still used for quick pre-calculations or test runs in 2D or 3D design programs . However , this leads to problems in particular with first-person shooters : a simple geometric object naturally leads to a rather poor result when querying hits, since hits hit the bounding volume in addition to the actual 3D model of the opponent (i.e. the visually visible target) and thus can virtually injure the player / opponent. In racing simulations, however , almost rectangular or cuboid variants are less problematic; the vehicles themselves are usually also very simple in their basic shape.

In addition to being useful for calculating the physical delimitation of an object, hitboxes are also suitable for determining different hit zones. Again, this is primarily important in first-person shooters, since a difficult headshot usually leads to a greater drain of energy than a hit that is easier to apply to the torso . The more precisely the hitboxes (as mentioned, do not necessarily have to be cubic or cuboid) enclose the corresponding model, the more realistic the corresponding games can be designed - there are sufficient areas of application, such as limping in the event of a leg hit.

Even if a 3D model is circumscribed by several different boxes or other shapes, one speaks of a single hitbox per 3D model.

For example, Microsoft DirectX (the D3DX extension) offers the functions D3DXComputeBoundingBox, D3DXComputeBoundingSphere and D3DXBoxBoundProbe for such purposes.

The hitbox system is the most widespread system for determining hits, but a few games (e.g. Doom 3 ) use an absolutely exact system ( per-polygon hit detection) - these systems are much more resource-intensive and allow in Online games usually only have a much smaller number of players.

## Hitbox in two-dimensional game worlds

Hitboxes are also vital in most shoot 'em up games. There are two different approaches to this: the complete capture of the character through the hitbox or the marking of the character through a very small hitbox (often only a few pixels in size), usually in an important region such as the cockpit . The second version is mainly used in Danmaku shooters. Since the screen in this type of game is almost completely littered with enemy ammunition, the game would be unrealistically difficult.

## credentials

1. Mesh Functions Document at Microsoft MSDN , online resource
2. Entry on Hitbox in the Touhou Wiki (eng.)