home *** CD-ROM | disk | FTP | other *** search
/ Toolkit for DOOM / DOOMTOOL.ISO / editors / dme301.zip / CONCEPTS.DOC < prev    next >
Text File  |  1994-08-01  |  24KB  |  494 lines

  1.                               Important concepts
  2.                               ------------------
  3.  
  4. The first thing any map maker needs to know is the terminalogy used to 
  5. describe everything.  So, here goes:
  6.  
  7. Map:
  8.  
  9.    A map is all the information that describes a single episode/mission. 
  10. Many people like to use the word 'level' instead, however I think that 
  11. 'map' is a better word to use.  I tend to use 'level' to mean the 
  12. difficulty level the player selects when playing doom. 
  13.  
  14. Vertexes:
  15.  
  16.    A vertex is a point in 2D space.  Therefore, a vertex is really an 
  17. ordered pair of map coordinates.  Vertexes appear as dots in DMapEdit 
  18. (if they are shown).
  19.  
  20. Note: Of all the choices of words to use (vertex, point, node, etc) id
  21. software decided to use vertex, and I just decided to follow along with
  22. their terminalogy.  They also call the plural of vertex 'vertexes', and
  23. not 'vertices'.  So, I also used this.
  24.  
  25. Lines:
  26.  
  27.    Lines are straight line segments from one vertex to another.  Lines 
  28. themselves don't have any ordered pair information, and so since 
  29. vertexes do, all lines must run between 2 vertexes.  Lines are used for 
  30. walls in Doom, but they can also be used for other things, as explained 
  31. later in this file.
  32.  
  33. Linedefs:
  34.  
  35.    A linedef is short for 'line definition', and is the information that 
  36. describes a line.  Basically, lines and linedefs are the same thing.
  37.  
  38. Sidedefs:
  39.  
  40.    All lines have 2 sides to them, a left and a right side.  To 
  41. understand this, keep in mind that even though DMapEdit shows a line as 
  42. 2 dimentional, it is really a vertical plane (no z-axis tilt).  (This 
  43. plane doesn't have any thinkness to it, by the way.)  When you are 
  44. playing Doom, you can see these planes as walls.  Of course, you only 
  45. see one side of this plane at a time.  The other side can't be seen 
  46. because the first side blocks your vision of it.  These are the 2 sides 
  47. of the line I am talking about.
  48.  
  49. Ok, so which side is the left and which is the right?  Well, remember that
  50. lines start at vertex A and end at vertex B.  If you think of yourself as
  51. standing on vertex A and look straight at vertex B, then the 2 sides 
  52. face out to your left and to your right.  The left one is the left 
  53. side, and the right one is the right side.
  54.  
  55. Now, a sidedef (side definition) describes a side of a line.  A line 
  56. may, however, only have 1 sidedef.  If so, then this line is called 
  57. single-sided.  It actually does have 2 sides, of course, but the second 
  58. side isn't defined (no sidedef).  So, here we see a distinction between 
  59. a side and a sidedef.  All lines have 2 sides, but either 0, 1, or 2 
  60. sidedefs.  A line with no sidedefs is possible, and will usually occur 
  61. during map making, however it should never appear in a finished map.  
  62. Doing so will confuse Doom and cause strange things to happen.
  63.  
  64. Sectors:
  65.  
  66.    A sector is a closed polygon area of the map, formed by the lines.  A
  67. sector definition describes the characteristics of this area, including
  68. the floor and ceiling altitudes, floor and ceiling textures (see below),
  69. lighting, etc.  Any time you want any one of these characteristics to 
  70. change, you need to create a new sector for it (to hold the new def)
  71.  
  72. Interestingly enough, the area of a sector is completely determined by 
  73. lines and sidedefs.  But, we'll get into that a little later..
  74.  
  75. Closed polygon:
  76.  
  77.    A closed polygon is a shape formed with 3 or more lines connected to 
  78. that each vertex has at least 2 lines jointed there.  Also, starting at 
  79. any one vertex, you can follow a path of lines, following each one only 
  80. once, and arrive back at that vertex again.  That's the technical 
  81. description; basically it is an object, such as a triangle, square, 
  82. trapazoid, or any other possible configuration of lines.  If it's still 
  83. unclear, there little illustration will hopefully clear it up:
  84.  
  85.  
  86.    +----+      +          +----+         +    +      +   +          +
  87.    |    |     / \        /    /          |    |     /     \        /
  88.    |    |    /   \      /    /           |    |    /       \      /
  89.    |    |   /     \    /    /            |    |   /         \    /
  90.    +----+  +-------+  +----+             +----+  +------+    +--+
  91.  
  92.    Closed polygons, legal sectors        Open polygons, illegel sectors
  93.  
  94. A term I often use for open polygons is 'line dead-end error'.  This is 
  95. from the fact that if you are tracing along the lines, you will hit a 
  96. dead end sooner or later.  Close polygons will allow you to trace along 
  97. the lines forever, around and around..
  98.  
  99. Things:
  100.  
  101.    Things are all objects in the game, such as barrels, dead bodies, 
  102. guns, ammo, players, monsters, player starting points, etc.  Walls, doors, 
  103. elevators, windows, etc are not Things, but rather lines and sectors.  
  104. All Things should lie within sectors, and not be stuck in a solid wall.
  105.  
  106. Blockmap:
  107.  
  108.    This is an internal structure that Doom uses to detect wall 
  109. collisions.  Once you make a new map, a blockmap must be generated 
  110. before it can be used with Doom.  DMapEdit itself doesn't use this 
  111. structure for anything, so you only need to worry about making it right 
  112. before you play the map.
  113.  
  114. Nodes:
  115.  
  116.    This is another internal structure (a Binary Space Partition tree) used
  117. by Doom to figure out which walls are behind which, so it can skip 
  118. drawing certain walls and be the fast game we all love.  I don't really 
  119. know how it uses it for this purpose, but it does.  Because I don't know 
  120. this, though, DMapEdit doesn't use it in any way, just like the 
  121. blockmap.  So, don't bother making nodes until when you make the blockmap.
  122.  
  123. Segments:
  124.  
  125.    A segment is simply a whole line or a piece of a line.  Segments are 
  126. tightly related with nodes, and created when nodes are created.  Node 
  127. generatation is automatic, and so you will probably never need to know 
  128. about segments.
  129.  
  130. Sub Sectors:
  131.  
  132.    Another internal structure tightly related with nodes.  It describes 
  133. a piece of a sector, in the shape of a convex polygon (less then or equal
  134. to 180 degrees bend between all lines, measured on the inside angle of the
  135. polygon).
  136.  
  137. Texture:
  138.  
  139.    A texture is an image that is projected onto a plane surface, just 
  140. like a slide projecter projects an image on a screen.  So why is it 
  141. called a texture then?  Because that's what id calls it, and I'm going 
  142. along with their terms.  The use of the word texture goes back before 
  143. that, though.  I guess because before texture-mapping, walls looked flat 
  144. and boring.  When an image is projected on that wall, though, it can 
  145. seem to have a lot of texture to it then.  So, it's actually a visual 
  146. texture, and not a surface texture.
  147.  
  148. PWAD:
  149.  
  150.    A PWAD (also known as a 'working wad file'), is a collection of data 
  151. files all combined into one file, with extention WAD.  The file DOOM.WAD 
  152. is an IWAD file, however.  Both are WADs.  IWAD probably stands for
  153. Initial WAD, while PWAD stands for Patched WAD.  The first 4 bytes of a
  154. WAD file will be IWAD or PWAD, thus identifying it's WAD type.  Basically,
  155. when you play doom with a PWAD file, it will try to get any data it need
  156. from the PWAD, and if it can't find something, it will load it from the
  157. IWAD instead.  DMapEdit only saves out PWADs, since only id software has 
  158. the right to use an IWAD header for a WAD.
  159.  
  160. E1M1:
  161.  
  162.    This is just map notation for the episode and mission numbers. 
  163. (episode 1, mission 1 in this case).  This happens to be the way a 
  164. header looks in the wad file, and is just an abbriviation, really.  I 
  165. will often call this the 'map position'.
  166.  
  167. Object:
  168.  
  169.    An object is a Thing, Vertex, Line, Sidedef, or Sector.  Objects are 
  170. the building blocks the user has to make maps with.
  171.  
  172. ---
  173.  
  174. To build maps properly, a map maker needs to understand how the various
  175. map elements work and inter-relate.
  176.  
  177. Objects can be broken up into 2 groups: Things and non-Things.  This is 
  178. because all non-things tend to inter-relate with each other, while 
  179. Things don't inter-relate to anything.  This gives Things a certain
  180. advantage.  Things can be edited completely independently of non-Things.
  181. If you are in the middle of making walls, sectors, etc, you can just
  182. switch over and pop some Things in no problem.  You can edit Things
  183. without any other Objects even created yet.  Or, you can wait and put
  184. Things in last.
  185.  
  186. Also, editing of Things doesn't affect Nodes or the Blockmap.  Thus, if 
  187. you have a finished map (nodes and blockmap generated), you can change 
  188. the Things around all you want, save it, and play it with Doom as it is 
  189. without the need for a new Blockmap or Nodes.
  190.  
  191. Lines:
  192.  
  193.    As you know, lines go from one vertex to another.  Thus, lines are 
  194. dependent on vertexes.  You cannot have a line if you don't have a 
  195. vertex first.  Fortunatly, DMapEdit will automatically create vertexes 
  196. for you on the fly as you create new lines if it needs to.  So, you 
  197. really don't have to lay a foundation of vertexes first.  (note that a 
  198. Vertex is just an ordered pair of coordinates, and that Things also have 
  199. an ordered pair of coordinates.  Things, however, don't use a vertex to 
  200. determine it's location, but uses it's own internal ordered pair).
  201.  
  202. Lines are the source of all non-Thing actions.  For example, having a 
  203. door open, an elevator raise, a bridge fall, etc.  What action a certain 
  204. line will bring about is determined by the linetype (a linedef 
  205. element).  This linetype also determines how the line is activated.
  206.  
  207. Finally, line actions effect a sector.  While the line is the source of 
  208. the action, it is the sector that actually does anything.  With many 
  209. linetypes, the sector affected is determined by set rules.  Many more, 
  210. however, aren't.  For these linetypes, you need to have a way to tell 
  211. Doom what sector a line is supposed to affect.  This is accomplished 
  212. with a trigger id number.  Both lines and sectors have trigger id 
  213. numbers.  Usually this is just set to zero if it isn't used, however, 
  214. when used, it links a line (or lines) to a sector (or sectors).  How?  
  215. By having a common trigger id number.  Thus, a line with trigger id #1 
  216. will affect any sector with a trigger id #1.  As you can see, this 
  217. allows the possibility of having many sectors all affected by one line.  
  218. It also, however, allows several lines to activate one sector.
  219.  
  220. An important thing to know is that you should never have a single line 
  221. in a finished map, like so:
  222.  
  223.        +--------------+
  224.        |              |
  225.        |              |
  226.        |   +------+   |
  227.        |              |
  228.        |              |
  229.        +--------------+
  230.  
  231. Though it might work in Doom, a like like this has no thickness.  What 
  232. wall in the real world has zero thickness?  It also tends to mess with 
  233. DMapEdit when you do this.  If you want something of this nature, do 
  234. this instead:
  235.  
  236.        +--------------+
  237.        |              |
  238.        |              |
  239.        |   +------+   |
  240.        |   +------+   |
  241.        |              |
  242.        |              |
  243.        +--------------+
  244.  
  245. Using a width of 8 or so makes it seem pretty thin, makes it look better 
  246. and more realistic, and follows the general rule of using only closed 
  247. polygons.  If you check out all of Doom's original maps, you will see 
  248. that they always do things this way.
  249.  
  250. Sidedefs:
  251.  
  252.    Sidedefs are dependent on lines.  You can't have a sidedef without a 
  253. line for it to go with.  You can have up to 2 sidedefs to one line, 
  254. however; one on each side.  Since a player can only be on one side or 
  255. the other, only one sidedef is visible at any one time.  The visible 
  256. sidedef determines what the wall (line) looks like, texturewise.  
  257. Sidedef textures can be transparent, however.  If the visible sidedef 
  258. texture is transparent, you won't see the other sidedef texture, 
  259. though.  It is only visible from the other side of the line.  This may 
  260. seem strange, but it does allow for some interesting illusions.  It's a 
  261. lot like one-way mirrors, except they aren't mirrors, but seemingly 
  262. solid walls.
  263.  
  264. Sectors:
  265.  
  266.    Sectors are dependent on lines also, though in a much more unusual 
  267. way than sidedefs.  The actual size and shape of the sector is determined 
  268. by the lines that make up the polygon.  Because of this, in theory open 
  269. polygons could a sector.  However the problem Doom has then is that it 
  270. doesn't know how to determine what sector a player, monster, or other 
  271. Thing is in.  It is the sidedefs of a line that actually determine the 
  272. sector.  With a closed polygon, each line has an inside facing sidedef:
  273.  
  274.      +----------------------------------+
  275.      |                 ^                |
  276.      |                 |                |
  277.      | <--- inside facing sidedefs ---> | <--- outside facing sidedef
  278.      |                 |                |
  279.      |                 v                |
  280.      +----------------------------------+
  281.  
  282. All sidedefs have a 'sector facing' number, which tells Doom what sector 
  283. this sidedef helps surround.  This is the only way Doom has of knowing 
  284. where the sector is located.  In the above example, all four inside 
  285. sidedefs must point to the same sector number, and for any sector, all 
  286. the inside sidedefs must point to the same sector number.  If not, Doom 
  287. will have a fit.  Having one of the outside sidedefs pointing to the 
  288. sector instead of the inside sidedef will cause problems too, as well as 
  289. having an inside sidedef point to the wrong sector.  These are examples 
  290. of what I call 'damaged sectors'.  For time to time while using 
  291. DMapEdit, certain actions may cause a 'damaged sector'.  Unfortunately, 
  292. there is no real way of checking for this as you are editing.  If you 
  293. find a damaged sector, you should fix it, so Doom won't crash.
  294.  
  295. So far, we have only discussed simple sectors.  There are also complex 
  296. (or donut) sectors.  Also called 'a sector within a sector' by many 
  297. people, it is basically a polygon (or group of polygons) inside of 
  298. another polygon, like so:
  299.  
  300.      +------------------------------------------+
  301.      |               sector area #1             |
  302.      |  +----------------+  +----------------+  |
  303.      |  |                |  | sector area #3 |  |  outside void area
  304.      |  | sector area #2 |  +----------------+  |
  305.      |  |                |  | sector area #4 |  |
  306.      |  +----------------+  +----------------+  |
  307.      |            also sector area #1           |
  308.      +------------------------------------------+
  309.  
  310. In this example, sectors 2, 3, and 4 are simple sectors.  Sector #1, 
  311. however, is a complex sector.  The inside sidedefs of the outermost 
  312. polygon must point to sector #1, and the outside sidedefs of sector #2 
  313. polygon and sector 3 and 4 polygon must point to sector #1 also.  
  314. Fortunately, DMapEdit handles creating both simple and complex sector.  
  315. It is, however, highly useful to know how sectors are set-up to that you 
  316. can spot damaged sectors.  The main source of damaged sectors is from 
  317. first creating a simple sector, and them adding a polygon inside of it 
  318. later.  At this point, it is a complex sector, yet it is a damaged one.  
  319. Only the outer polygon is set to the sector.  In such a case, you must 
  320. remake (fix) the sector.
  321.  
  322. Another type of sector is one that exists in multiple polygons.  This is 
  323. usually refered to as extended sectors.  Basically, you have more than 
  324. one polygon with the same sector number.  This, in fact, causes no 
  325. problems for Doom, and allows for some very interesting possibilities.  
  326. The only downside of it all is that since it is all one sector, all of 
  327. the polygons have the same characteristics (floor and ceiling heights 
  328. are all the same).
  329.  
  330. Another thing to remember is that lines can never cross one another.  
  331. This is an error if it occures.  If you want something like this, be 
  332. sure to put a vertex at the intersector point, and make 4 lines out of 
  333. it instead.  Crossed lines will really upset Doom, since polygons will 
  334. overlap one another.  Another common error much like this one is shown 
  335. here:
  336.  
  337.      A-------------B-------------C
  338.      |             |             |
  339.      |  Sector #1  |  Sector #2  |
  340.      |             |             |
  341.      D-------------E-------------F
  342.  
  343. This doesn't look like a problem, probably, it isn't if you have 7 
  344. lines.  But, if you only have 5 lines, being: AC, DF, AD, CF, and BE, 
  345. then you do have a problem, and it's usually hard to find these types of 
  346. problem.  The reason it's a problem is because of lines AC and DF.  The 
  347. inside sidedefs of each line must point to both sector #1 and sector #2, 
  348. which is impossible, since each sidedef can only point to one sector.  
  349. Another way of looking at this is that you really only have 1 closed 
  350. polygon, and a line that looks like it splits it (though not really 
  351. crossing it any other lines).  Well, it looks like 2 polygons, but it 
  352. isn't to Doom, or to DMapEdit, and a single line by itself is an error.  
  353. A rule to remember is that each and ever vertex can never have only 1 
  354. line connected to it.  If it does, you have an error, and Doom will crash.
  355.  
  356. textures:
  357.  
  358.    Sector defs have a floor texture name, and a ceiling texture name.  
  359. These are the images you will see on the floor and ceiling of that 
  360. sector.  Floors are seen from above them, and ceilings from below.  This 
  361. seems trivial, and it is, but just wanted to say that you can't see then 
  362. from the other direction.
  363.  
  364.    All sidedefs can have a 3 different textures, or have '-' for a 
  365. texture name, meaning no texture.  A '-' texture is basically a totally 
  366. tranparent texture.  Some textures are semi-transparent, meaning they 
  367. have holes in them that you can see through.  Some textures aren't 
  368. transparent at all, but also fall into this catarogy.  What catarogy, 
  369. you ask?  Well, the single-patch texture catarogy.  All textures are 
  370. made up of patches, which are just rectangular images.  If more than one 
  371. patch is used for a texture, then each patch is drawn, overlapping 
  372. anything under it.  This is done to help save memory and diskspace.  
  373. Anyway, this isn't all that important.  What is important is that only 
  374. single-patch textures can be used on double-sided lines (line has 2 
  375. sidedefs).  Using a multi-patch texture on a double-sided line will 
  376. cause problems in doom (the wall will look real weird and the game will 
  377. slow way down).  In truth, it is not the the fact that a line is 
  378. 2-sided, but rather that the line attribute bit '2s' that controls if 
  379. transparent textures are allowed on the line.  This bit is only ever set 
  380. for 2-sided lines, though, so it amounts to the same thing.
  381.  
  382. Only the middle texture can have a transparent texture, or no texture.
  383. Upper and lower textures will have problems with them (as I'll explain
  384. in a bit).
  385.  
  386. You are probably wondering what the differences are between these 3 
  387. textures, and why 3 textures are needed.  Well, here's another picture 
  388. first:
  389.  
  390.              --------+
  391.                      |
  392.                      |
  393.                      +--------
  394.                      .
  395.                      .
  396.         Sector #1   A.B   Sector #2
  397.                      .
  398.                      .
  399.                      +--------
  400.                      |
  401.                      |
  402.              --------+
  403.  
  404. This is a side view (like you see in doom) looking down a line (between 
  405. the 2 sectors).  This line is 2 sided, with sidedef A facing sector #1, 
  406. and sidedef B facing sector #2.  Now, while a player is standing in 
  407. sector #2, he sees into sector #1 because sidedef B has a '-' middle 
  408. texture.  (remember, from sector #2, you only see sidedef B, and not 
  409. sidedef A).  Sidedef B, while it has 3 textures, only has the middle 
  410. texture visible.  To understand why, lets look at sector #1.
  411.  
  412. If a player stands in sector #1, he can see into sector #2 through the 
  413. middle texture on sidedef B, which will be '-' also.  However, there is 
  414. also a texture between sector #1's ceiling and sector #2's ceiling that 
  415. he sees, as well as a texture between sector #1's floor and sector #2's 
  416. floor.  These are the upper and lower textures, and are drawn on steps, 
  417. and ceiling-steps.  Sidedef B hides both of these textures, though, 
  418. since one is above the ceiling, and the other is below the floor.  An 
  419. interesting fact is that only one sidedef of a line will have a visible 
  420. upper texture, and only only one will have a visible lower texture.
  421.  
  422. So, the upper texture area is always between the 2 ceiling heights, and 
  423. the lower texture area is always between the 2 floor heights.  What if 
  424. the ceiling heights are both the same?  Then both sidedefs will have 
  425. hidden upper textures.
  426.  
  427. Now, think about standing in sector #1 and looking at the lower 
  428. texture.  Suppose we have a '-' texture as the lower.  What will we 
  429. see?  The answer is nothing.  We are looking under the floor now, and 
  430. will see to infinity.  This isn't good.  You might think that you should 
  431. just see black, but in fact you will see garbage usually.  The rule is, 
  432. don't use transparent or semi-transparent textures on lower or upper 
  433. textures.
  434.  
  435. Ok, so that covered 2-sided lines, but what about 1-sided lines?  Well, 
  436. the upper texture will start at the ceiling height, and the lower at the 
  437. floor height.  Both textures are theorectically infinitly high.  Both, 
  438. however, are hidden.  So, for single-sided lines, you only see the 
  439. middle texture.  Because there is no sector behind a single-sided line, 
  440. transparent textures are not allowed, and will only show junk if used.
  441.  
  442. Texture pegging:
  443.  
  444.    There is a line attribute for unpegging both the upper and the lower 
  445. textures of sidedefs on the line.  We will only look at the upper 
  446. texture to illustrate this, though it works the same way for the lower 
  447. texture.
  448.  
  449. A pegged texture, to explain it the most simply, moves along with the 
  450. ceiling when it moves.  For example, a door, which is simply a moving 
  451. ceiling, always uses a pegged upper texture.  Thus, when the ceiling 
  452. comes down (or goes up), the texture moves along with it.  If it is 
  453. unpegged, the texture will remain stationary while the ceiling moves.  
  454. This makes it look like the upper texture magically appears from the 
  455. bottom as the ceiling lowers, or disappears from the bottom as the 
  456. ceiling comes up.  Note that the ceiling moving in this example is the 
  457. door sectors, and not the sector in front of it.
  458.  
  459. Ok, that's a simple explaination, but there's more to it than that 
  460. really.  pegged textures actually follow the lower ceiling, while 
  461. unpegged follow the higher ceiling.  So:
  462.  
  463.         --------A
  464.                 |
  465.                 |
  466.                 B--------
  467.                 .
  468.      Sector #1  .  Sector #2
  469.                 .
  470.                 .
  471.         --------+--------
  472.  
  473. Now, of course, the visible upper texture is on the sidedef facing 
  474. sector #1.  If the upper texture is pegged,  the texture appears to move 
  475. when sector #2's ceiling moves, disappearing or appearing from sector 
  476. #1's ceiling (a door seems to disappear into sector #1's ceiling).  In 
  477. other words, the texture is drawn relative to B.
  478.  
  479. An unpegged texture will follow sector #1's ceiling height instead.  If 
  480. sector #1's ceiling moves, so will the upper texture, seeming to vanish 
  481. or appear at B.
  482.  
  483. Ok, so unpegged upper textures sound pretty useless, right?  Well, for 
  484. doors and such, it is, except for special effects.  It is useful for 
  485. windows and such, however, that don't have moving ceilings.  By 
  486. unpegging the upper texture, you can have the texture align with the 
  487. walls on either side of the window.  That's about the main use of it.
  488.  
  489. It's also useful for staircases.  If you can see the staircase from the 
  490. side, then having it unpegged will make the lower texture follow the 
  491. base floor, where all the stairs have the same height.  Thus, they will 
  492. all align with one another.
  493.  
  494.