Difference between revisions of "Map unit"

From DoomWiki.org

[unchecked revision][checked revision]
(with room for further pedantic elaboration)
 
m (Limitations: grammar (sigh))
(11 intermediate revisions by 9 users not shown)
Line 1: Line 1:
The positions and sizes of objects in Doom [[level]]s are generally described by integer values between -32768 and +32767. The unit length is often called a '''map unit''' (or simly, '''unit'''). Some example dimensions in terms of Doom's map units are:
+
The positions and sizes of objects in Doom [[level]]s are generally described by integer values between -32768 and +32767. The unit length is often called a '''map unit''' (or simply, '''unit'''). Some example dimensions in terms of Doom's map units are:
* 2<sup>4</sup> = 16 units: small map details such as support beams and wall lamps
+
{| class="wikitable"
* 2<sup>5</sup> = 32 units: smallest gap the player can pass through
+
|-
* 2<sup>6</sup> = 64 units: regular [[crate]], small [[teleporter]] gate
+
! Structure
* 2<sup>7</sup> = 128 units: big door, width of regular corridor such as the main hallway in [[MAP01: Entryway (Doom II)]]
+
! Map unit
* 200-400 units: width of a small room
+
! colspan="2" | Real life unit
* 500-800 units: width of a medium-size room, such as the start room of [[E1M1: Hangar (Doom)]]
+
|-
* 768 units: width of the [[Icon of Sin]]
+
| Small map details such as support beams and wall lamps
* 800-1500 units: width of a large room such as the [[Spider Mastermind]] room in [[MAP06: The Crusher (Doom II)]]
+
| 16 units
* 4000 units: width of typical Doom level ([[Knee-Deep in the Dead]])
+
| 37 cm
 +
| 1.2 ft
 +
|-
 +
| Smallest gap the player can pass through
 +
| 32 units
 +
| 75 cm
 +
| 2.4 ft
 +
|-
 +
| Regular [[crate]]<br/>small [[teleporter]] gate
 +
| 64 units
 +
| 1.5 m
 +
| 4.9 ft
 +
|-
 +
| Big door<br/>Width of regular corridor such as the main hallway in [[MAP01: Entryway (Doom II)]]
 +
| 128 units
 +
| 3 × 4 m
 +
| 9.8 × 13.1 ft
 +
|-
 +
| Small room
 +
| 200 units - 400 units
 +
| 4.6 - 9.3 m
 +
| 15.3 - 30.7 ft
 +
|-
 +
| Medium-size room<br/>Start room of [[E1M1: Hangar (Doom)]]
 +
| 500 units - 800 units
 +
| 11.7 - 18.7 m
 +
| 38.4 - 61.5 ft
 +
|-
 +
| [[Final boss]]
 +
| 768 units × 384 units
 +
| 18 × 12 m
 +
| 59 × 39.3 ft
 +
|-
 +
| Large room such as the [[Spider Mastermind]] room in [[MAP06: The Crusher (Doom II)]]
 +
| 800 units - 1500 units
 +
| 18.7 - 35.1 m
 +
| 61.5 - 115.3 ft
 +
|-
 +
| Typical Doom level ([[Knee-Deep in the Dead]])
 +
| 4000 units
 +
| 93.7 m
 +
| 307.5 ft
 +
|}
  
It is difficult to translate the size of a Doom map unit into a real-world unit, since the dimensions of various objects in the game are inconsistent. Very roughly, one could attempt to translate 32 map units as 1 meter based on the height of the [[Doom guy]] (56 units). With this interpretation, a [[Cyberdemon]] would be 3.5 meters tall and a typical Doom level would have a size of approximately 120 m &times; 120 m.
+
It is difficult to translate the size of a Doom map unit into a real-world unit, since the dimensions of various objects in the game are inconsistent. Very roughly, one could attempt to translate 32 map units as 1 meter (3.28 feet) based on the height of the [[Doomguy]] (56 units). With this interpretation, a [[cyberdemon]] would be 3.5 meters (11.48 feet) tall and a typical Doom level would have a size of approximately 120 square meters (393.7 square feet).
  
