What is in-game unit? About Hammer Units

2025-10-30 Mapping tutorials kleskby 0 139
Author: KleskBY

If you've ever been experimenting with Valve Hammer Editor or played Counter-strike KreeDz you've probably paid attention that length, velocity and jump distance are measured in units. But what is the unit? 

Today most 3D software and game engines use the Metric system, but GoldSrc, Source and other Quake based engines are using Units for dimension measurements. Unit (Hammer unit) is the primary unit of measurement in all Quake Engines. But how do we understand how much that is and translate it into the real world?

Currently, two opinions are popular:

  • GoldSrc units are effectively inches.
  • Units are not exactly inches and you should not refer to them for real world scale.

Now let’s explain the origins of these beliefs. If we assume that 1 unit = 1 inch we will get that Gordon is 6 feet (1.83 meters) tall which is a normal human size. This statement is logically correct and makes sense. However, this is wrong. 

The opponents say, “units are not exactly inches and if we look at the player size we will see that Gordon Freeman is 32 inches wide which is unrealistic.” This is also not true. I think they are missing the key point, that Half-life’s player size is not actually a size of the player, but a size of the player collider that is used for math, collision and hit detection.  

Numerous problems will arise if the player collider is made to be the exact size of a human:

  • Players will have problems navigating levels by falling/walking into really tiny spaces and corners.
  • Players will be allowed to move the camera very close to the wall which will look unrealistic, especially when holding a weapon in hands. Even more, the player camera may glitch thru the wall if we rotate the camera after moving it too close to the wall.
  • Enemies or other players will have a hard time hitting the player.
  • The player model will clip through walls when playing an animation (for example running or jumping) because we no longer have the extra space around the player. So we not only need an actual player size but also a size of a step and size of hands holding a firearm. 
  • Other engines use similar proportions. For example, Unity3D uses capsule like character controller 0.35m in radius, 1.8m tall (28 inch wide, 71 inch tall)

A 72 inches tall human will have 18 inch shoulder width and 32 inches long arms. With arms being half extended (to hold the weapon) we will get approximately 32 inches width. Models need to fit within these bounding boxes for collision detection, animation blending (e.g., crouching), and overall visual consistency. If models are too large or small, they'll clip through walls, have incorrect collision behavior, or simply look wrong. 

So what is the unit? I define Unit as a unit of length measurement close to the inch and rounded for ease of calculation. Of course, this is true for most games, but the developer can change the proportions depending on what they are doing.

During my investigation into the engine's mechanics, I established a critical foundational principle: 1 unit equates to 0.025 meters. This conclusion was reached through the following observation: when exporting level geometry from Quake or Half-Life and subsequently importing it into a 3D editor application, the vertices consistently align with the grid, yet the overall mesh appears excessively large. Scaling the mesh by a factor of 0.0254 causes all vertices to deviate from the grid. However, applying a scale factor of 0.025 results in a visually accurate mesh where all vertices maintain their grid alignment, mirroring their appearance in the Level Editing application.

For those familiar with 3D applications like Blender, Unity, and Unreal Engine, a human height of 1.8 meters is commonly used. Converting 72 units with a 0.025 multiplier also results in 1.8 meters, aligning with this standard.

Taking all of the above into consideration, we can conclude that: 1 unit = 0.025 meters = 2.5 centimeters = 0.984 inch

This is at least true for Valve games but for Quake 1 proportions are different. 1 unit ~ 0.028125 meters

So, should I build maps referring to real work scales? 

If you use units as inches for mapping, in most cases you will get satisfying, realistic results. It is up to you to follow the real world scale or not, but my answer is NO. For the comfort of the player it may be better to adjust object size. You can use real world measurements as a reference, but you must adjust the size of the object to make it feel right in the game. 

Conversion Formulas:

  • Units = Meters * 40 (We use this when we want to export our model into Quake Engine world)
  • Feet = Units / 12
  • Meters = Units * 0.025 (This is a very useful conversion for importing models in Blender. Do not use 0.0254 because this will place your vertices of grid)

Standard dimensions (Half-life 1):

  • Standing Player size: 32x32x72 units
  • Crouching Player size: 32x32x36 units
  • Standing Player Bounding Box: (-16, -16, -36) to (16, 16, 36) (This represents a bounding box encompassing the player model)
  • Crouching Player Bounding Box: (-16, -16, -18) to (16, 16, 18) 
  • Player view height: 64 units
  • Maximum Step Up height: 18 units
  • Minimum hole height at which player can crawl underneath: 37 units
  • Minimum height of the opening a player can walk in: 73 units.
  • Jump height: 42 units
  • Crouch-jump height: 62 units
  • Maximum map size: 8192x8192x8192 units (4096 in each direction)
  • Big crate size: 64x64x64 units
  • Average crate: 48x48x48 units
  • Small crate: 32x32x32 units
  • Barrel size: 42x42x56 units
  • Door size: 48x6x96 units
  • Ventilation height: 48 units


Tags: mapping, units

Comments


captcha


There are no comments yet, be the first.
Owned by kleskby#1837
Telegram
Close

You have no new notifications.


You have no new messages.