home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1997 January / CD_shareware_1-97.iso / DOS / JUEGOS / DMAPED40.ZIP / DOCS / CONCEPTS.TXT < prev    next >
Encoding:
Text File  |  1994-10-01  |  23.7 KB  |  498 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.  I 
  206. believe that all lines must be activated on the right side.  They will
  207. not activate from the left side.  If you ever have a line that you can't
  208. activate in your WAD, make sure that it is the right side that you are
  209. attempting to activate, and not the left.
  210.  
  211. Finally, line actions effect a sector.  While the line is the source of 
  212. the action, it is the sector that actually does anything.  With many 
  213. linetypes, the sector affected is determined by set rules.  Many more, 
  214. however, aren't.  For these linetypes, you need to have a way to tell 
  215. Doom what sector a line is supposed to affect.  This is accomplished 
  216. with a trigger id number.  Both lines and sectors have trigger id 
  217. numbers.  Usually this is just set to zero if it isn't used, however, 
  218. when used, it links a line (or lines) to a sector (or sectors).  How?  
  219. By having a common trigger id number.  Thus, a line with trigger id #1 
  220. will affect any sector with a trigger id #1.  As you can see, this 
  221. allows the possibility of having many sectors all affected by one line.  
  222. It also, however, allows several lines to activate one sector.
  223.  
  224. An important thing to know is that you should never have a single line 
  225. in a finished map, like so:
  226.  
  227.        +--------------+
  228.        |              |
  229.        |              |
  230.        |   +------+   |
  231.        |              |
  232.        |              |
  233.        +--------------+
  234.  
  235. Though it might work in Doom, a line like this has no thickness.  What 
  236. wall in the real world has zero thickness?  It also tends to mess with 
  237. DMapEdit when you do this.  If you want something of this nature, do 
  238. this instead:
  239.  
  240.        +--------------+
  241.        |              |
  242.        |              |
  243.        |   +------+   |
  244.        |   +------+   |
  245.        |              |
  246.        |              |
  247.        +--------------+
  248.  
  249. Using a width of 8 or so makes it seem pretty thin, makes it look better 
  250. and more realistic, and follows the general rule of using only closed 
  251. polygons.  If you check out all of Doom's original maps, you will see 
  252. that they always do things this way.
  253.  
  254. Sidedefs:
  255.  
  256.    Sidedefs are dependent on lines.  You can't have a sidedef without a 
  257. line for it to go with.  You can have up to 2 sidedefs to one line, 
  258. however; one on each side.  Since a player can only be on one side or 
  259. the other, only one sidedef is visible at any one time.  The visible 
  260. sidedef determines what the wall (line) looks like, texturewise.  
  261. Sidedef textures can be transparent, however.  If the visible sidedef 
  262. texture is transparent, you won't see the other sidedef texture, 
  263. though.  It is only visible from the other side of the line.  This may 
  264. seem strange, but it does allow for some interesting illusions.  It's a 
  265. lot like one-way mirrors, except they aren't mirrors, but seemingly 
  266. solid walls.
  267.  
  268. Sectors:
  269.  
  270.    Sectors are dependent on lines also, though in a much more unusual 
  271. way than sidedefs.  The actual size and shape of the sector is determined 
  272. by the lines that make up the polygon.  Because of this, in theory open 
  273. polygons could a sector.  However the problem Doom has then is that it 
  274. doesn't know how to determine what sector a player, monster, or other 
  275. Thing is in.  It is the sidedefs of a line that actually determine the 
  276. sector.  With a closed polygon, each line has an inside facing sidedef:
  277.  
  278.      +----------------------------------+
  279.      |                 ^                |
  280.      |                 |                |
  281.      | <--- inside facing sidedefs ---> | <--- outside facing sidedef
  282.      |                 |                |
  283.      |                 v                |
  284.      +----------------------------------+
  285.  
  286. All sidedefs have a 'sector facing' number, which tells Doom what sector 
  287. this sidedef helps surround.  This is the only way Doom has of knowing 
  288. where the sector is located.  In the above example, all four inside 
  289. sidedefs must point to the same sector number, and for any sector, all 
  290. the inside sidedefs must point to the same sector number.  If not, Doom 
  291. will have a fit.  Having one of the outside sidedefs pointing to the 
  292. sector instead of the inside sidedef will cause problems too, as well as 
  293. having an inside sidedef point to the wrong sector.  These are examples 
  294. of what I call 'damaged sectors'.  For time to time while using 
  295. DMapEdit, certain actions may cause a 'damaged sector'.  Unfortunately, 
  296. there is no real way of checking for this as you are editing.  If you 
  297. find a damaged sector, you should fix it, so Doom won't crash.
  298.  
  299. So far, we have only discussed simple sectors.  There are also complex 
  300. (or donut) sectors.  Also called 'a sector within a sector' by many 
  301. people, it is basically a polygon (or group of polygons) inside of 
  302. another polygon, like so:
  303.  
  304.      +------------------------------------------+
  305.      |               sector area #1             |
  306.      |  +----------------+  +----------------+  |
  307.      |  |                |  | sector area #3 |  |  outside void area
  308.      |  | sector area #2 |  +----------------+  |
  309.      |  |                |  | sector area #4 |  |
  310.      |  +----------------+  +----------------+  |
  311.      |            also sector area #1           |
  312.      +------------------------------------------+
  313.  
  314. In this example, sectors 2, 3, and 4 are simple sectors.  Sector #1, 
  315. however, is a complex sector.  The inside sidedefs of the outermost 
  316. polygon must point to sector #1, and the outside sidedefs of sector #2 
  317. polygon and sector 3 and 4 polygon must point to sector #1 also.  
  318. Fortunately, DMapEdit handles creating both simple and complex sector.  
  319. It is, however, highly useful to know how sectors are set-up to that you 
  320. can spot damaged sectors.  The main source of damaged sectors is from 
  321. first creating a simple sector, and them adding a polygon inside of it 
  322. later.  At this point, it is a complex sector, yet it is a damaged one.  
  323. Only the outer polygon is set to the sector.  In such a case, you must 
  324. remake (fix) the sector.
  325.  
  326. Another type of sector is one that exists in multiple polygons.  This is 
  327. usually refered to as extended sectors.  Basically, you have more than 
  328. one polygon with the same sector number.  This, in fact, causes no 
  329. problems for Doom, and allows for some very interesting possibilities.  
  330. The only downside of it all is that since it is all one sector, all of 
  331. the polygons have the same characteristics (floor and ceiling heights 
  332. are all the same).
  333.  
  334. Another thing to remember is that lines can never cross one another.  
  335. This is an error if it occures.  If you want something like this, be 
  336. sure to put a vertex at the intersector point, and make 4 lines out of 
  337. it instead.  Crossed lines will really upset Doom, since polygons will 
  338. overlap one another.  Another common error much like this one is shown 
  339. here:
  340.  
  341.      A-------------B-------------C
  342.      |             |             |
  343.      |  Sector #1  |  Sector #2  |
  344.      |             |             |
  345.      D-------------E-------------F
  346.  
  347. This doesn't look like a problem, probably, it isn't if you have 7 
  348. lines.  But, if you only have 5 lines, being: AC, DF, AD, CF, and BE, 
  349. then you do have a problem, and it's usually hard to find these types of 
  350. problem.  The reason it's a problem is because of lines AC and DF.  The 
  351. inside sidedefs of each line must point to both sector #1 and sector #2, 
  352. which is impossible, since each sidedef can only point to one sector.  
  353. Another way of looking at this is that you really only have 1 closed 
  354. polygon, and a line that looks like it splits it (though not really 
  355. crossing it any other lines).  Well, it looks like 2 polygons, but it 
  356. isn't to Doom, or to DMapEdit, and a single line by itself is an error.  
  357. A rule to remember is that each and ever vertex can never have only 1 
  358. line connected to it.  If it does, you have an error, and Doom will crash.
  359.  
  360. textures:
  361.  
  362.    Sector defs have a floor texture name, and a ceiling texture name.  
  363. These are the images you will see on the floor and ceiling of that 
  364. sector.  Floors are seen from above them, and ceilings from below.  This 
  365. seems trivial, and it is, but just wanted to say that you can't see then 
  366. from the other direction.
  367.  
  368.    All sidedefs can have a 3 different textures, or have '-' for a 
  369. texture name, meaning no texture.  A '-' texture is basically a totally 
  370. tranparent texture.  Some textures are semi-transparent, meaning they 
  371. have holes in them that you can see through.  Some textures aren't 
  372. transparent at all, but also fall into this catarogy.  What catarogy, 
  373. you ask?  Well, the single-patch texture catarogy.  All textures are 
  374. made up of patches, which are just rectangular images.  If more than one 
  375. patch is used for a texture, then each patch is drawn, overlapping 
  376. anything under it.  This is done to help save memory and diskspace.  
  377. Anyway, this isn't all that important.  What is important is that only 
  378. single-patch textures can be used on double-sided lines (line has 2 
  379. sidedefs).  Using a multi-patch texture on a double-sided line will 
  380. cause problems in doom (the wall will look real weird and the game will 
  381. slow way down).  In truth, it is not the the fact that a line is 
  382. 2-sided, but rather that the line attribute bit '2s' that controls if 
  383. transparent textures are allowed on the line.  This bit is only ever set 
  384. for 2-sided lines, though, so it amounts to the same thing.
  385.  
  386. Only the middle texture can have a transparent texture, or no texture.
  387. Upper and lower textures will have problems with them (as I'll explain
  388. in a bit).
  389.  
  390. You are probably wondering what the differences are between these 3 
  391. textures, and why 3 textures are needed.  Well, here's another picture 
  392. first:
  393.  
  394.              --------+
  395.                      |
  396.                      |
  397.                      +--------
  398.                      .
  399.                      .
  400.         Sector #1   A.B   Sector #2
  401.                      .
  402.                      .
  403.                      +--------
  404.                      |
  405.                      |
  406.              --------+
  407.  
  408. This is a side view (like you see in doom) looking down a line (between 
  409. the 2 sectors).  This line is 2 sided, with sidedef A facing sector #1, 
  410. and sidedef B facing sector #2.  Now, while a player is standing in 
  411. sector #2, he sees into sector #1 because sidedef B has a '-' middle 
  412. texture.  (remember, from sector #2, you only see sidedef B, and not 
  413. sidedef A).  Sidedef B, while it has 3 textures, only has the middle 
  414. texture visible.  To understand why, lets look at sector #1.
  415.  
  416. If a player stands in sector #1, he can see into sector #2 through the 
  417. middle texture on sidedef B, which will be '-' also.  However, there is 
  418. also a texture between sector #1's ceiling and sector #2's ceiling that 
  419. he sees, as well as a texture between sector #1's floor and sector #2's 
  420. floor.  These are the upper and lower textures, and are drawn on steps, 
  421. and ceiling-steps.  Sidedef B hides both of these textures, though, 
  422. since one is above the ceiling, and the other is below the floor.  An 
  423. interesting fact is that only one sidedef of a line will have a visible 
  424. upper texture, and only only one will have a visible lower texture.
  425.  
  426. So, the upper texture area is always between the 2 ceiling heights, and 
  427. the lower texture area is always between the 2 floor heights.  What if 
  428. the ceiling heights are both the same?  Then both sidedefs will have 
  429. hidden upper textures.
  430.  
  431. Now, think about standing in sector #1 and looking at the lower 
  432. texture.  Suppose we have a '-' texture as the lower.  What will we 
  433. see?  The answer is nothing.  We are looking under the floor now, and 
  434. will see to infinity.  This isn't good.  You might think that you should 
  435. just see black, but in fact you will see garbage usually.  The rule is, 
  436. don't use transparent or semi-transparent textures on lower or upper 
  437. textures.
  438.  
  439. Ok, so that covered 2-sided lines, but what about 1-sided lines?  Well, 
  440. the upper texture will start at the ceiling height, and the lower at the 
  441. floor height.  Both textures are theorectically infinitly high.  Both, 
  442. however, are hidden.  So, for single-sided lines, you only see the 
  443. middle texture.  Because there is no sector behind a single-sided line, 
  444. transparent textures are not allowed, and will only show junk if used.
  445.  
  446. Texture pegging:
  447.  
  448.    There is a line attribute for unpegging both the upper and the lower 
  449. textures of sidedefs on the line.  We will only look at the upper 
  450. texture to illustrate this, though it works the same way for the lower 
  451. texture.
  452.  
  453. A pegged texture, to explain it the most simply, moves along with the 
  454. ceiling when it moves.  For example, a door, which is simply a moving 
  455. ceiling, always uses a pegged upper texture.  Thus, when the ceiling 
  456. comes down (or goes up), the texture moves along with it.  If it is 
  457. unpegged, the texture will remain stationary while the ceiling moves.  
  458. This makes it look like the upper texture magically appears from the 
  459. bottom as the ceiling lowers, or disappears from the bottom as the 
  460. ceiling comes up.  Note that the ceiling moving in this example is the 
  461. door sectors, and not the sector in front of it.
  462.  
  463. Ok, that's a simple explaination, but there's more to it than that 
  464. really.  pegged textures actually follow the lower ceiling, while 
  465. unpegged follow the higher ceiling.  So:
  466.  
  467.         --------A
  468.                 |
  469.                 |
  470.                 B--------
  471.                 .
  472.      Sector #1  .  Sector #2
  473.                 .
  474.                 .
  475.         --------+--------
  476.  
  477. Now, of course, the visible upper texture is on the sidedef facing 
  478. sector #1.  If the upper texture is pegged,  the texture appears to move 
  479. when sector #2's ceiling moves, disappearing or appearing from sector 
  480. #1's ceiling (a door seems to disappear into sector #1's ceiling).  In 
  481. other words, the texture is drawn relative to B.
  482.  
  483. An unpegged texture will follow sector #1's ceiling height instead.  If 
  484. sector #1's ceiling moves, so will the upper texture, seeming to vanish 
  485. or appear at B.
  486.  
  487. Ok, so unpegged upper textures sound pretty useless, right?  Well, for 
  488. doors and such, it is, except for special effects.  It is useful for 
  489. windows and such, however, that don't have moving ceilings.  By 
  490. unpegging the upper texture, you can have the texture align with the 
  491. walls on either side of the window.  That's about the main use of it.
  492.  
  493. It's also useful for staircases.  If you can see the staircase from the 
  494. side, then having it unpegged will make the lower texture follow the 
  495. base floor, where all the stairs have the same height.  Thus, they will 
  496. all align with one another.
  497.  
  498.