However, height and width units don't quite agree. The 1-meter interpretation would imply that the Doom guy is one meter wide, or at least cannot pass through an opening narrower than one meter, which would be to exaggerate his muscularity. A more realistic interpretation (if there is any such thing) is perhaps that one "width unit" (w) corresponds to 3/4 of a "height unit" (h).
+
However, height and width units do not quite agree. The 1-meter interpretation would imply that the Doomguy is one meter wide, or at least cannot pass through an opening narrower than one meter, which would be to exaggerate his muscularity. The discrepancy is likely related to the fact that [[Aspect ratio|pixels in Doom's original video modes were rectangular]]: because pixels were taller than they were wide, and each map unit was proportional in size to a pixel of an in-game texture, flat, or sprite, height units were larger than width units. A more realistic interpretation (if there is any such thing) is perhaps that one "width unit" (w) corresponds to 5/6 of a "height unit" (h).
 +
 
 +
==Limitations==
 +
The total space that can be functionally covered by a Doom engine map is significantly less than the extent of the coordinate system implies. If any two points of valid play space in the level are separated by more than 32767 units, the game engine will be unable to appropriately measure distance between those points, resulting in numeric overflow. This can cause effects such as long-range melee attacks from monsters, impossible lines of sight for [[arch-vile]] attacks, and, near the wrap points, visual artifacts. In order to avoid this, a level must be contained within a 16384-unit radius as measured from its center point.
 +
 
 +
The [[Map size limit (blocks)|blockmap limit]] and [[blockmap overflow]] phenomenon also exist as other stringent limitations which affect how many 128-square-unit blocks can contain [[linedef]]s.
 +
 
 +
In terms of height, areas which are too tall can [[Numeric overflow crash in tall areas|trigger a crash]] due to numeric overflow during texture scaling when the height difference between the floor and ceiling is greater than approximately 2500 units and the player is close to a line.
  
 
==See also==
 
==See also==
 
* [[Angle]]
 
* [[Angle]]
  
[[Category:Gameplay]]
 
 
[[Category:Doom engine]]
 
[[Category:Doom engine]]

Revision as of 23:12, 10 October 2016

The positions and sizes of objects in Doom levels are generally described by integer values between -32768 and +32767. The unit length is often called a map unit (or simply, unit). Some example dimensions in terms of Doom's map units are:

Structure Map unit Real life unit
Small map details such as support beams and wall lamps 16 units 37 cm 1.2 ft
Smallest gap the player can pass through 32 units 75 cm 2.4 ft
Regular crate
small teleporter gate
64 units 1.5 m 4.9 ft
Big door
Width of regular corridor such as the main hallway in MAP01: Entryway (Doom II)
128 units 3 × 4 m 9.8 × 13.1 ft
Small room 200 units - 400 units 4.6 - 9.3 m 15.3 - 30.7 ft
Medium-size room
Start room of E1M1: Hangar (Doom)
500 units - 800 units 11.7 - 18.7 m 38.4 - 61.5 ft
Final boss 768 units × 384 units 18 × 12 m 59 × 39.3 ft
Large room such as the Spider Mastermind room in MAP06: The Crusher (Doom II) 800 units - 1500 units 18.7 - 35.1 m 61.5 - 115.3 ft
Typical Doom level (Knee-Deep in the Dead) 4000 units 93.7 m 307.5 ft

It is difficult to translate the size of a Doom map unit into a real-world unit, since the dimensions of various objects in the game are inconsistent. Very roughly, one could attempt to translate 32 map units as 1 meter (3.28 feet) based on the height of the Doomguy (56 units). With this interpretation, a cyberdemon would be 3.5 meters (11.48 feet) tall and a typical Doom level would have a size of approximately 120 square meters (393.7 square feet).

However, height and width units do not quite agree. The 1-meter interpretation would imply that the Doomguy is one meter wide, or at least cannot pass through an opening narrower than one meter, which would be to exaggerate his muscularity. The discrepancy is likely related to the fact that pixels in Doom's original video modes were rectangular: because pixels were taller than they were wide, and each map unit was proportional in size to a pixel of an in-game texture, flat, or sprite, height units were larger than width units. A more realistic interpretation (if there is any such thing) is perhaps that one "width unit" (w) corresponds to 5/6 of a "height unit" (h).

Limitations

The total space that can be functionally covered by a Doom engine map is significantly less than the extent of the coordinate system implies. If any two points of valid play space in the level are separated by more than 32767 units, the game engine will be unable to appropriately measure distance between those points, resulting in numeric overflow. This can cause effects such as long-range melee attacks from monsters, impossible lines of sight for arch-vile attacks, and, near the wrap points, visual artifacts. In order to avoid this, a level must be contained within a 16384-unit radius as measured from its center point.

The blockmap limit and blockmap overflow phenomenon also exist as other stringent limitations which affect how many 128-square-unit blocks can contain linedefs.

In terms of height, areas which are too tall can trigger a crash due to numeric overflow during texture scaling when the height difference between the floor and ceiling is greater than approximately 2500 units and the player is close to a line.

See also