home *** CD-ROM | disk | FTP | other *** search
/ The Doom Hacker's Guide / DoomHackersGuideCd.bin / text / dmspec16 / dmspec16.txt
Text File  |  1995-01-11  |  166KB  |  3,828 lines

  1.  
  2.  
  3. Article 172 of rec.games.computer.doom.announce:
  4. Path: usenet.ins.cwru.edu!gatech!howland.reston.ans.net!pipex!mantis!mantis!not-for-mail
  5. From: MSFell@aol.com (Matt Fell)
  6. Newsgroups: rec.games.computer.doom.announce,rec.games.computer.doom.help,rec.games.computer.doom.editing
  7. Subject: ()== DOOM WAD File Specifications ================(94/12/15)
  8. Supersedes: <specs_789016623@news.mantis.co.uk>
  9. Followup-To: poster
  10. Date: 5 Jan 1995 03:17:12 -0000
  11. Organization: RGCD Steering Committee
  12. Lines: 3805
  13. Sender: tony@mantis.co.uk
  14. Approved: doom@mantis.co.uk
  15. Expires: 20 Jan 1995 03:17:01 GMT
  16. Message-ID: <specs_789275821@news.mantis.co.uk>
  17. NNTP-Posting-Host: sunforest.mantis.co.uk
  18. Mime-Version: 1.0
  19. Content-Type: text/plain; charset=iso-8859-1
  20. Content-Transfer-Encoding: 8bit
  21. Xref: usenet.ins.cwru.edu rec.games.computer.doom.announce:172 rec.games.computer.doom.help:2262 rec.games.computer.doom.editing:1504
  22.  
  23. [ Oops - sent out the wrong version a few days ago. Here's the correct one.
  24.    -- TL ]
  25.  
  26.                T H E   U N O F F I C I A L
  27. =================     ===============     ===============   ================
  28. \\ . . . . . . .\\   //. . . . . . .\\   //. . . . . . .\\  \\. . .\\// . .//
  29. ||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . ..||
  30. || . .||   ||. . || || . .||   ||. . || || . .||   ||. . || ||. . . . . . .||
  31. ||. . ||   || . .|| ||. . ||   || . .|| ||. . ||   || . .|| || . | . . . ..||
  32. || . .||   ||. _-|| ||-_ .||   ||. . || || . .||   ||. _-|| ||-_.|\ . . . .||
  33. ||. . ||   ||-'  || ||  `-||   || . .|| ||. . ||   ||-'  || ||  `|\_ . .|..||
  34. || . _||   ||    || ||    ||   ||_ . || || . _||   ||    || ||   |\ `-_/| .||
  35. ||_-' ||  .|/    || ||    \|.  || `-_|| ||_-' ||  .|/    || ||   | \  / -_.||
  36. ||    ||_-'      || ||      `-_||    || ||    ||_-'      || ||   | \  / | '||
  37. ||    `'         || ||         `'    || ||    `'         || ||   | \  / |  ||
  38. ||            .===' `===.         .==='.`===.         .===' /==. |  \/  |  ||
  39. ||         .=='   \_|-_ `===. .==='   _|_   `===. .===' _-|/   `==  \/  |  ||
  40. ||      .=='    _-'    `-_  `='    _-'   `-_    `='  _-'   `-_  /|  \/  |  ||
  41. ||   .=='    _-'          `-__\._-'         `-_./__-'         `' |. /|  |  ||
  42. ||.=='    _-'                                                     `' | /==.||
  43. =='    _-'         S         P         E         C         S          \/  `==
  44. \   _-'                                                                `-_  /
  45.  `''                                                                      ``'
  46.                Release v1.666 - December 15th, 1994
  47.            Written by: Matthew S Fell (msfell@aol.com)
  48.  
  49.       "The poets talk about love, ...but what I talk about is DOOM,
  50.           because in the end, DOOM is all that counts."
  51.         - Alex Machine/George Stark/Stephen King, _The Dark Half_
  52. ------------------------------------------------------------------------------
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. ----------
  62. DISCLAIMER
  63. ----------
  64.  
  65.     These specs are to aid in informing the public about the games
  66. DOOM and DOOM 2, by id Software.  In no way should this promote your
  67. killing yourself, killing others, or killing in any other fashion.
  68. Additionally, the author does not claim ANY responsibility
  69. regarding ANY illegal activity concerning this file, or indirectly related
  70. to this file.  The information contained in this file only reflects
  71. id Software indirectly, and questioning id Software regarding any
  72. information in this file is not recommended.
  73.  
  74. ----------------
  75. COPYRIGHT NOTICE
  76. ----------------
  77.  
  78. This article is Copyright 1994 by Matt Fell.  All rights reserved.
  79. You are granted the following rights:
  80.  
  81. I.  To make copies of this work in original form, so long as
  82.       (a) the copies are exact and complete;
  83.       (b) the copies include the copyright notice and these paragraphs
  84.       in their entirety;
  85.       (c) the copies give obvious credit to the author, Matt Fell;
  86.       (d) the copies are in electronic form.
  87. II. To distribute this work, or copies made under the provisions
  88.     above, so long as
  89.       (a) this is the original work and not a derivative form;
  90.       (b) you do not charge a fee for copying or for distribution;
  91.       (c) you ensure that the distributed form includes the copyright
  92.       notice, this paragraph, the disclaimer of warranty in
  93.       their entirety and credit to the author;
  94.       (d) the distributed form is not in an electronic magazine or
  95.       within computer software (prior explicit permission may be
  96.       obtained from the author);
  97.       (e) the distributed form is the NEWEST version of the article to
  98.       the best of the knowledge of the distributor;
  99.       (f) the distributed form is electronic.
  100.  
  101.     You may not distribute this work by any non-electronic media,
  102. including but not limited to books, newsletters, magazines, manuals,
  103. catalogs, and speech.  You may not distribute this work in electronic
  104. magazines or within computer software without prior written explicit
  105. permission.  These rights are temporary and revocable upon written, oral,
  106. or other notice by the author. This copyright notice shall be governed
  107. by the laws of the state of Ohio.
  108.     If you would like additional rights beyond those granted above,
  109. write to the author at "msfell@aol.com" on the Internet.
  110.  
  111.  
  112. --------
  113. CONTENTS
  114. --------
  115.  
  116. [1] Introduction
  117.     [1-1] id Software's Copyright
  118.     [1-2] What's New
  119. [2] The Basics
  120.     [2-1] Pwads
  121.     [2-2] DOOM version information
  122.     [2-3] Terminology conventions
  123. [3] List of DOOM.WAD Directory Entries
  124. [4] The Levels
  125.     [4-1] ExMy or MAPxy
  126.     [4-2] THINGS
  127.         [4-2-1] Thing Types
  128.         [4-2-2] Thing Sizes
  129.         [4-2-3] Thing Options
  130.     [4-3] LINEDEFS
  131.         [4-3-1] Linedef Flags
  132.         [4-3-2] Linedef Types
  133.     [4-4] SIDEDEFS
  134.     [4-5] VERTEXES
  135.     [4-6] SEGS
  136.     [4-7] SSECTORS
  137.     [4-8] NODES
  138.     [4-9] SECTORS
  139.         [4-9-1] Special Sector Types
  140.     [4-10] REJECT
  141.     [4-11] BLOCKMAP
  142. [5] Graphics
  143.     [5-1] Picture Format
  144. [6] Flats (Floor and Ceiling Textures)
  145.     [6-1] Animated Floors, see [8-4-1]
  146. [7] Sounds and Music
  147.     [7-1] PC Speaker Sound Effects
  148.     [7-2] Soundcard Sound Effects
  149.     [7-3] Music
  150.     [7-4] GENMIDI
  151.     [7-5] DMXGUS
  152. [8] Miscellaneous Lumps
  153.     [8-1] PLAYPAL
  154.     [8-2] COLORMAP
  155.     [8-3] ENDOOM
  156.     [8-4] TEXTURE1 and TEXTURE2
  157.         [8-4-1] Animated Walls
  158.         [8-4-2] The SKY Textures
  159.     [8-5] PNAMES
  160.     [8-6] DEMOs
  161.         [8-6-1] Level changes from 1.2 to 1.666 DOOM.WAD
  162. [9] Savegame Files
  163.  
  164. [10] The DOOM.EXE File
  165.     [10-1] Version 1.2 DOOM.EXE Data Segment Overview
  166.     [10-1] Version 1.666 DOOM.EXE Data Segment Overview
  167.     [10-3] Detail on some EXE Data Structures
  168.  
  169. APPENDICES
  170.  
  171. [A-1] Backus-Naur Form definitions of wad elements
  172. [A-2] Engine limits
  173. [A-3] DOOM.WAD changes and errors
  174. [A-3] A BLOCKMAP algorithm
  175. [A-4] Other helpful documents
  176. [A-5] Acknowledgments
  177.  
  178.  
  179. -------------------------
  180. CHAPTER [1]: Introduction
  181. -------------------------
  182.  
  183.   DOOM is simply an all-time great game. A big factor in its success
  184. and durability is the plethora of user-created add-ons. id Software
  185. tacitly encouraged them by including the -FILE parameter, and by having
  186. a data format that is both straightforward and easy to understand.
  187. DOOM is basically two files, DOOM.EXE and DOOM.WAD. DOOM.EXE is the
  188. "engine" which does the display and controls the game, and DOOM.WAD has
  189. ALL of the graphics, sound, and map/level data that the engine uses.
  190. The -FILE parameter allows small or large external "WAD" files to be
  191. incorporated, changing any number of those graphics, sounds, and maps.
  192.   DOOM 2 has many things in common with DOOM. It uses the same EXE file
  193. as version 1.666 of DOOM, and the WAD file format is the same. It's just
  194. the contents of the WAD file that are different; there are more enemies!
  195. more pictures! more weapons! more stuff!!
  196.  
  197.   This document explains in great detail nearly all aspects of the doom
  198. WAD file format. And a new chapter (10) documents the location of data
  199. within DOOM.EXE itself, so that various unusual game-play changes can
  200. be made. This information has been updated to apply to DOOM 2 as well
  201. as DOOM 1.
  202.   The specs were originally conceived as an aid to programmers making
  203. DOOM utilities, especially map-editors. Coincidentally, there might also
  204. be information useful to advanced level designers and players.
  205.   The material herein is somewhat technical and it is not recommended for
  206. beginners, unless they are determined. There are some other very useful
  207. documents in existence; I list the ones I know of in Appendix [A-3].
  208.  
  209.  
  210. [1-1]: id Software's Copyright and the Shareware Version
  211. ========================================================
  212.  
  213.   My comments and statements are by no means official, and the excerpts
  214. below are just the parts that I think are relevant to these specs. Please
  215. read the LICENSE.DOC and README.EXE that came with DOOM.
  216.  
  217.   The LICENSE.DOC says:
  218.  
  219.     "You shall not:  rent, lease, sell, distribute for money or other
  220.     consideration, modify, translate, disassemble, decompile, reverse
  221.     engineer, or create derivative works based upon the Software.
  222.     Notwithstanding the foregoing, you may create a map editor, modify
  223.     maps and make your own maps (collectively referenced as the
  224.     "Permitted Derivative Works") for the Software.  You may not sell
  225.     or distribute any Permitted Derivative Works but you may exchange
  226.     the Permitted Derivative Works at no charge amongst other end-users.
  227.     In order to commercially distribute any such map editor or data
  228.     utility you must first sign ID's Data Utility License and ID
  229.     reserves the right to deny authorization to commercial distribute
  230.     the any such map editor or data utility.  You may request a copy of
  231.     the Data Editor License from ID"
  232.  
  233.     "(except for backup purposes) You may not otherwise reproduce, copy
  234.     or disclose to others, in whole or in any part, the Software."
  235.  
  236.   The README says:
  237.  
  238.     "id Software respectfully requests that you do not modify the levels
  239.     for the shareware version of DOOM.  We feel that the distribution of
  240.     new levels that work with the shareware version of DOOM will lessen a
  241.     potential user's incentive to purchase the registered version.
  242.  
  243.     "If you would like to work with modified levels of DOOM, we encourage
  244.     you to purchase the registered version of the game."
  245.  
  246.   If you are making add-ons, plan on them not working on the shareware
  247. game, and plan on including statements about the trademarks and copyrights
  248. that id Software owns, as well as disclaimers that they won't support your
  249. add-on product, nor will they support DOOM after it has been modified.
  250.  
  251.  
  252. [1-2]: What's New
  253. =================
  254.  
  255.   Each new version of these specs renders the previous version obsolete.
  256.   This document has grown considerably in size, and to fight that trend,
  257. I'll not discuss it any more.
  258.   It has now been five months since the specs were updated. I won't talk
  259. about that either. I'll just apologize for not releasing updates in late
  260. May and July like I should have. Those updates would have been numbered
  261. 1.4 and 1.5, so perhaps that's why this is version 1.666.
  262.   Here's some of the new or revised sections since the 1.3 specs:
  263.  
  264.     - DOOM 2 info, especially in [4-2-1] and [4-3-2]
  265.     - lots of info on the DOOM.EXE file in [10]
  266.     - BNF style definitions in [A-1]
  267.     - DOOM engine limits in [A-2]
  268.     - the DEMO format [8-6]
  269.     - the ENDOOM lump [8-3]
  270.     - comprehensive list of WAD lumps in [3]
  271.  
  272.     - many parts rewritten for clarity
  273.     - changes in terminology to reflect id's where possible, and to be
  274.     more consistent throughout
  275.     - reformatted again, errors and typos corrected
  276.  
  277.  
  278. -------------------
  279. CHAPTER [2]: Basics
  280. -------------------
  281.  
  282.   The starting point is the concept of "WAD". It is not an acronym, it
  283. just means a collection of data. Throughout this document, "WAD" or "wad"
  284. will mean a file with a .WAD extension that contains data for the doom
  285. engine to use.
  286.   A WAD file has three parts:
  287.  
  288.   (1) a twelve-byte header
  289.   (2) one or more "lumps"
  290.   (3) a directory or "info table" that contains the names, offsets, and
  291.     sizes of all the lumps in the WAD
  292.  
  293.   The header consists of three four-byte parts:
  294.  
  295.     (a) an ASCII string which must be either "IWAD" or "PWAD"
  296.     (b) a 4-byte (long) integer which is the number of lumps in the wad
  297.     (c) a long integer which is the file offset to the start of
  298.       the directory
  299.  
  300.   The directory has one 16-byte entry for every lump. Each entry consists
  301. of three parts:
  302.  
  303.     (a) a long integer, the file offset to the start of the lump
  304.     (b) a long integer, the size of the lump in bytes
  305.     (c) an 8-byte ASCII string, the name of the lump, padded with zeros.
  306.       For example, the "DEMO1" entry in hexadecimal would be
  307.       (44 45 4D 4F 31 00 00 00)
  308.  
  309.   A "lump" is just data, in one of several different formats. Some
  310. contain sound data, some contain graphics data, some contain level
  311. structure data, etc. These specs are mostly concerned with delineating
  312. the formats of the various lump types. There are 10 different types of
  313. map/level lump formats, each has a section in chapter [4] (sections 2-11).
  314. There are 13 other types of lump formats, listed below with the section
  315. where the format is explained, and the actual lump names in parentheses.
  316. Also, Appendix [A-1] has definitions of the structures of all these
  317. WAD elements.
  318.  
  319.   [8-1] palettes (PLAYPAL)
  320.   [8-2] colormaps (COLORMAP)
  321.   [8-3] dos exit text (ENDOOM)
  322.   [8-6] demos (DEMO1, DEMO2, and DEMO3)
  323.   [8-4] texture composition list (TEXTURE1 and TEXTURE2)
  324.   [8-5] wall patch "number for name" indexing list (PNAMES)
  325.   [7-4] midi mapping (GENMIDI)
  326.   [7-5] Gravis UltraSound patch mappings (DMXGUS)
  327.   [7-1] PC speaker sound effects (DP*)
  328.   [7-2] Soundcard sound effects (DS*)
  329.   [7-3] songs (D_*)
  330.   [6]   flats (lumpnames between F_START and F_END)
  331.   [5]   all other graphics (all other lumps)
  332.  
  333.   The "marker" and "label" lump names like "S_START" and "E1M1" (or
  334. "MAP01") do not actually refer to lumps - they have zero length. They
  335. merely serve to mark the beginning or end of a set of related lumps.
  336.  
  337.   It is possible to include other directory entries and lumps in a wad
  338. file, e.g. an entry called CLOWNS could point to a lump that includes the
  339. level creator's name, date of completion, and the latitude and longitude
  340. of the Holy Grail. None of these non-standard entries will be used by
  341. DOOM, nor will they cause it problems.
  342.  
  343.  
  344. [2-1]: Pwads
  345. ============
  346.  
  347.   There are two types of wad files. The original DOOM.WAD and DOOM2.WAD
  348. files are "IWAD"s, or "Internal wads", meaning they contain all of the
  349. data necessary to play. The other type is the "PWAD" file, "Patch wad",
  350. an external file which has the same structure, but with far fewer entries
  351. in the directory. The data in a pwad is substituted for the original data
  352. in the DOOM.WAD, thus allowing for much easier distribution of new levels.
  353. Only those resources listed in the pwad's directory are changed,
  354. everything else is loaded from the IWAD. All external wads should have
  355. the "PWAD" indicator, as id has requested.
  356.   A typical pwad might contain new data for a single level, in which
  357. case it would contain the 10 lumps and 11 directory entries necessary
  358. to define the level (as described in chapter [4]).
  359.   A pwad file may contain more than one level or parts of levels, in
  360. addition to replacement graphics, sounds, etc. (as of version 1.666,
  361. sprites and flats do NOT work from pwads - see chapter [5] for more).
  362. In fact, there is apparently no limit to how many entries may be in a
  363. pwad. The original doom levels are pretty complicated, and they are
  364. from 50-200 kilobytes each in size, uncompressed.
  365.   Pwad files need to have the extension .WAD to work. Many of them have
  366. descriptive names, e.g. if J.R.R. Tolkien made a new level, he might call
  367. it GONDOLIN.WAD - to use this level, a player would type
  368.  
  369.   DOOM -FILE GONDOLIN.WAD
  370.  
  371. at the command line, along with any other parameters. More than one
  372. external file can be added, thus in general:
  373.  
  374.   DOOM -FILE [pwad_filename] [pwad_filename] [pwad_filename] ...
  375.  
  376.   If there are duplicate entries amongst the directories of all the
  377. wads being "added", the pwads listed LAST take precedence.
  378.   When the game loads, a "modified game" message will appear if there
  379. are any pwads involved, reminding the player that id Software will not
  380. give technical support or answer questions regarding modified levels.
  381.   With DOOM version 1.666, there is also the @responsefile option for
  382. listing command line parameters and -file specifications. See the DOOM
  383. README or the latest FAQ for more information. Also, there are numerous
  384. "front-end" utilities that make it easier to play pwads, e.g. load several
  385. external files at once, warp to certain levels, specify options, etc.
  386.  
  387.  
  388. [2-2]: DOOM versions
  389. ====================
  390.  
  391. Version Date    Time    Is
  392.  
  393. 1.0     10dec93 01:00   first release (aka DOOM Operating System 0.99)
  394. 1.1     16dec93 01:10   slightly different from 1.0, newer dos extender
  395. 1.2     17feb94 01:20   modem play added!
  396. 1.3     -       -       unauthorized beta release
  397. 1.4     28jun94 01:04   shareware beta
  398. 1.5     ??jul94 ?       shareware beta
  399. 1.6     03aug94 01:06   shareware beta
  400. 1.666   01sep94 16:42   registered full upgrade!
  401. 1.666   ?       ?       DOOM 2!
  402.  
  403.   The important releases as of this writing are 1.2 and 1.666. Hopefully,
  404. everyone will move up to 1.666 soon; it has many important improvements
  405. over 1.2. The 1.4, 1.5, and 1.6 shareware betas contained increasing
  406. amounts of the stuff that's now in 1.666, but there's no information
  407. here about what exactly those changes were. One, I didn't keep track,
  408. and two, they're not really important.
  409.   See appendix [A-3] for some miscellany about what has changed from
  410. version to version.
  411.  
  412.  
  413. [2-3]: Terminology conventions
  414. ==============================
  415.  
  416.   Throughout this document, I will use the following conventions for
  417. numbers and variable types:
  418.  
  419. (1) Most numbers will be decimal. Hexadecimal numbers will usually be
  420.     labeled thus: 0xffff or $ffff. But sometimes I'll say "hex ...".
  421.     And in tablature form, a column heading "HEX" indicates all the
  422.     numbers in that column are hexadecimal.
  423. (2) "byte" is of course the generic, 8 bits. It will usually mean one
  424.     8-bit component of a larger data type, or an 8-bit ASCII
  425.     character, or some such. As a number, it is an unsigned 8-bit
  426.     integer (0..255).
  427. (3) "short" is a signed 16-bit integer (-32768..32767), stored in
  428.     lo-hi format.
  429. (4) "ushort" or "unsigned short" is an unsigned 16-bit integer (0..65535).
  430. (5) "integer" or "long" is a signed 32-bit integer. If you don't read
  431.     this first, my use of the word "integer" might not be immediately
  432.     apparent.
  433. (6) "string8" or "8-byte string" is an ASCII string with length between
  434.     1 and 8 characters inclusive. If its length is less than 8, the
  435.     remaining bytes are zeros.
  436. (7) The first byte of a file or any data structure, for addressing and
  437.     offset purposes, is byte #0, not byte #1.
  438. (8) Some abbreviations I use: E1, E2, and E3 refer to episodes 1, 2, and
  439.     3 respectively. "The EXE" means the file DOOM.EXE.
  440. (666) Any reference to this number is purely intentional.
  441.  
  442.  
  443. -----------------------------------------------
  444. CHAPTER [3]: List of DOOM.WAD Directory Entries
  445. -----------------------------------------------
  446.  
  447.   There are over 2000 entries in the DOOM.WAD directory. Most of them
  448. can be easily described in groups, and so are not explicitly mentioned
  449. in this list. This includes the sprites (see [4-2-1] for sprite names
  450. and [5] for the sprite lump naming system), the wall patches ([8-4] and
  451. [8-5] have more info), the flats (chapter [6]), the sounds and songs
  452. (chapter [7]), and the map data lumps (chapter [4]). All the others
  453. are listed here.
  454.   There have been several changes from version to version. The "Ver"
  455. column indicates in which doom versions the lump exists:
  456.  
  457. ___     no indication means it is in every version. Most are like this.
  458. 1.1     it was in 1.0 and 1.1, but not in 1.2 and later. It is obsolete.
  459. 1.2     it is not in 1.1 and earlier, only in 1.2 and up.
  460. 1.6     it is not in 1.2 and earlier, only in 1.666 and up.
  461. r       it is only in the registered version, not the shareware.
  462. 1       it is only in DOOM 1, it is not in DOOM 2.
  463. 2       it is only in DOOM 2, it is not in DOOM 1.
  464.  
  465.   In the lump names, x (and y and e) indicates variable ASCII
  466. characters, and * can be replaced by an ASCII string (up to the
  467. 8-byte lumpname limit).
  468.  
  469. LumpName  Ver   Description
  470. --------  ---   -----------
  471. PLAYPAL         fourteen 256 color palettes. See [8-1].
  472. COLORMAP        maps colors in the palette down to darker ones. [8-2].
  473. ENDOOM          text message displayed when you exit to DOS. [8-3].
  474. DEMOx           x=1-3, are the demos. [8-6].
  475. ExMy            subsequent entries define a single level's data. [4].
  476. MAPxy     2     like ExMy, but for DOOM 2.
  477. TEXTURE1        list of wall texture names and their composition data,
  478.           used in the SIDEDEF portion of each level. [8-4].
  479. TEXTURE2  r     more wall texture compositions.
  480. PNAMES          lists all lump names used as wall patches. [8-5].
  481. GENMIDI         General Midi standard instrument data. [7-3].
  482. DMXGUS          Gravis Ultra Sound instrument patches. [7-4].
  483.  
  484. D_ExMy          music for a doom 1 level. [7-2].
  485. D_INTER         music played on the summary screen between levels.
  486. D_INTRO         music played when the game starts.
  487. D_INTROA  1.2   more introductory music.
  488. D_VICTOR        music played on the victory text-screen after an episode.
  489. D_BUNNY   r     music for while a certain rabbit has his story told...
  490. D_*       2     music for a doom 2 level.
  491.  
  492. DP_*      vary  PC speaker sound effects. [7-1].
  493. DS_*      vary  Soundcard sound effects. [7-1].
  494.  
  495.   All the remaining entries in the directory, except the flats between
  496. F_START and F_END, and the "markers" like S_START, refer to lumps which
  497. are pictures, in the doom/wad graphic format described in chapter [5].
  498. The flats are also pictures, but in a format described in chapter [6].
  499.   The next seven are full screen (320 by 200 pixel) pictures. After
  500. that, ST* are status-bar pictures, WI* are for the screens between
  501. levels, and M_* are for menus.
  502.  
  503. HELP1           Ad-screen says Register!, with some screen shots.
  504. HELP2           Actual help, all the controls explained.
  505. TITLEPIC        Maybe this is the title screen? Gee, I dunno...
  506. CREDIT          People at id Software who created this great game.
  507. VICTORY2  r     Screen shown after a victorious end to episode 2.
  508. PFUB1     r     A nice little rabbit minding his own peas and queues...
  509. PFUB2     r     ...a hint of what's waiting in Doom 2.
  510.  
  511. ENDx      r     x=0-6, big red "THE END" gets shot up.
  512. AMMNUMx         x=0-9. Small grey digits for ammo count (15/200 etc).
  513. STxBARy   1.1   x=M or A, y= L or R. Status bar used to be in pieces.
  514. STCHAT    1.1   Status bar used to have a "chat" box.
  515. STRSNUMx  1.1   x=0-9. Small red digits.
  516. STWEAPx   1.1   x=0-5. COOL little weapon icons. Why'd they drop them?
  517. STFRAGS   1.1   Tiny "FRAG" to be placed on top of part of status bar.
  518. STBAR     1.2   Status Bar as used in deathmatches.
  519. STGNUMx         x=0-9. Small grey digits used on the "Arms" panel.
  520. STTNUMx         x=0-9. Big red digits used for Armor, Health, etc.
  521. STTMINUS  1.6   Big red "-" used for negative frags.
  522. STYSNUMx        x=0-9. Small yellow digits used on the "Arms" panel.
  523. STTPRCNT        Big red % used in Armor and Health.
  524. STKEYSx         x=0-5. Blue/Yellow/Red Keycards and Skullkeys.
  525. STDISK          Disk, used at bottom right corner during disk accesses.
  526. STCDROM   1.6   CD, used during CD-ROM accesses.
  527. STARMS          "Arms" panel which replaces "Frags" in non-deathmatch.
  528. STCFNxxx        xxx=033-095, also 121. Small red ASCII characters.
  529. STFBx           x=0-3. Green/black/brown/red squares, for ST player faces.
  530. STPBx           x=0-3. Squares with bottoms, for inter-level screens.
  531. STFSTxy         x=0-4, y=0-2. Player face. x=0 is 100% health...x=4 is
  532.           very low health. y=0 is glancing right, y=2 left.
  533. STFTLx0         x=0-4. Face looking left, player hurt from that direction.
  534. STFTRx0         x=0-4. Face looking right.
  535. STFOUCHx        x=0-4. Face looking surprised (hurt bad).
  536. STFEVLx         x=0-4. Face with a grin (when pick up new weapons).
  537. STFKILLx        x=0-4. Face with a grimace (when killing foes).
  538. STFGOD0         Face with yellow eyes (invulnerable).
  539. STFDEAD0        Dead face.
  540. BRDR_*          Tiny pictures used as a border between a less-than-full
  541.           screen view and the "outside" marbleized zone. TL is
  542.           top left, BR bottom right, you can guess the rest.
  543. WIBONUS   1.1   Medium sized red text "BONUS"
  544. WISCORE   1.1   "SCORE"
  545. WIMSTPx   1.1   x=0-3. Red text "ONE" to "FOUR".
  546. WIMSTBx   1.1   x=0-3. Grey text "ONE" to "FOUR".
  547. WIMINUS   1.6   Small red "-" used for negative frags.
  548. WIMAPx          x=0-2. 320x200 maps used on inter-level screens for e1,2,3.
  549. WIAe0x0y        patches used to animate inter-level maps.
  550. WIURH0          "YOU ARE HERE" with an arrow pointing left.
  551. WIURH1          "YOU ARE HERE" with an arrow pointing right.
  552. WISPLAT         Splat mark that indicates a completed level.
  553. WIOSTK          "KILLS"
  554. WIOSTI          "ITEMS"
  555. WIF             "FINISHED"
  556. WIMSTT          "TOTAL"
  557. WIOSTS          "SCRT"
  558. WIOSTF          "F."
  559. WITIME          "TIME"
  560. WIPAR           "PAR"
  561. WIMSTAR         "YOU"
  562. WIPCNT          "%"
  563. WINUMx          x=0-9. Medium sized red digits.
  564. WICOLON         ":"
  565. WISUCKS         "SUCKS"
  566. WIFRGS          "FRAGS"
  567. WILVxy          x=0-2, y=0-8. E(x+1)M(y+1) level names in grey/white letters.
  568. WIPx            x=1-4. Red "P1" - "P4", for multiplayer summaries.
  569. WIBPx           x=1-4. Grey "P1" - "P4"
  570. WIKILRS         Small red "KILLERS" going sideways up, for deathmatches.
  571. WIVCTMS         Small red "VICTIMS" for the top of the deathmatch chart.
  572. WISCRT2         "SECRET"
  573. WIENTER         "ENTERING"
  574. M_DOOM          The DOOM logo
  575. M_RDTHIS        Big red "Read This!"
  576. M_OPTION        "Options"
  577. M_QUITG         "Quit Game"
  578. M_NGAME         "New Game"
  579. M_SKULL1        The skull indicator with eyes lit.
  580. M_SKULL2        The skull indicator with eyes unlit.
  581. M_THERMO        The marker on e.g. the Sfx volume "thermometer".
  582. M_THERMR        The right end of the thermometer.
  583. M_THERML        The left end.
  584. M_THERMM        The middle, repeated over and over.
  585. M_ENDGAM        "End Game"
  586. M_PAUSE         "Pause"
  587. M_MESSG         "Messages:"
  588. M_MSGON         "on"
  589. M_MSGOFF        "off"
  590. M_EPISOD        "Which Epsiode?"
  591. M_EPI1          "Knee-Deep In The Dead"
  592. M_EPI2          "The Shores Of Hell"
  593. M_EPI3          "Inferno"
  594. M_HURT          "Hurt me plenty."
  595. M_JKILL         "I'm too young to die."
  596. M_ROUGH         "Hey, not too rough."
  597. M_SKILL         "Choose Skill Level:"
  598. M_NEWG          "NEW GAME" (title of New Game menu)
  599. M_ULTRA         "Ultra-Violence."
  600. M_NMARE   1.2   "Nightmare!"
  601. M_SVOL          "Sound Volume"
  602. M_OPTTTL        "OPTIONS" (title of Options menu)
  603. M_SAVEG         "Save Game"
  604. M_LOADG         "Load Game"
  605. M_DISP          "Display"
  606. M_MSENS         "Mouse sensitivity"
  607. M_GDHIGH        "high"
  608. M_GDLOW         "low"
  609. M_DETAIL        "Graphic Detail:"
  610. M_DISOPT        "DISPLAY OPTIONS"
  611. M_SCRNSZ        "Screen Size"
  612. M_SGTTL         "SAVE GAME"
  613. M_LGTTL         "LOAD GAME"
  614. M_SFXVOL        "Sfx Volume"
  615. M_MUSVOL        "Music Volume"
  616. M_LSLEFT        Load/save box, left part
  617. M_LSCNTR        Load/save box, center part (repeated)
  618. M_LSRGHT        Load/save box, right part
  619.  
  620.   The following entries are markers that do not point to a lump; they
  621. have zero size:
  622.  
  623. S_START         marks the start of the item/monster "sprite" section.
  624.           See chapter [5] for the naming convention used here.
  625. S_END           is immediately after the last sprite.
  626. P_START         marks the beginning of the wall patches.
  627. P1_START          before the first of the shareware wall patches.
  628. P1_END            after the last of the shareware wall patches.
  629. P2_START  r       registered wall patches.
  630. P2_END    r       registered wall patches.
  631. P_END           marks the end of the wall patches.
  632. F_START         marks the beginning of the flats (floor textures).
  633. F1_START          shareware flats.
  634. F1_END            shareware flats.
  635. F2_START  r       registered flats.
  636. F2_END    r       registered flats.
  637. F_END           marks the end of the flats.
  638.  
  639.  
  640. -----------------------
  641. CHAPTER [4]: The Levels
  642. -----------------------
  643.  
  644.   Each level has eleven directory entries and ten lumps: E[x]M[y] (or
  645. MAPxy in a DOOM 2 wad), THINGS, LINEDEFS, SIDEDEFS, VERTEXES, SEGS,
  646. SSECTORS, NODES, SECTORS, REJECT, and BLOCKMAP.
  647.   In the DOOM.WAD file, all of these entries are present for every level.
  648. In a pwad external file, they don't all need to be present. Whichever
  649. entries are in a pwad will be substituted for the originals. For example,
  650. a pwad with just two entries, E3M6 and THINGS, would use all the walls
  651. and such from the original E3M6, but could have a completely different
  652. set of THINGS.
  653.  
  654.  
  655. [4-1]: ExMy or MAPxy
  656. ====================
  657.  
  658.   DOOM 1 levels have an ExMy label in a wad's directory. x is a single
  659. (ASCII) digit 1-3 for the episode number and y is 1-9 for the mission
  660. number.
  661.   DOOM 2 levels have a MAPxy label in a wad's directory. xy can range
  662. from (ASCII) 01 to 32, for the level number.
  663.   This label just indicates that the lump names following it are part
  664. of the designated level. The label does not actually point to a lump,
  665. and the size field in the directory is 0. The assignment of lumps to
  666. this level stops with either the next ExMy or MAPxy entry, or with a
  667. non-map entry like TEXTURE1.
  668.   Without these labels, there would be no way to differentiate amongst
  669. the many lumps named "THINGS", "LINEDEFS", etc.
  670.  
  671.  
  672. [4-2]: THINGS
  673. =============
  674.  
  675.   "Things" in DOOM are player start positions, monsters, weapons, keys,
  676. barrels, etc. The size of each THINGS lump will be a multiple of ten,
  677. since each thing requires ten bytes to describe it, in five <short>
  678. fields:
  679.  
  680. (1) X position of thing (at level's inception)
  681. (2) Y position of thing
  682. (3) Angle the thing faces. On the automap, 0 is east, 90 is north, 180
  683.       is west, 270 is south. This value is only used for monsters, player
  684.       starts, deathmatch starts, and teleporter landing spots. Other
  685.       things look the same from all directions. Values are rounded to
  686.       the nearest 45 degree angle, so if the value is 80, it will
  687.       actually face 90 - north.
  688. (4) Type of thing, see next subsection, [4-2-1]
  689. (5) Thing options, see [4-2-3]
  690.  
  691.  
  692. [4-2-1]: Thing Types
  693. --------------------
  694.  
  695.   Short 4 of 5, occupying bytes 6-7 of each thing record, specifies its
  696. kind. The table below summarizes the different types. They are listed
  697. in functional groups. You can easily get a numerical-order list by
  698. extracting this table and SORTing it.
  699.  
  700. Dec/Hex The thing's number in decimal and hexadecimal. This is the
  701.       number used in the THINGS lump on a level (ExMy or MAPxx).
  702. V       Version of DOOM needed to use this object:
  703.       no mark indicates all versions have this object
  704. r         requires registered DOOM or DOOM 2
  705. 2         requires DOOM 2
  706. Spr     The sprite name associated with this thing. This is the first
  707.       four letters of the lumps that are pictures of this thing.
  708. seq.    The sequence of frames displayed. "-" means it displays nothing.
  709.       Unanimated things will have just an "a" here, e.g. a backpack's
  710.       only picture can be found in the wad under BPAKA0. Animated
  711.       things will show the order that their frames are displayed
  712.       (they cycle back after the last one). So the blue key
  713.       alternates between BKEYA0 and BKEYB0. The soulsphere uses
  714.       SOULA0-SOULB0-C0-D0-C0-B0 then repeats. Thing 15, a dead
  715.       player, is PLAYN0.
  716. +       Monsters and players and barrels. They can be hurt, and they
  717.       have a more complicated sprite arrangement. See chapter [5].
  718. CAPITAL Monsters, counts toward the KILL ratio at the end of a level.
  719. #       An obstacle, players and monsters can't move through it.
  720. ^       Hangs from the ceiling, or floats (if a monster).
  721. $       A regular item that players may get.
  722. !       An artifact item; counts toward the ITEM ratio at level's end.
  723.       Note that 2025, the radiation suit, was an ITEM in version
  724.       1.2, but it is not an ITEM in version 1.666 on. Also note
  725.       that 2022 and 2024, invulnerability and invisibility, do not
  726.       respawn in -altdeath games.
  727.  
  728. Dec. Hex  V Spr  seq.     Thing is:
  729.  
  730.   -1 ffff   ---- -        (nothing)
  731.    0 0000   ---- -        (nothing)
  732.    1 0001   PLAY +        Player 1 start (Player 1 start needed on ALL
  733. levels)
  734.    2 0002   PLAY +        Player 2 start (Player starts 2-4 are needed in)
  735.    3 0003   PLAY +        Player 3 start (cooperative mode multiplayer games)
  736.    4 0004   PLAY +        Player 4 start
  737.   11 000b   ---- -        Deathmatch start positions. Should have >= 4/level
  738.   14 000e   ---- -        Teleport landing. Where players/monsters land when
  739.   14                        they teleport to the SECTOR containing this thing
  740.  
  741. 3004 0bbc   POSS +      # FORMER HUMAN: regular pistol-shooting zombieman
  742.   84 0054 2 SSWV +      # WOLFENSTEIN SS: guest appearance by Wolf3D blue guy
  743.    9 0009   SPOS +      # FORMER HUMAN SERGEANT: black armor, shotgunners
  744.   65 0041 2 CPOS +      # HEAVY WEAPON DUDE: red armor, chaingunners
  745. 3001 0bb9   TROO +      # IMP: brown, hurl fireballs
  746. 3002 0bba   SARG +      # DEMON: pink, muscular bull-like chewers
  747.   58 003a   SARG +      # SPECTRE: invisible version of the DEMON
  748. 3006 0bbe r SKUL +     ^# LOST SOUL: flying flaming skulls, they really bite
  749. 3005 0bbd r HEAD +     ^# CACODEMON: red one-eyed floating heads. Behold...
  750.   69 0045 2 BOS2 +      # HELL KNIGHT: grey-not-pink BARON, weaker
  751. 3003 0bbb   BOSS +      # BARON OF HELL: cloven hooved minotaur boss
  752.   68 0044 2 BSPI +      # ARACHNOTRON: baby SPIDER, shoots green plasma
  753.   71 0047 2 PAIN +     ^# PAIN ELEMENTAL: shoots LOST SOULS, deserves its
  754. name
  755.   66 0042 2 SKEL +      # REVENANT: Fast skeletal dude shoots homing missles
  756.   67 0043 2 FATT +      # MANCUBUS: Big, slow brown guy shoots barrage of
  757. fire
  758.   64 0040 2 VILE +      # ARCH-VILE: Super-fire attack, ressurects the dead!
  759.    7 0007 r SPID +      # SPIDER MASTERMIND: giant walking brain boss
  760.   16 0010 r CYBR +      # CYBER-DEMON: robo-boss, rocket launcher
  761.  
  762.   88 0058 2 BBRN +      # BOSS BRAIN: Horrifying visage of the ultimate demon
  763.   89 0059 2 -    -        Boss Shooter: Shoots spinning skull-blocks
  764.   87 0057 2 -    -        Spawn Spot: Where Todd McFarlane's guys appear
  765.  
  766. 2005 07d5   CSAW a      $ Chainsaw
  767. 2001 07d1   SHOT a      $ Shotgun
  768.   82 0052 2 SGN2 a      $ Double-barreled shotgun
  769. 2002 07d2   MGUN a      $ Chaingun, gatling gun, mini-gun, whatever
  770. 2003 07d3   LAUN a      $ Rocket launcher
  771. 2004 07d4 r PLAS a      $ Plasma gun
  772. 2006 07d6 r BFUG a      $ Bfg9000
  773. 2007 07d7   CLIP a      $ Ammo clip
  774. 2008 07d8   SHEL a      $ Shotgun shells
  775. 2010 07da   ROCK a      $ A rocket
  776. 2047 07ff r CELL a      $ Cell charge
  777. 2048 0800   AMMO a      $ Box of Ammo
  778. 2049 0801   SBOX a      $ Box of Shells
  779. 2046 07fe   BROK a      $ Box of Rockets
  780.   17 0011 r CELP a      $ Cell charge pack
  781.    8 0008   BPAK a      $ Backpack: doubles maximum ammo capacities
  782.  
  783. 2011 07db   STIM a      $ Stimpak
  784. 2012 07dc   MEDI a      $ Medikit
  785. 2014 07de   BON1 abcdcb ! Health Potion +1% health
  786. 2015 07df   BON2 abcdcb ! Spirit Armor +1% armor
  787. 2018 07e2   ARM1 ab     $ Green armor 100%
  788. 2019 07e3   ARM2 ab     $ Blue armor 200%
  789.   83 0053 2 MEGA abcd   ! Megasphere: 200% health, 200% armor
  790. 2013 07dd   SOUL abcdcb ! Soulsphere, Supercharge, +100% health
  791. 2022 07e6 r PINV abcd   ! Invulnerability
  792. 2023 07e7 r PSTR a      ! Berserk Strength and 100% health
  793. 2024 07e8   PINS abcd   ! Invisibility
  794. 2025 07e9   SUIT a     (!)Radiation suit - see notes on ! above
  795. 2026 07ea   PMAP abcdcb ! Computer map
  796. 2045 07fd   PVIS ab     ! Lite Amplification goggles
  797.  
  798.    5 0005   BKEY ab     $ Blue keycard
  799.   40 0028 r BSKU ab     $ Blue skullkey
  800.   13 000d   RKEY ab     $ Red keycard
  801.   38 0026 r RSKU ab     $ Red skullkey
  802.    6 0006   YKEY ab     $ Yellow keycard
  803.   39 0027 r YSKU ab     $ Yellow skullkey
  804.  
  805. 2035 07f3   BAR1 ab+    # Barrel; not an obstacle after blown up
  806.                 (BEXP sprite)
  807.   72 0048 2 KEEN a+     # A guest appearance by Billy
  808.  
  809.   48 0030   ELEC a      # Tall, techno pillar
  810.   30 001e r COL1 a      # Tall green pillar
  811.   32 0020 r COL3 a      # Tall red pillar
  812.   31 001f r COL2 a      # Short green pillar
  813.   36 0024 r COL5 ab     # Short green pillar with beating heart
  814.   33 0021 r COL4 a      # Short red pillar
  815.   37 0025 r COL6 a      # Short red pillar with skull
  816.   47 002f r SMIT a      # Stalagmite: small brown pointy stump
  817.   43 002b r TRE1 a      # Burnt tree: gray tree
  818.   54 0036 r TRE2 a      # Large brown tree
  819.  
  820. 2028 07ec   COLU a      # Floor lamp
  821.   85 0055 2 TLMP abcd   # Tall techno floor lamp
  822.   86 0056 2 TLP2 abcd   # Short techno floor lamp
  823.   34 0022   CAND a        Candle
  824.   35 0023   CBRA a      # Candelabra
  825.   44 002c r TBLU abcd   # Tall blue firestick
  826.   45 002d r TGRE abcd   # Tall green firestick
  827.   46 002e   TRED abcd   # Tall red firestick
  828.   55 0037 r SMBT abcd   # Short blue firestick
  829.   56 0038 r SMGT abcd   # Short green firestick
  830.   57 0039 r SMRT abcd   # Short red firestick
  831.   70 0046 2 FCAN abc    # Burning barrel
  832.  
  833.   41 0029 r CEYE abcb   # Evil Eye: floating eye in symbol, over candle
  834.   42 002a r FSKU abc    # Floating Skull: flaming skull-rock
  835.  
  836.   49 0031 r GOR1 abcb  ^# Hanging victim, twitching
  837.   63 003f r GOR1 abcb  ^  Hanging victim, twitching
  838.   50 0032 r GOR2 a     ^# Hanging victim, arms out
  839.   59 003b r GOR2 a     ^  Hanging victim, arms out
  840.   52 0034 r GOR4 a     ^# Hanging pair of legs
  841.   60 003c r GOR4 a     ^  Hanging pair of legs
  842.   51 0033 r GOR3 a     ^# Hanging victim, 1-legged
  843.   61 003d r GOR3 a     ^  Hanging victim, 1-legged
  844.   53 0035 r GOR5 a     ^# Hanging leg
  845.   62 003e r GOR5 a     ^  Hanging leg
  846.   73 0049 2 HDB1 a     ^# Hanging victim, guts removed
  847.   74 004a 2 HDB2 a     ^# Hanging victim, guts and brain removed
  848.   75 004b 2 HDB3 a     ^# Hanging torso, looking down
  849.   76 004c 2 HDB4 a     ^# Hanging torso, open skull
  850.   77 004d 2 HDB5 a     ^# Hanging torso, looking up
  851.   78 004e 2 HDB6 a     ^# Hanging torso, brain removed
  852.  
  853.   25 0019 r POL1 a      # Impaled human
  854.   26 001a r POL6 ab     # Twitching impaled human
  855.   27 001b r POL4 a      # Skull on a pole
  856.   28 001c r POL2 a      # 5 skulls shish kebob
  857.   29 001d r POL3 ab     # Pile of skulls and candles
  858.   10 000a   PLAY w        Bloody mess (an exploded player)
  859.   12 000c   PLAY w        Bloody mess, this thing is exactly the same as 10
  860.   24 0018   POL5 a        Pool of blood and flesh
  861.   79 004f 2 POB1 a        Pool of blood
  862.   80 0050 2 POB2 a        Pool of blood
  863.   81 0051 2 BRS1 a        Pool of brains
  864.   15 000f   PLAY n        Dead player
  865.   18 0012   POSS l        Dead former human
  866.   19 0013   SPOS l        Dead former sergeant
  867.   20 0014   TROO m        Dead imp
  868.   21 0015   SARG n        Dead demon
  869.   22 0016 r HEAD l        Dead cacodemon
  870.   23 0017 r SKUL k        Dead lost soul, invisible
  871.                   (they blow up when killed)
  872.  
  873.  
  874. [4-2-2]: Thing Sizes
  875. --------------------
  876.  
  877.   The list below gives the radius, height, mass, speed, and toughness
  878. of all the monsters in DOOM 1 and 2. Almost all non-monster things only
  879. differ in their "radius", dependent on whether they are obstacles or not.
  880. For collision purposes, things are NOT circular. They occupy a square
  881. whose side equals slightly more than 2 times the radius. This square
  882. does not turn, it is always aligned with the x and y axes of a level.
  883. Consider a simple collision detection in a coordinate plane:
  884.  
  885.     IF (ABS(x1-x2) =< (r1+r2)) AND (ABS(y1-y2) =< (r1+r2)) THEN *collision*
  886.  
  887.   This will result in square objects centered on their (x,y) positions,
  888. and that is the behavior that DOOM objects exhibit.
  889.   I don't know why the horizontal size is "slightly more" than 2 times
  890. the radius, but it is. A player cannot enter a corridor of width 32, but
  891. can enter a corridor of width 33. Experiments have shown that no monster
  892. can enter a corridor that is exactly (2*radius) wide. It must be bigger.
  893. Moving up to the next multiple of 8 is a good idea, if not 16 or 32.
  894.   Monsters CAN enter sectors that are exactly "Height" high. But obstacles
  895. are infinitely high for collision purposes. A player on a very high ledge
  896. might not be able to jump off, because of an obstacle right next to him,
  897. even though it is far below him.
  898.   Height is also used when under a crushing ceiling, and to determine
  899. if an object can move from one sector to another. The space between the
  900. highest floor and the lowest ceiling must be "Height" or greater for the
  901. object to fit.
  902.   Toughness indicates how much punishment a monster can take until it
  903. dies. Bullets do 10 damage, Shotgun shells 70 (7 pellets, each is 10),
  904. Plasma 20, Rockets 100, and the BFG does 1000 for a direct hit. There's
  905. more info on this stuff in the DOOM FAQ.
  906.  
  907. Dec. Hex  Radius Height Mass Tough Speed  Sprite name or class of things:
  908.  
  909. -    -      16     56    100  (100)    -  PLAY
  910. 3004 0bbc   20     56    100    20     8  POSS
  911.   84 0054   20     56    100    50     8  SSWV
  912.    9 0009   20     56    100    30     8  SPOS
  913.   65 0041   20     56    100    70     8  CPOS
  914. 3001 0bb9   20     56    100    60     8  TROO
  915. 3002 0bba   30     56    400   150    10  SARG
  916.   58 003a   30     56    400   150    10  SARG (Inviso model)
  917. 3006 0bbe   16     56     50   100     8  SKUL
  918. 3005 0bbd   31     56    400   400     8  HEAD
  919.   69 0045   24     64   1000   500     8  BOS2
  920. 3003 0bbb   24     64   1000  1000     8  BOSS
  921.   68 0044   64     64    600   500    12  BSPI
  922.   71 0047   31     56    400   400     8  PAIN
  923.   66 0042   20     56    500   300    10  SKEL
  924.   67 0043   48     64   1000   600     8  FATT
  925.   64 0040   20     56    500   700    15  VILE
  926.    7 0007  128    100   1000  3000    12  SPID
  927.   16 0010   40    110   1000  4000    16  CYBR
  928.   88 0058   16     16   6666   250     0  BBRN
  929.   72 0048   16     72   6666   100     0  KEEN
  930. 2035 07f3   10     42    100    20     0  BAR1
  931.    -    -   20     16      -     -     -  most non-obstacles (e.g. gettables)
  932.    -    -   16     16      -     -     -  most obstacles
  933.   54 0036   32     16      -     -     -  large brown tree
  934.  
  935.  
  936. [4-2-3]: Thing Options
  937. ----------------------
  938.  
  939.   Short 5 of 5, occupying bytes 8-9 of each thing record, control a
  940. few options, according to which bits are set:
  941.  
  942. bit 0   the THING is present at skill 1 and 2
  943. bit 1   the THING is present at skill 3 (hurt me plenty)
  944. bit 2   the THING is present at skill 4 and 5 (ultra-violence, nightmare)
  945. bit 3   indicates a deaf guard.
  946. bit 4   means the THING only appears in multiplayer mode.
  947.  
  948. bits 5-15 have no effect.
  949.  
  950.   The skill settings are most used with the monsters, of course...the
  951. most common skill level settings are hex 07/0f (on all skills), 06/0e
  952. (on skill 3-4-5), and 04/0c (only on skill 4-5). Unusual skill settings
  953. are perfectly allowable, e.g. hex 05 for a thing which is present on
  954. skill 1, 2, 4, and 5, but not skill 3.
  955.   "deaf guard" only has meaning for monsters, who will not attack until
  956. they see a player if they are deaf. Otherwise, they will activate when
  957. they hear gunshots, etc. (including the punch!). Sound does not travel
  958. through solid walls (walls that are solid at the time of the noise).
  959. Also, lines can be set so that sound does not pass through them (see
  960. [4-3-1] bit 6). This option is also known as the "ambush" option (or
  961. flag, or attribute).
  962.  
  963.  
  964. [4-3]: LINEDEFS
  965. ===============
  966.  
  967.   Each linedef represents a line from one of the VERTEXES to another,
  968. and each linedef's record is 14 bytes, containing 7 <short> fields:
  969.  
  970. (1) from the VERTEX with this number (the first vertex is 0).
  971. (2) to the VERTEX with this number (31 is the 32nd vertex).
  972. (3) flags, see [4-3-1] below.
  973. (4) types, see [4-3-2] below.
  974. (5) is a "tag" or "trigger" number which ties this line's effect type
  975.       to all SECTORS that have the same tag number (in their last
  976.       field).
  977. (6) number of the "right" SIDEDEF for this linedef.
  978. (7) "left" SIDEDEF, if this line adjoins 2 SECTORS. Otherwise, it is
  979.       equal to -1 (FFFF hex).
  980.  
  981.   "right" and "left" are based on the direction of the linedef as
  982. indicated by the "from" and "to", or "start" and "end", VERTEXES.
  983. This sketch should make it clear:
  984.  
  985.          left side               right side
  986.     start -----------------> end <----------------- start
  987.          right side              left side
  988.  
  989.   IMPORTANT: All lines must have a right side. If it is a one-sided
  990. line, then it must go the proper direction, so its single side is
  991. facing the sector it is part of. DOOM will crash on a level that has
  992. a line with no right side.
  993.  
  994.  
  995. [4-3-1]: Linedef Flags
  996. ----------------------
  997.  
  998.   The third <short> field of each linedef controls some attributes of
  999. that line. These attributes (aka flags) are indicated by bits. If the
  1000. bit is set (equal to 1), the condition is true for that line. If the
  1001. bit is not set (equal to 0), the condition is not true. Note that the
  1002. "unpegged" flags cannot be independently set for the two SIDEDEFs of
  1003. a line. Here's a list of the flags, followed by a discussion of each:
  1004.  
  1005. bit     Condition
  1006.  
  1007. 0       Impassible
  1008. 1       Block Monsters
  1009. 2       Two-sided
  1010. 3       Upper Unpegged
  1011. 4       Lower Unpegged
  1012. 5       Secret
  1013. 6       Block Sound
  1014. 7       Not on Map
  1015. 8       Already on Map
  1016. 9-15    unused
  1017.  
  1018.   0 (Impassible) - Players and monsters cannot cross this line. Note that
  1019. if there is no sector on the other side, they can't go through the line
  1020. anyway, regardless of the flags.
  1021.  
  1022.   1 (Block Monsters) - Monsters cannot cross this line.
  1023.  
  1024.   2 (Two-sided) - The linedef's two sidedefs can have "-" as a texture,
  1025. which in this case means "transparent". If this flag is not set, the
  1026. sidedefs can't be transparent: if "-" is viewed, it will result in the
  1027. "hall of mirrors" effect. However, a linedef CAN have two non-transparent
  1028. sidedefs, even if this flag is not set, as long as it is between two
  1029. sectors.
  1030.   Another side effect of this flag is that if it is set, then gunfire
  1031. (pistol, shotgun, chaingun) can go through it. If this flag is not set,
  1032. gunfire cannot go through the line. Projectiles (rockets, plasma etc.)
  1033. are not restricted this way. They can go through as long as there's a
  1034. sector on the other side (and the sector heights allow it).
  1035.   Finally, monsters can see through and attack through two-sided lines,
  1036. despite any of the line's other flag settings and textures (once again,
  1037. provided sector heights and the REJECT [4-10] allow it).
  1038.  
  1039.   3 (Upper unpegged) - The upper texture is pasted onto the wall from
  1040. the top down instead of from the bottom up like usual.
  1041.   Upper textures normally have the bottom of the wall texture to be
  1042. drawn lined up with the bottom of the "upper" space in which it is
  1043. to be drawn (sidedef Y offsets then apply [4-4]). This can result
  1044. in the upper texture being misaligned with a neighboring "middle"
  1045. texture. To help solve this problem, common at "windows", this flag
  1046. can be set.
  1047.   If the upper texture is unpegged, it is drawn with the wall texture's
  1048. top row at the ceiling, just like middle and lower textures are usually
  1049. drawn. This can help realign the upper texture with a neighbor.
  1050.  
  1051.   The article TEXTURES, cited in appendix [A-4] gives a great deal
  1052. more explanation on the "unpegged" flags and how to use them.
  1053.  
  1054.   4 (Lower unpegged) - Lower and middle textures are drawn from the
  1055. bottom up, instead of from the top down like usual.
  1056.   This is also commonly used on lower textures under "windows". It is
  1057. also used on doorjambs, because when the door opens, the sector ceiling
  1058. is rising, so the "sides" (the doorjambs), which are middle textures,
  1059. will be drawn from the ever-changing ceiling height down, and thus will
  1060. appear to be "moving". Unpegging them will make them be drawn from the
  1061. floor up, and since the floor height doesn't change when a door opens,
  1062. then will not move.
  1063.   There's one slight difference with lower textures being unpegged -
  1064. they are not necessarily drawn with the bottom of the wall texture placed
  1065. at the bottom of the wall. The height of the facing sector and the height
  1066. of the wall texture are taken into account. So if the sector is 160 high,
  1067. and the wall texture is 128 high, then lower unpegged will cause the 32nd
  1068. row of the wall texture to be at the floor, NOT the 128th row. This of
  1069. course excludes sidedef Y offsets, which are applied AFTER unpegged
  1070. flags do their stuff.
  1071.  
  1072.   5 (Secret) - On the automap, this line appears in red like a normal
  1073. solid wall that has nothing on the other side. This is useful in
  1074. protecting secret doors and such. Note that if the sector on the other
  1075. side of this "secret" line has its floor height HIGHER than the sector
  1076. on the facing side of the secret line, then the map will show the lines
  1077. beyond and thus give up the secret.
  1078.   Also note that this flag has NOTHING to do with the SECRETS ratio on
  1079. inter-level screens. That's done with special sector 9 (see [4-9-1]).
  1080.  
  1081.   6 (Block Sound) - For purposes of monsters hearing sounds and thus
  1082. becoming alerted. Every time a player fires a weapon, the "sound" of
  1083. it travels from sector to sector, alerting all non-deaf monsters in
  1084. each new sector. But the sound will die when it hits a second line
  1085. with this flag. The sound can cross one such line, but not two. All
  1086. possible routes for the sound to take are taken, so it can get to
  1087. some out-of-the-way places. Another thing that blocks sound, instantly,
  1088. is incompatible sector heights. Sound can go from a sector with 0/72
  1089. floor/ceiling heights to one with 64/192, but the sound CANNOT go
  1090. from a 0/128 sector to an adjacent 128/256 sector.
  1091.  
  1092.   7 (Not on Map) - The line is not shown on the automap, even if the
  1093. computer all-map power up is acquired.
  1094.  
  1095.   8 (Already on Map) - When the level is begun, this line is already
  1096. on the automap, even though it hasn't been seen (in the display) yet.
  1097. Normally lines only get mapped once part of the line has been seen in
  1098. the display window.
  1099.  
  1100.   Automap line colors: Red lines indicate the line is one-sided, that
  1101. there is a sector on only one side (or the line is marked secret).
  1102. Brown lines are between two sectors with different floor heights but
  1103. the same ceiling height. Yellow lines are between two sectors with
  1104. different ceiling heights and the same or different floor heights.
  1105. Gray lines are as-yet-unseen lines revealed by the computer all-map.
  1106. Without the all-map, lines between sectors with identical floor and
  1107. ceiling heights don't show up. With it, they are gray.
  1108.  
  1109.  
  1110. [4-3-2]: Linedef Types
  1111. ----------------------
  1112.  
  1113.   The <short> in field 4 of 7 of a linedef can control various special
  1114. effects like doors opening, floors moving, etc. Some of them must be
  1115. activated by "using" them, like switches, and some of them are activated
  1116. when they are walked over. There are a huge number of ways to use these
  1117. effects, but it's all done by using one of a hundred or so line function
  1118. types.
  1119.   The most common way they work is this: a player walks across a line
  1120. or activates (presses the spacebar or the use key) right in front of
  1121. a line. That line has a function type that is non-zero. It also has
  1122. a tag number. Then ALL sectors on the level with the same tag number,
  1123. that are not already engaged in some action, undergo the effects that
  1124. the linedef type number dictates. Note that the tag numbers are NOT the
  1125. sector numbers, nor the linedef numbers. A tag number is in a lindef's
  1126. 5th <short> field, and a sector's last <short> field.
  1127.  
  1128. Explanations of all the abbreviations in the table:
  1129.  
  1130. Val     The value of the linedef "type" field (#4). If you want them
  1131.       in numerical order, use SORT or something.
  1132. *       This line function only works in 1.666 and up
  1133. Class   The category of the effect
  1134. Act     Activation. How the linedef's effect is activated.
  1135. n       does NOT require a tag number (see note 5 below)
  1136. W       walk-over activation
  1137. S       switch ("use" - default config is spacebar)
  1138. G       gunfire (pistol, shotgun, chaingun) cross or hit line
  1139. 1       the line may be activated once only
  1140. R       potentially repeatable activation
  1141. &       affected sectors "locked out" from further changes. See notes 9/10.
  1142. m       Monster actions can activate the line's effect
  1143. Sound   The type of noise made by moving sectors
  1144. Speed   How quickly a floor moves up/down etc.
  1145. Tm      Time - how long it "rests"; doors "rest" when they've gone as
  1146.       high as they're going to go, lifts "rest" at the bottom, etc.
  1147. Chg     Change - some of them cause a floor texture change and/or special
  1148.       sector change. See note 11 below.
  1149. T       Trigger model, see note 11 below.
  1150. N       Numeric model, see note 11 below.
  1151. X       Floor texture is transferred, and Sector type 0.
  1152. P       Special Sector types 4, 5, 7, 9, 11, 16 transfer.
  1153. Effect  What happens to the affected sector(s).
  1154. open    The ceiling goes (up) to LEC-4.
  1155. close   The ceiling goes (down) to the floor level.
  1156. up      Will move up at specified speed if the destination is above.
  1157.       If the destination is below, it arrives there instantly.
  1158. down    Will move down at specified speed if the destination is below.
  1159.       If the destination is above, it arrives there instantly.
  1160. open/   The door can be activated while moving. If it's open or opening,
  1161.   close   it closes. If it's closed or closing, it opens, then pauses,
  1162.       then closes.
  1163. open,   The door can only be activated if it is in the closed state.
  1164.   close   It opens, pauses, then closes.
  1165. lift    The floor goes down to LIF, rests, then back up to original height.
  1166. L       lowest
  1167. H       highest
  1168. C       ceiling
  1169. F       floor
  1170. E       adjacent sectors, excluding the affected sector
  1171. I       adjacent sectors, including the affected sector
  1172. nh      next-higher, i.e. LEF that is higher than source.
  1173.  
  1174.   More notes and longer discussions related to these terms:
  1175.  
  1176. 1.  "Adjacent" is any sector that shares a LINEDEF with the tagged sector
  1177. (sectors are adjacent to themselves).
  1178. 2.  All S activations and the teleporters only work from the RIGHT side
  1179. of the linedef.
  1180. 3.  For teleporters, if more than 1 sector is tagged the same and each
  1181. has a teleport landing THING, then the lowest numbered sector is the
  1182. destination.
  1183. 4.  Floors that raise up an absolute height (up 24, 32) will go up INTO
  1184. ceilings, so using the WR and SR types of these in levels is unwise.
  1185. 5.  A few of the linedef types don't require tag numbers: the end-level
  1186. switches, the scrolling wall type 48 (0x30), and the "manual" doors which
  1187. operate on the sector facing the left side of the linedef with the manual
  1188. door line type.
  1189. 666.  Here's the terms id uses for different types of activations:
  1190.     Manual: nSR and nS1 doors
  1191.     Trigger: W1
  1192.     Retrigger: WR
  1193.     Switch: S1
  1194.     Button: SR
  1195.     Impact: G
  1196.     Effect: line 48 is the only one
  1197. 7.  The "moving floors" go up to a maximum of HIF and go down to a minimum
  1198. of LIF. Why they sometimes go up first and sometimes down is still a
  1199. mystery to me.
  1200. 8.  The "crushing ceilings" go from their original ceiling height down
  1201. to (floor + 8), then back up. While crushing a creature, their downward
  1202. speed slows considerably. "Fast hurt" does about 120% total damage per
  1203. crush, and "slow hurt" grabs you and does somewhere around 1000-2000%
  1204. total damage per crush.
  1205. 9.  The & symbol indicates that a sector cannot be affected any more by
  1206. other line types after it has performed this effect, even if it has
  1207. finished. These are the floor-texture-changers and... (keep reading)
  1208. 10. Moving floors and crushing ceilings also "lock out" further changes
  1209. to the sectors affected, EXCEPT for restarting the moving floor or
  1210. crushing ceiling. If a line triggers a type 6 crushing ceiling in a
  1211. sector, then it is stopped, then ANY other line with a "crush" type that
  1212. is tagged to the same sector will cause the type 6 crusher to start
  1213. again, with its original maximum and minimum ceiling heights.
  1214. 11. Some line types cause floor textures and/or some special sector types
  1215. (see [4-9-1]) to transfer to the tagged sector. The tagged sectors' floor
  1216. and/or special sector (SS) type will change to match that of the "model"
  1217. sector. The TRIGGER model gets the info from the sector that the
  1218. activating line's right side faces. The NUMERIC model gets the info
  1219. from the sector on the other side of the lowest numbered two-sided
  1220. linedef that has one side in the tagged sector.
  1221.   All of these "change" line types transfer the floor texture. Also,
  1222. they all can pass a special sector trait of "0" or "nothing", i.e. if
  1223. the destination is an acid-floor or "damaging" sector, then any of these
  1224. lines can erase the damaging effect. Lines 59, 93, 37, 84, and 9 (see
  1225. note 12 for more specifics on line type 9) also have the ability to
  1226. transfer the "secret" trait of SS 9, and the damaging traits of SS
  1227. 4, 5, 7, 11, and 16. None of the "blinking light" effects of SSs can be
  1228. transferred. SS 4 "blinks" and causes damage, but only the damaging part
  1229. can be transferred. SS 11 also turns off god-mode and causes a level END
  1230. when health <11%, this characteristic is part of SS 11, and cannot be
  1231. isolated via fancy transfers.
  1232. 12. Line type 9 is a special one. The definitive example is the chainsaw
  1233. pillar on E1M2. Take the lowest-numbered linedef that has a sidedef in
  1234. the tagged sector. If that linedef is one-sided, nothing happens. If it
  1235. is 2-sided, then the tagged sector's floor will move down to match the
  1236. 2nd sector's floor height (or it will jump instantly up if it was below,
  1237. like other floors that are supposed to move "down").
  1238.   If this 2nd sector CONTAINS the tagged sector, i.e. all the linedefs
  1239. with a sidedef in the tagged sector have their other sidedef in the 2nd
  1240. sector, then this 2nd sector is the "donut". This donut's floor will
  1241. move "up" to match the floor height of the sector on the other side of
  1242. the DONUT's lowest-numbered linedef, excluding those linedefs that are
  1243. shared with the "donut hole" central sector. Also, the donut will undergo
  1244. a floor texture change and special sector type change to match the
  1245. "outside". The donut sector does not have to be completely surrounded
  1246. by another sector (i.e. it can have 1-sided linedefs), but if its
  1247. lowest-numbered linedef is not 2-sided, a minor glitch results: the donut
  1248. and the donut-hole both move to a strange height, and the donut changes
  1249. floor texture to TLITE6_6 - the last flat in the directory.
  1250.   Note that if the donut hole and the donut are both going to move, the
  1251. donut hole is going to move to match the height that the donut is "going
  1252. to". In other words, the whole thing will be at a single height when
  1253. they're done, and this is the height of the "outside" sector that borders
  1254. the donut.
  1255.   Whew!
  1256. 13. Line types 30 and 96, "up ShortestLowerTexture" means that affected
  1257. sector(s) floors go up a number of units equal to the height of the
  1258. shortest "lower" texture facing out from the sector(s).
  1259. 14. STAIRS. Any sector tagged to a stair-raiser line will go up 8. Now
  1260. find the lowest-numbered 2-sided linedef whose RIGHT side faces this
  1261. sector (the first step). The sector on the other side of the lindedef
  1262. becomes the next step, and its floor height changes to be 8 above the
  1263. previous step (it raises up if it was lower, or it changes instantly if
  1264. it was higher). This process continues as long as there are 2-sided
  1265. lines with right sides facing each successive step. A couple things
  1266. will stop the stairway:
  1267.     (a) no 2-sided linedef whose right side faces the current step
  1268.     (b) a sector with a different floor texture
  1269.     (c) a sector that has already been moved by this stairway (this stops
  1270.       ouroboros stairways that circle around to repeat themselves)
  1271.     (d) "locked-out" sectors that can't change their floor height anymore
  1272.   The component steps of a stairway can have any shape or size.
  1273.   The turbo stairs (100, 127) work just like regular stairs except that
  1274. each step goes up 16 not 8, and rising steps can crush things between
  1275. themselves and the ceiling.
  1276. 15. Line types 78 and 85 do NOTHING as of version 1.666.
  1277.  
  1278.  
  1279.  
  1280. Val   Class Act  Sound Speed Tm Chg Effect
  1281.  
  1282. SPECIAL (Continuous effect, doesn't need triggereing)
  1283.  
  1284.  48   Spec  n--  -     -     -  -   Scrolling wall
  1285.  
  1286. LOCAL DOORS ("MANUAL" DOORS)
  1287.  
  1288.   1   mDoor nSRm door  med   4  -   open/close
  1289.  26   mDoor nSR  door  med   4  -   open/close BLUE KEY
  1290.  28   mDoor nSR  door  med   4  -   open/close RED KEY
  1291.  27   mDoor nSR  door  med   4  -   open/close YELLOW KEY
  1292.  31   mDoor nS1  door  med   -  -   open
  1293.  32   mDoor nS1  door  med   -  -   open BLUE KEY
  1294.  33   mDoor nS1  door  med   -  -   open RED KEY
  1295.  34   mDoor nS1  door  med   -  -   open YELLOW KEY
  1296.  46   mDoor nGR  door  med   -  -   open
  1297. 117 * mDoor nSR  blaze turbo 4  -   open/close
  1298. 118 * mDoor nS1  blaze turbo -  -   open
  1299.  
  1300. REMOTE DOORS
  1301.  
  1302.   4   rDoor  W1  door  med   4  -   open,close
  1303.  29   rDoor  S1  door  med   4  -   open,close
  1304.  90   rDoor  WR  door  med   4  -   open,close
  1305.  63   rDoor  SR  door  med   4  -   open,close
  1306.   2   rDoor  W1  door  med   -  -   open
  1307. 103   rDoor  S1  door  med   -  -   open
  1308.  86   rDoor  WR  door  med   -  -   open
  1309.  61   rDoor  SR  door  med   -  -   open
  1310.   3   rDoor  W1  door  med   -  -   close
  1311.  50   rDoor  S1  door  med   -  -   close
  1312.  75   rDoor  WR  door  med   -  -   close
  1313.  42   rDoor  SR  door  med   -  -   close
  1314.  16   rDoor  W1  door  med   30 -   close, then opens
  1315.  76   rDoor  WR  door  med   30 -   close, then opens
  1316. 108 * rDoor  W1  blaze turbo 4  -   open,close
  1317. 111 * rDoor  WR  blaze turbo 4  -   open,close
  1318. 105 * rDoor  S1  blaze turbo 4  -   open,close
  1319. 114 * rDoor  SR  blaze turbo 4  -   open,close
  1320. 109 * rDoor  W1  blaze turbo -  -   open
  1321. 112 * rDoor  S1  blaze turbo -  -   open
  1322. 106 * rDoor  WR  blaze turbo -  -   open
  1323. 115 * rDoor  SR  blaze turbo -  -   open
  1324. 110 * rDoor  W1  blaze turbo -  -   close
  1325. 113 * rDoor  S1  blaze turbo -  -   close
  1326. 107 * rDoor  WR  blaze turbo -  -   close
  1327. 116 * rDoor  SR  blaze turbo -  -   close
  1328. 133 * rDoor  S1  blaze turbo -  -   open BLUE KEY
  1329.  99 * rDoor  SR  blaze turbo -  -   open BLUE KEY
  1330. 135 * rDoor  S1  blaze turbo -  -   open RED KEY
  1331. 134 * rDoor  SR  blaze turbo -  -   open RED KEY
  1332. 137 * rDoor  S1  blaze turbo -  -   open YELLOW KEY
  1333. 136 * rDoor  SR  blaze turbo -  -   open YELLOW KEY
  1334.  
  1335. CEILINGS
  1336.  
  1337.  40   Ceil   W1  mover slow  -  -   up to HEC
  1338.  41   Ceil   S1  mover slow  -  -   down to floor
  1339.  43   Ceil   SR  mover slow  -  -   down to floor
  1340.  44   Ceil   W1  mover slow  -  -   down to floor + 8
  1341.  49   Ceil   S1  mover slow  -  -   down to floor + 8
  1342.  72   Ceil   WR  mover slow  -  -   down to floor + 8
  1343.  
  1344. LIFTS
  1345.  
  1346.  10   Lift   W1  lift  fast  3  -   lift
  1347.  21   Lift   S1  lift  fast  3  -   lift
  1348.  88   Lift   WRm lift  fast  3  -   lift
  1349.  62   Lift   SR  lift  fast  3  -   lift
  1350. 121 * Lift   W1  lift  turbo 3  -   lift
  1351. 122 * Lift   S1  lift  turbo 3  -   lift
  1352. 120 * Lift   WR  lift  turbo 3  -   lift
  1353. 123 * Lift   SR  lift  turbo 3  -   lift
  1354.  
  1355. FLOORS
  1356.  
  1357. 119 * Floor  W1  mover slow  -  -   up to nhEF
  1358. 128 * Floor  WR  mover slow  -  -   up to nhEF
  1359.  18   Floor  S1  mover slow  -  -   up to nhEF
  1360.  69   Floor  SR  mover slow  -  -   up to nhEF
  1361.  22   Floor  W1& mover slow  -  TX  up to nhEF
  1362.  95   Floor  WR& mover slow  -  TX  up to nhEF
  1363.  20   Floor  S1& mover slow  -  TX  up to nhEF
  1364.  68   Floor  SR& mover slow  -  TX  up to nhEF
  1365.  47   Floor  G1& mover slow  -  TX  up to nhEF
  1366.   5   Floor  W1  mover slow  -  -   up to LIC
  1367.  91   Floor  WR  mover slow  -  -   up to LIC
  1368. 101   Floor  S1  mover slow  -  -   up to LIC
  1369.  64   Floor  SR  mover slow  -  -   up to LIC
  1370.  24   Floor  G1  mover slow  -  -   up to LIC
  1371. 130 * Floor  W1  mover turbo -  -   up to nhEF
  1372. 131 * Floor  S1  mover turbo -  -   up to nhEF
  1373. 129 * Floor  WR  mover turbo -  -   up to nhEF
  1374. 132 * Floor  SR  mover turbo -  -   up to nhEF
  1375.  56   Floor  W1& mover slow  -  -   up to LIC - 8, CRUSH
  1376.  94   Floor  WR& mover slow  -  -   up to LIC - 8, CRUSH
  1377.  55   Floor  S1  mover slow  -  -   up to LIC - 8, CRUSH
  1378.  65   Floor  SR  mover slow  -  -   up to LIC - 8, CRUSH
  1379.  58   Floor  W1  mover slow  -  -   up 24
  1380.  92   Floor  WR  mover slow  -  -   up 24
  1381.  15   Floor  S1& mover slow  -  TX  up 24
  1382.  66   Floor  SR& mover slow  -  TX  up 24
  1383.  59   Floor  W1& mover slow  -  TXP up 24
  1384.  93   Floor  WR& mover slow  -  TXP up 24
  1385.  14   Floor  S1& mover slow  -  TX  up 32
  1386.  67   Floor  SR& mover slow  -  TX  up 32
  1387. 140 * Floor  S1  mover med   -  -   up 512
  1388.  30   Floor  W1  mover slow  -  -   up ShortestLowerTexture
  1389.  96   Floor  WR  mover slow  -  -   up ShortestLowerTexture
  1390.  38   Floor  W1  mover slow  -  -   down to LEF
  1391.  23   Floor  S1  mover slow  -  -   down to LEF
  1392.  82   Floor  WR  mover slow  -  -   down to LEF
  1393.  60   Floor  SR  mover slow  -  -   down to LEF
  1394.  37   Floor  W1  mover slow  -  NXP down to LEF
  1395.  84   Floor  WR  mover slow  -  NXP down to LEF
  1396.  19   Floor  W1  mover slow  -  -   down to HEF
  1397. 102   Floor  S1  mover slow  -  -   down to HEF
  1398.  83   Floor  WR  mover slow  -  -   down to HEF
  1399.  45   Floor  SR  mover slow  -  -   down to HEF
  1400.  36   Floor  W1  mover fast  -  -   down to HEF + 8
  1401.  71   Floor  S1  mover fast  -  -   down to HEF + 8
  1402.  98   Floor  WR  mover fast  -  -   down to HEF + 8
  1403.  70   Floor  SR  mover fast  -  -   down to HEF + 8
  1404.   9   Floor  S1  mover slow  -  NXP donut (see note 12 above)
  1405.  
  1406. STAIRS
  1407.  
  1408.   8   Stair  W1  mover slow  -  -   stairs
  1409.   7   Stair  S1  mover slow  -  -   stairs
  1410. 100 * Stair  W1  mover turbo -  -   stairs (each up 16 not 8) + crush
  1411. 127 * Stair  S1  mover turbo -  -   stairs (each up 16 not 8) + crush
  1412.  
  1413. MOVING FLOORS
  1414.  
  1415.  53   MvFlr  W1& lift  slow  3  -   start moving floor
  1416.  54   MvFlr  W1& -     -     -  -   stop moving floor
  1417.  87   MvFlr  WR& lift  slow  3  -   start moving floor
  1418.  89   MvFlr  WR& -     -     -  -   stop moving floor
  1419.  
  1420. CRUSHING CEILINGS
  1421.  
  1422.   6   Crush  W1& crush med   0  -   start crushing, fast hurt
  1423.  25   Crush  W1& crush med   0  -   start crushing, slow hurt
  1424.  73   Crush  WR& crush slow  0  -   start crushing, slow hurt
  1425.  77   Crush  WR& crush med   0  -   start crushing, fast hurt
  1426.  57   Crush  W1& -     -     -  -   stop crush
  1427.  74   Crush  WR& -     -     -  -   stop crush
  1428. 141 * Crush  W1& none? slow  0  -   start crushing, slow hurt "Silent"
  1429.  
  1430. EXIT LEVEL
  1431.  
  1432.  11   Exit  nS-  clunk -     -  -   End level, go to next level
  1433.  51   Exit  nS-  clunk -     -  -   End level, go to secret level
  1434.  52   Exit  nW-  clunk -     -  -   End level, go to next level
  1435. 124 * Exit  nW-  clunk -     -  -   End level, go to secret level
  1436.  
  1437. TELEPORT
  1438.  
  1439.  39   Telpt  W1m tport -     -  -   Teleport
  1440.  97   Telpt  WRm tport -     -  -   Teleport
  1441. 125 * Telpt  W1m tport -     -  -   Teleport monsters only
  1442. 126 * Telpt  WRm tport -     -  -   Teleport monsters only
  1443.  
  1444. LIGHT
  1445.  
  1446.  35   Light  W1  -     -     -  -   0
  1447. 104   Light  W1  -     -     -  -   LE (light level)
  1448.  12   Light  W1  -     -     -  -   HE (light level)
  1449.  13   Light  W1  -     -     -  -   255
  1450.  79   Light  WR  -     -     -  -   0
  1451.  80   Light  WR  -     -     -  -   HE (light level)
  1452.  81   Light  WR  -     -     -  -   255
  1453.  17   Light  W1  -     -     -  -   Light blinks (see [4-9-1] type 3)
  1454. 138 * Light  SR  clunk -     -  -   255
  1455. 139 * Light  SR  clunk -     -  -   0
  1456.  
  1457.  
  1458. [4-4]: SIDEDEFS
  1459. ===============
  1460.  
  1461.   A sidedef is a definition of what wall texture(s) to draw along a
  1462. LINEDEF, and a group of sidedefs outline the space of a SECTOR.
  1463.   There will be one sidedef for a line that borders only one sector
  1464. (and it must be the RIGHT side, as noted in [4-3]). It is not
  1465. necessary to define what the doom player would see from the other
  1466. side of that line because the doom player can't go there. The doom
  1467. player can only go where there is a sector.
  1468.   Each sidedef's record is 30 bytes, comprising 2 <short> fields, then
  1469. 3 <8-byte string> fields, then a final <short> field:
  1470.  
  1471. (1) X offset for pasting the appropriate wall texture onto the wall's
  1472.     "space": positive offset moves into the texture, so the left
  1473.     portion gets cut off (# of columns off left side = offset).
  1474.     Negative offset moves texture farther right, in the wall's space.
  1475. (2) Y offset: analogous to the X, for vertical.
  1476. (3) "upper" texture name: the part above the juncture with a lower
  1477.     ceiling of an adjacent sector.
  1478. (4) "lower" texture name: the part below a juncture with a higher
  1479.     floored adjacent sector.
  1480. (5) "middle" texture name: the regular part of the wall. Also known as
  1481.     "normal" or "full" texture.
  1482. (6) SECTOR that this sidedef faces or helps to surround.
  1483.  
  1484.   The texture names are from the TEXTURE1/2 resources. The names of
  1485. wall patches in the directory (between P_START and P_END) are not
  1486. directly used, they are referenced through the PNAMES lump.
  1487.   Simple sidedefs have no upper or lower texture, and so they will have
  1488. "-" instead of a texture name. Also, two-sided lines can be transparent,
  1489. in which case "-" means transparent (no texture).
  1490.   If the wall is wider than the texture to be pasted onto it, then the
  1491. texture is tiled horizontally. A 64-wide texture will be pasted at 0,
  1492. 64, 128, etc., unless an X-offset changes this.
  1493.   If the wall is taller than the texture, than the texture is tiled
  1494. vertically, with one very important difference: it starts new tiles
  1495. ONLY at 128, 256, 384, etc. So if the texture is less than 128 high,
  1496. there will be junk filling the undefined areas, and it looks ugly.
  1497. This is sometimes called the "Tutti Frutti" effect.
  1498.  
  1499.   There are some transparent textures which can be used as middle textures
  1500. on 2-sided sidedefs (between sectors). These textures need to be composed
  1501. of a single patch (see [8-4]), and note that on a very tall wall, they
  1502. will NOT be tiled. Only one will be placed, at the spot determined by
  1503. the "lower unpegged" flag being on/off and the sidedef's y offset. And
  1504. if a transparent texture is used as an upper or lower texture, then
  1505. the good old "Tutti Frutti" effect will have its way.
  1506.   Also note that animated wall textures (see [8-4-1]) do NOT animate
  1507. if they are the "middle" texture on a 2-sided line. So much for the
  1508. lava waterfall with the hidden room at its base...hmm, maybe not...
  1509.  
  1510.  
  1511. [4-5]: VERTEXES
  1512. ===============
  1513.  
  1514.   These are the beginning and end points for LINEDEFS and SEGS. Each
  1515. vertice's record is 4 bytes in 2 <short> fields:
  1516.  
  1517. (1) X coordinate
  1518. (2) Y coordinate
  1519.  
  1520.   On the automap within the game, with the grid on (press 'G'), the
  1521. lines are 128 apart (0x80), two lines = 256 (0x100).
  1522.   A note on the coordinates: the coordinate system used for the vertices
  1523. and the heights of the sectors corresponds to pixels, for purposes of
  1524. texture-mapping. So a sector that's 128 high, or a multiple of 128, is
  1525. pretty typical, since many wall textures are 128 pixels high.
  1526.   And yes, the correct spelling of the plural of "vertex" is "vertices".
  1527.  
  1528.  
  1529. [4-6]: SEGS
  1530. ===========
  1531.  
  1532.   The SEGS are stored in a sequential order determined by the SSECTORS,
  1533. which are part of the NODES recursive tree.
  1534.   Each seg is 12 bytes in 6 <short> fields:
  1535.  
  1536. (1) start of seg is VERTEX with this number
  1537. (2) end VERTEX
  1538. (3) angle: 0= east, 16384=north, -16384=south, -32768=west.
  1539.       In hex, it's 0000=east, 4000=north, 8000=west, c000=south.
  1540.       This is also know as BAMS for Binary Angle Measurement.
  1541. (4) LINEDEF that this seg goes along
  1542. (5) direction: 0 if the seg goes the same direction as the linedef it
  1543.       is on, 1 if the seg goes the opposite direction. This is the
  1544.       same as (0 if the seg is on the RIGHT side of the linedef) or
  1545.       (1 if the seg is on the LEFT side of the linedef).
  1546. (6) offset: distance along the linedef to the start of this seg (the
  1547.       vertex in field 1). The offset is in the same direction as the
  1548.       seg. If field 5 is 0, then the distance is from the "start"
  1549.       vertex of the linedef to the "start" vertex of the seg. If field
  1550.       5 is 1, then the offset is from the "end" vertex of the linedef
  1551.       to the "start" vertex of the seg. So if the seg begins at one of
  1552.       the two endpoints of the linedef, this offset will be 0.
  1553.  
  1554.   For diagonal segs, the offset distance can be obtained from the
  1555. formula DISTANCE = SQR((x2 - x1)^2 + (y2 - y1)^2). The angle can be
  1556. calculated from the inverse tangent of the dx and dy in the vertices,
  1557. multiplied to convert PI/2 radians (90 degrees) to 16384. And since
  1558. most arctan functions return a value between -(pi/2) and (pi/2),
  1559. you'll have to do some tweaking based on the sign of (x2-x1), to
  1560. account for segs that go "west".
  1561.  
  1562.  
  1563. [4-7]: SSECTORS
  1564. ===============
  1565.  
  1566.   SSECTOR stands for sub-sector. These divide up all the SECTORS into
  1567. convex polygons. They are then referenced through the NODES resources.
  1568. There will be (number of nodes + 1) ssectors.
  1569.   Each ssector is 4 bytes in 2 <short> fields:
  1570.  
  1571. (1) This many SEGS are in this SSECTOR...
  1572. (2) ...starting with this SEG number
  1573.  
  1574.   The segs in ssector 0 should be segs 0 through x, then ssector 1
  1575. contains segs x+1 through y, ssector 2 containg segs y+1 to z, etc.
  1576.  
  1577.  
  1578. [4-8]: NODES
  1579. ============
  1580.  
  1581.   A detailed explanation of the nodes follows this list of a node's
  1582. structure in the wad file.
  1583.   Each node is 28 bytes in 14 <short> fields:
  1584.  
  1585. (1)  X coordinate of partition line's start
  1586. (2)  Y coordinate of partition line's start
  1587. (3)  DX, change in X to end of partition line
  1588. (4)  DY, change in Y to end of partition line
  1589.  
  1590.   If (1) to (4) equaled 64, 128, -64, -64, the partition line would
  1591. go from (64,128) to (0,64).
  1592.  
  1593. (5)  Y upper bound for right bounding-box.\
  1594. (6)  Y lower bound                         All SEGS in right child of node
  1595. (7)  X lower bound                         must be within this box.
  1596. (8)  X upper bound                        /
  1597. (9)  Y upper bound for left bounding box. \
  1598. (10) Y lower bound                         All SEGS in left child of node
  1599. (11) X lower bound                         must be within this box.
  1600. (12) X upper bound                        /
  1601. (13) a NODE or SSECTOR number for the right child. If bit 15 of this
  1602.        <short> is set, then the rest of the number represents the
  1603.        child SSECTOR. If not, the child is a recursed node.
  1604. (14) a NODE or SSECTOR number for the left child.
  1605.  
  1606.   The NODES lump is by far the most difficult to understand of all the
  1607. data structures in DOOM. A new level won't display right without a valid
  1608. set of precalculated nodes, ssectors, and segs.
  1609.   Here I will explain what the nodes are for, and how they can be
  1610. generated automatically from the set of linedefs, sidedefs, and
  1611. vertices. I am NOT including any code or a pseudo-code algorithm, like
  1612. I do for the BLOCKMAP (appendix [A-3]). This is for reasons of space,
  1613. and more importantly, the fact that I haven't written any such
  1614. algorithm myself. If there's to be some "node code" published here, it
  1615. will have to be donated by someone, well-commented, well-organized, in
  1616. pseudo-code, and 100% effective! So the odds are long against it.
  1617.  
  1618.   The NODES are branches in a binary space partition (BSP) that divides
  1619. up the level and is used to determine which walls are in front of others,
  1620. a process know as hidden-surface removal. The SSECTORS (sub-sectors) and
  1621. SEGS (segments) lumps are necessary parts of the structure.
  1622.   A BSP tree is normally used in 3d space, but DOOM uses a simplified
  1623. 2d version of the scheme. Basically, the idea is to keep dividing the
  1624. map into smaller spaces until each of the smallest spaces contains only
  1625. wall segments which cannot possibly occlude (block from view) other
  1626. walls in its own space. The smallest, undivided spaces will become
  1627. SSECTORS. Each wall segment is part or all of a linedef (and thus a
  1628. straight line), and becomes a SEG. All of the divisions are kept track
  1629. of in a binary tree structure, which is used to greatly speed the
  1630. rendering process (drawing what is seen). How does this binary tree
  1631. lead to faster rendering? I have no idea.
  1632.   Only the SECTORS need to be divided. The parts of the levels that are
  1633. "outside" sectors are ignored. Also, only the walls need to be kept
  1634. track of. The sides of any created ssectors which are not parts of
  1635. linedefs do not become segs.
  1636.   Some sectors do not require any dividing. Consider a square sector.
  1637. All the walls are orthogonal to the floor (the walls are all straight
  1638. up and down), so from any viewpoint inside the square, none of its
  1639. four walls can possibly block the view of any of the others. Now
  1640. imagine a sector shaped like this drawing:
  1641.  
  1642. +--------------.------+   The * is the viewpoint, looking ->, east. The
  1643. |               .     |   diagonal wall marked @ @ can't be seen at all,
  1644. |               /\    |@  and the vertical wall marked @@@ is partially
  1645. |  *->        /   @\  |@  occluded by the other diagonal wall. This sector
  1646. |           /       @\|@  needs to be divided. Suppose the diagonal wall
  1647. +---------/               is extended, as shown by the two dots (..):
  1648.  
  1649. now each of the two resulting sub-sectors are sufficient, because while
  1650. in either one, no wall that is part of that sub-sector blocks any other.
  1651.   In general, being a convex polygon is the goal of a ssector. Convex
  1652. means a line connecting any two points that are inside the polygon will
  1653. be completely contained in the polygon. All triangles and rectangles are
  1654. convex, but not all quadrilaterals. In doom's simple Euclidean space,
  1655. convex also means that all the interior angles of the polygon are less
  1656. than or equal to 180 degrees.
  1657.   Now, an additional complication arises because of the two-sided
  1658. linedef. Its two sides are in different sectors, so they will end up
  1659. in different ssectors too. Thus every two-sided linedef becomes two segs
  1660. (or more), or you could say that every sidedef becomes a seg. Creating
  1661. segs from sidedefs is a good idea, because the seg can then be associated
  1662. with a sector. Two segs that aren't part of the same sector cannot
  1663. possibly be in the same ssector, so further division is required of any
  1664. set of segs that aren't all from the same sector.
  1665.   Whenever a division needs to be made, a SEG is picked, somewhat
  1666. arbitrarily, which along with its imaginary extensions, forms a "knife"
  1667. that divides the remaining space in two (thus binary). This seg is the
  1668. partition line of a node, and the remaining spaces on either side of
  1669. the partition line become the right and left CHILDREN of the node. All
  1670. partition lines have a direction, and the space on the "right" side of
  1671. the partition is the right child of the node; the space on the "left"
  1672. is the left child (there's a cute sketch in [4-3]: LINEDEFS that shows
  1673. how right and left relate to the start and end of a line). Note that if
  1674. there does not exist a seg in the remaining space which can serve as a
  1675. partition line, then there is no need for a further partition, i.e.
  1676. it's a ssector and a "leaf" on the node tree.
  1677.   If the "knife" passes through any lines/segs (but not at vertices),
  1678. they are split at the intersection, with one part going to each child.
  1679. A two-sided linedef, which is two segs, when split results in four segs.
  1680. A two sider that lies along an extension of the partition line has each
  1681. of its two segs go to opposite sides of the partition line. This is the
  1682. eventual fate of ALL segs on two-sided linedefs.
  1683.   As the partition lines are picked and the nodes created, a strict
  1684. ordering must be maintained. The node tree is created from the "top"
  1685. down. After the first division is made, then the left child is divided,
  1686. then its left child, and so on, until a node's child is a ssector. The
  1687. n you move back up the tree one branch, and divide the right child, then
  1688. its left, etc. ALWAYS left first, on the way down.
  1689.   Since there will be splits along the way, there is no way to know
  1690. ahead of time how many nodes and ssectors there will be at the end.
  1691. And the top of the tree, the node that is created first, is given the
  1692. highest number. So as nodes and ssectors are created, they are simply
  1693. numbered in order from 0 on up, and when it's all done (nothing's left
  1694. but ssectors), then ALL the numbers, for nodes and ssectors, are
  1695. reversed. If there's 485 nodes, then 485 becomes 0 and 0 becomes 485.
  1696.   Here is another fabulous drawing which will explain everything.
  1697. + is a vertex, - and | indicate linedefs, the . . indicates an
  1698. extension of a partition line. The <, >, and ^ symbols indicate the
  1699. directions of partition lines. All the space within the drawing is
  1700. actual level space, i.e. sectors.
  1701.  
  1702.       +-----+-------+-------+            0                     (5)
  1703.       |     |       |       |         /     \      ==>       /     \
  1704.       |  e  |^  f   |^  g   |       1         4           (4)       (1)
  1705.       |     |4      |5      |     /   \      / \         /   \      / \
  1706. +---- + . . +-------+-------+    2     3    e   5      (3)   (2)   2  (0)
  1707. |     |           < 0       |   / \   / \      / \     / \   / \      / \
  1708. |  a  |       b             |  a   b c   d    f   g   6   5 4   3    1   0
  1709. |     |^                    |
  1710. | . . |2. . . . . +---------+ The order in which      How the elements are
  1711. |     |           |1 >        the node tree's         numbered when it's
  1712. |  c  |^    d     |           elements get made.      finished.
  1713. |     |3          |           0 = node                (5) = node
  1714. +-----+-----------+           a = ssector             6 = ssector
  1715.  
  1716.   1. Make segs from all the linedefs. There are 5 two-sided lines here.
  1717.   2. Pick the vertex at 0 and go west (left). This is the first
  1718.        partition line. Note the . . extension line.
  1719.   3. Pick the vertex at 1, going east. The backwards extension . . cuts
  1720.        the line 3>2>, and the unlabeled left edge line. The left edge
  1721.        was one seg, it becomes two. The 3>2> line was two segs, it
  1722.        becomes four. New vertices are created at the intersection
  1723.        points to do this.
  1724.   4. Pick the (newly created) vertex at 2. Now the REMAINING spaces on
  1725.        both sides of the partition line are suitable for ssectors. The
  1726.        left one is first, it becomes a, the right b. Note that ssector
  1727.        a has 3 segs, and ssector b has 5 segs. The . . imaginary lines
  1728.        are NOT segs.
  1729.   5. Back up the tree, and take 1's right branch. Pick 3. Once again, we
  1730.        can make 2 ssectors, c and d, 3 segs each. Back up the tree to 0.
  1731.   6. Pick 4. Now the left side is a ssector, it becomes e. But the right
  1732.        side is not, it needs one more node. Pick 5, make f and g.
  1733.   7. All done, so reverse all the ordination of the nodes and the
  1734.        ssectors. Ssector 0's segs become segs 0-2, ssector 1's segs
  1735.        become segs 3-7, etc. The segs are written sequentially according
  1736.        to the ssector numbering.
  1737.  
  1738.   If we want to create an algorithm to do the nodes automatically, it
  1739. needs to be able to pick partition lines automatically. From studying
  1740. the original maps, it appears that they usually chose a linedef which
  1741. divides the child's space roughly in "half". This is restricted by the
  1742. availability of a seg in a good location, with a good angle. Also, the
  1743. "half" refers to the total number of ssectors in any particular child,
  1744. which we have no way of knowing when we start! Optimization methods are
  1745. probably used, or maybe brute force, trying every candidate seg until
  1746. the "best" one is found.
  1747.   What is the best possible choice for a partition line? Well, there
  1748. are apparently two goals when creating a BSP tree, which are partially
  1749. exclusive. One is to have a balanced tree, i.e. for any node, there are
  1750. about the same total number of sub-nodes on either side of it. The other
  1751. goal is to minimize the number of "splits" necessary, in this case, the
  1752. number of seg splits needed, along with the accompanying new vertices
  1753. and extra segs. Only a very primitive and specially constructed set of
  1754. linedefs could avoid having any splits, so they are inevitable. It's
  1755. just that with some choices of partition lines, there end up being
  1756. fewer splits. For example,
  1757.  
  1758. +--------------+       If a and b are chosen as partition lines,
  1759. |              |       there will be four extra vertices needed,
  1760. +---+      +---+ < A   and this shape becomes five ssectors and
  1761.     |^    ^|           16 segs. If A and B are chosen, however,
  1762. +---+a    b+---+ < B   there are no extra vertices, and only three
  1763. |              |       ssectors and 12 segs.
  1764. +--------------+
  1765.  
  1766.   I've read that for a "small" number of polygons (less than 1000?),
  1767. which is what we're dealing with in a doom level, one should definitely
  1768. try to minimize splits, and not worry about balancing the tree. I can't
  1769. say for sure, but it does appear that the original levels strive for
  1770. this. Their trees are not totally unbalanced, but there are some parts
  1771. where many successive nodes each have a node and a ssector as children
  1772. (this is unbalanced). And there are a lot of examples to prove that the
  1773. number of extra segs and vertices they create is very low compared to
  1774. what it could be. I think the algorithm that id Software used tried to
  1775. optimize both, but with fewer splits being more important.
  1776.  
  1777.  
  1778. [4-9]: SECTORS
  1779. ==============
  1780.  
  1781.   A SECTOR is a horizontal (east-west and north-south) area of the map
  1782. where a floor height and ceiling height is defined. It can have any
  1783. shape. Any change in floor or ceiling height or texture requires a
  1784. new sector (and therefore separating linedefs and sidedefs). If you
  1785. didn't already know, this is where you find out that DOOM is in many
  1786. respects still a two-dimensional world, because there can only be ONE
  1787. floor height in each sector. No buildings with two floors, one above
  1788. the other, although fairly convincing illusions are possible.
  1789.   Each sector's record is 26 bytes, comprising 2 <short> fields, then
  1790. 2 <8-byte string> fields, then 3 <short> fields:
  1791.  
  1792. (1) Floor is at this height for this sector
  1793. (2) Ceiling height
  1794. (3) name of the flat used for the floor texture, from the directory.
  1795. (4) name of the flat used for the ceiling texture.
  1796.       All the flats in the directory between F_START and F_END work
  1797.       as either floors or ceilings.
  1798. (5) lightlevel of this sector: 0 = total dark, 255 (0xff) = maximum
  1799.       light. There are actually only 32 brightnesses possible (see
  1800.       COLORMAP [8-2]), so 0-7 are the same, ..., 248-255 are the same.
  1801. (6) special sector: see [4-9-1] immediately below.
  1802. (7) a "tag" number corresponding to LINEDEF(s) with the same tag
  1803.       number. When that linedef is activated, something will usually
  1804.       happen to this sector - its floor will rise, the lights will
  1805.       go out, etc. See [4-3-2] for the list of linedef effects.
  1806.  
  1807.  
  1808. [4-9-1]: Special Sector Types
  1809. -----------------------------
  1810.  
  1811.   Bytes 22-23 of each Sector record are a <short> which determines
  1812. some area-effects called special sectors.
  1813.   Light changes are automatic. The brightness level will alternate
  1814. between the light value specified for the special sector, and the lowest
  1815. value amongst adjacent sectors (two sectors are adjacent if a linedef
  1816. has a sidedef facing each sector). If there is no lower light value,
  1817. or no adjacent sectors, then the "blink" sectors will instead alternate
  1818. between 0 light and their own specified light level. The "oscillate"
  1819. special (8) does nothing if there is no lower light level.
  1820.   "blink off" means the light is at the specified level most of the time,
  1821. and changes to the lower value for just a moment. "blink on" means the
  1822. light is usually at the lower value, and changes to the sector's value
  1823. for just a moment. Every "synchronized" blinking sector on the level
  1824. will change at the same time, whereas the unsynchonized blinking sectors
  1825. change independently. "oscillate" means the light level goes smoothly
  1826. from the lower to the higher and back; it takes about 2 seconds to go
  1827. from maximum to minimum and back (255 down to 0 back up to 255).
  1828.   The damaging sector types only affect players, monsters suffer no ill
  1829. effects from them whatsoever. Players will only take damage when they
  1830. are standing on the floor of the damaging sector. "-10/20%" means that
  1831. the player takes 20% damage at the end of every second that they are in
  1832. the sector, except at skill 1, they will take 10% damage. If the player
  1833. has armor, then the damage is split between health and armor.
  1834.  
  1835. Dec Hex Class   Condition or effect
  1836.  
  1837.  0  00  -       Normal, no special characteristic.
  1838.  1  01  Light   random off
  1839.  2  02  Light   blink 0.5 second
  1840.  3  03  Light   blink 1.0 second
  1841.  4  04  Both    -10/20% health AND light blink 0.5 second
  1842.  5  05  Damage  -5/10% health
  1843.  7  07  Damage  -2/5% health
  1844.  8  08  Light   oscillates
  1845.  9  09  Secret  a player must stand in this sector to get credit for
  1846.           finding this secret. This is for the SECRETS ratio
  1847.           on inter-level screens.
  1848. 10  0a  Door    30 seconds after level start, ceiling closes like a door.
  1849. 11  0b  End     -10/20% health. If a player's health is lowered to less
  1850.           than 11% while standing here, then the level ends! Play
  1851.           proceeds to the next level. If it is a final level
  1852.           (levels 8 in DOOM 1, level 30 in DOOM 2), the game ends!
  1853. 12  0c  Light   blink 0.5 second, synchronized
  1854. 13  0d  Light   blink 1.0 second, synchronized
  1855. 14  0e  Door    300 seconds after level start, ceiling opens like a door.
  1856. 16  10  Damage  -10/20% health
  1857.  
  1858.   The following value can only be used in versions 1.666 and up, it will
  1859. cause an error and exit to DOS in version 1.2 and earlier:
  1860.  
  1861. 17  11  Light   flickers on and off randomly
  1862.  
  1863.   All other values cause an error and exit to DOS. This includes these
  1864. two values which were developed and are quoted by id as being available,
  1865. but are not actually implemented in DOOM.EXE (as of version 1.666):
  1866.  
  1867.  6  06  -       crushing ceiling
  1868. 15  0f  -       ammo creator
  1869.  
  1870.   What a shame! The "ammo creator" sounds especially interesting!
  1871.  
  1872.  
  1873. [4-10]: REJECT
  1874. ==============
  1875.  
  1876.   The REJECT lump is used to help speed play on large levels. It can
  1877. also be used for some special effects like monsters in plain sight who
  1878. CANNOT attack or see players.
  1879.   The size of a REJECT in bytes is (number of SECTORS ^ 2) / 8, rounded
  1880. up. It is an array of bits, with each bit controlling whether monsters
  1881. in a given sector can detect and/or attack players in another sector.
  1882.   Make a table of sectors vs. sectors, like this:
  1883.  
  1884.      sector that the player is in
  1885.           0  1  2  3  4
  1886.         +---------------
  1887. sector    0 | 0  1  0  0  0
  1888. that      1 | 1  0  1  1  0
  1889. the       2 | 0  1  0  1  0
  1890. monster   3 | 0  1  1  1  0
  1891. is in     4 | 0  0  1  0  0
  1892.  
  1893.   A 1 means the monster cannot become activated by seeing a player, nor
  1894. can it attack the player. A 0 means there is no restriction. All non-
  1895. deaf monsters still become activated by weapon sounds that they hear
  1896. (including the bare fist!). And activated monsters will still pursue
  1897. the player, but they will not attack if their current sector vs. sector
  1898. bit is "1". So a REJECT that's set to all 1s gives a bunch of pacifist
  1899. monsters who will follow the player around and look menacing, but never
  1900. actually attack.
  1901.   How the table turns into the REJECT resource:
  1902.   Reading left-to-right, then top-to-bottom, like a page, the first bit
  1903. in the table becomes bit 0 of byte 0, the 2nd bit is bit 1 of byte 0,
  1904. the 9th bit is bit 0 of byte 1, etc. So if the above table represented
  1905. a level with only 5 sectors, its REJECT would be 4 bytes:
  1906.  
  1907. 10100010 00101001 01000111 xxxxxxx0 (hex A2 29 47 00, decimal 162 41 71 0)
  1908.  
  1909.   In other words, the REJECT is a long string of bits which are read
  1910. from least significant bit to most significant bit, according to the
  1911. lo-hi storage scheme used in a certain "x86" family of CPUs.
  1912.   Usually, if a monster in sector A can't detect a player in sector B,
  1913. then the reverse is true too, thus if sector8/sector5 is set, then
  1914. sector5/sector8 will be set also. Same sector prohibitions, e.g. 0/0,
  1915. 3/3, etc. are only useful for special effects (pacifist monsters), or
  1916. for tiny sectors that monsters can't get to anyway.
  1917.  
  1918.   The REJECT array was designed to speed the monster-detection process.
  1919. If a sector pair is prohibited, the game engine doesn't even bother
  1920. checking line-of-sight feasibility for the monster to "see" the player
  1921. and consider attacking. When a level has hundreds of monsters and
  1922. hundreds of sectors, a good REJECT can prevent the drastic slowdowns
  1923. that might otherwise occur (even fast CPUs can fall victim to this
  1924. phenomenon).
  1925.  
  1926.  
  1927. [4-11]: BLOCKMAP
  1928. ================
  1929.  
  1930.   The BLOCKMAP is a pre-calculated structure that the game engine uses
  1931. to simplify collision-detection between moving things and walls. If a
  1932. level doesn't have a blockmap, it will display fine, but everybody walks
  1933. through walls, and no one can hurt anyone else.
  1934.   A concise definition of the BLOCKMAP is in appendix [A-1]. This is
  1935. the full explanation of it.
  1936.   The whole level is cut into "blocks", each is a 128 (hex 80) wide
  1937. square (the grid lines in the automap correspond to these blocks). The
  1938. BLOCKMAP is a collection of lists, one list for each block, which say
  1939. what LINEDEFS are wholly or partially in that block (i.e. part of the
  1940. line passes through the block). When the game engine needs to check
  1941. for an object/wall collision (to prevent a player from walking through
  1942. a wall or to explode a rocket when it hits a wall, etc.), it just looks
  1943. up the blocklist for the block that the object is in. This tells it
  1944. which linedefs it needs to check for collisions. Most blocks will have
  1945. few if any lines in them, so there will be a substantial savings in
  1946. processor time if it only checks a couple linedefs per object instead
  1947. of a thousand or so linedefs per object - it would have to check every
  1948. single linedef on the level if not for these blocklists.
  1949.   The blocks are also used for object/object collisions, but that is
  1950. not visible in the WAD format. During play, each block is also given a
  1951. dynamic "thing list", which tells what THINGS are currently in that
  1952. block. Again, this negates the need to check every moving object vs.
  1953. every other object for collisions - only a few need be tested.
  1954.   The BLOCKMAP is composed of three parts: the header, the offsets, and
  1955. the blocklists.
  1956.   The 8-byte header contains 4 short integers:
  1957.  
  1958. (1)     X coordinate of block-grid origin
  1959. (2)     Y coordinate of block-grid origin
  1960. (3)     # of columns (blocks in X direction)
  1961. (4)     # of rows (blocks in Y direction)
  1962.  
  1963.   The block-grid origin is the bottom-left corner of the bottom-left
  1964. (southwest) block. id's blockmap builder this origin point at 8 less
  1965. than the minimum values of x and y achieved in any vertex on the level.
  1966.   The number of columns and rows needs to be sufficient to contain
  1967. every linedef in the level. If there are linedefs outside the blockmap,
  1968. it will not be able to prevent monsters or players from crossing those
  1969. linedefs, which can cause problems, including the hall of mirrors effect.
  1970.  
  1971.   There are N blocks, N = (number of columns * number of rows). Each
  1972. block has a blocklist and an offset to that blocklist. Immediately
  1973. following the 8-byte header are N unsigned short integers. The first
  1974. is the offset in short-ints NOT bytes, from the start of the BLOCKMAP
  1975. lump to the start of the first blocklist. The last offset points to
  1976. blocklist (N-1), the last blocklist. Note that all these offsets are
  1977. UNSIGNED, so they can point to a location 65535 shorts (131070 bytes)
  1978. into the BLOCKMAP. If they were signed, they could only go up to 32767.
  1979.   The blocks are numbered going east (right) first, then north (up).
  1980. Block 0 is at the southwest corner (row 0, column 0). Block 1 is at
  1981. row 0, column 1. If there are 37 columns, then block 38 is at row 1,
  1982. column 0, etc.
  1983.  
  1984.   After the offsets come the blocklists. Each blocklist starts with
  1985. a short-int 0 (0x0000) and ends with a short-int -1 (0xffff). In between
  1986. are the numbers of every linedef which has any portion whatsoever in the
  1987. 128 x 128 coordinate area of that block. If the block-grid origin is at
  1988. (0,0), then the first column is X = 0 to 127 inclusive, the second column
  1989. is X = 128 to 255 inclusive, etc. So a vertical line with X = 128 which
  1990. might seem to be on the border of two columns of blocks is actually only
  1991. in the easternmost/rightmost column. Likewise for the rows.
  1992.   The first linedef in the LINEDEFS lump is linedef number 0, and so on.
  1993. An "empty" block's blocklist only has the two shorts 0 and -1. A non-
  1994. empty block might have this as its blocklist: 0 330 331 333 -1. This
  1995. means that linedefs 330, 331, and 333 have some part of them pass through
  1996. this block. A block that has linedef 0 in it will go: 0 0 .. etc .. -1.
  1997.  
  1998.   There is an upper limit to how big a BLOCKMAP can be. Even empty
  1999. blocklists require at least 3 shorts - the 0, the -1, and the offset to
  2000. the blocklist. The offsets are unsigned shorts, which would imply a
  2001. maximum value of short #65535 ( = byte 131070) for the start of the last
  2002. blocklist. At a little over 6 bytes per blocklist, that would be a maximum
  2003. of around 21000 blocks (145 by 145 blocks, 18560 in coordinates). But the
  2004. actual limit is less. Experiments suggest that the maximum total size of
  2005. all the blocklists, not counting the offsets, is 65535 bytes. This limits
  2006. a minimalist level to around 120 blocks square (15360 in coordinates),
  2007. or a realistically complex level to around 100 blocks square (12800 in
  2008. coordinates).
  2009.  
  2010.  
  2011. ---------------------
  2012. CHAPTER [5]: Graphics
  2013. ---------------------
  2014.  
  2015.   The great majority of the entries in the directory reference lumps
  2016. that are in a special picture format. The same format is used for the
  2017. sprites (monsters, items), the wall patches, and various miscellaneous
  2018. pictures for the status bar, menu text, inter-level map, etc. Every
  2019. one of these picture lumps contains exactly one picture. The flats
  2020. (floor and ceiling pictures) are NOT in this format, they are raw data;
  2021. see chapter [6].
  2022.   A great many of these lumps are used in sprites. A "sprite" is the
  2023. picture or pictures necessary to display any of the THINGS. Some of
  2024. them are simple, a single lump like SUITA0. Most of the monsters have
  2025. 50 or more lumps.
  2026.   The first four letters of these lumps are the sprite's "name". TROO
  2027. is for imps, BKEY is for the blue key, and so on. See [4-2-1] for a list
  2028. of them all. The fifth letter in the lump is an indication of what "frame"
  2029. it is, for animation sequences. The letters correspond to numbers, ASCII
  2030. "A" equalling 0, "B" is 1, ... "Z" is 25, etc. The highest needed by a
  2031. DOOM 1 sprite is W=22, but some of the DOOM 2 monsters need a few more
  2032. frames.
  2033.   The "0" in the lump name is for "rotations" or "rot"s. All the
  2034. static objects like torches and barrels and dead bodies look the same
  2035. from any angle. This is because they have a "rot=0 lump" as DOOM itself
  2036. might say. Monsters and projectiles look different from different
  2037. angles. This is done with rots 1-8. This diagram shows how rot 1 is for
  2038. the front and they go counter-clockwise (looking from above) to 8:
  2039.  
  2040.     3
  2041.       4 | 2
  2042.        \|/
  2043.      5--*----> 1   Thing is facing this direction
  2044.        /|\
  2045.       6 | 8
  2046.     7
  2047.  
  2048.   Many things have sets of lumps like this: TROOA1, TROOA2A8, TROOA3A7,
  2049. TROOA4A6, TROOA5, TROOB1, etc. This means that for frame 0 (A), the
  2050. pairs of rots/angles (2 and 8), (3 and 7), and (4 and 6) are mirror-
  2051. images. In the long run, this saves space in the wad file, and from the
  2052. designer's point of view, it's 37% fewer pictures to have to draw.
  2053.   If a sprite's frame has a non-zero rot, it needs to have ALL 8 of
  2054. them. Also note that no more than two rots can be squeezed into one
  2055. lump's name. Some other two-rot lumps with a different format are
  2056. shown in the SPIDA1D1, SPIDA2D2, etc. lumps.
  2057.  
  2058.   IMPORTANT: Sprite lumps and flats cannot be added or replaced via pwads
  2059. unless they ALL are. That is, ALL sprites' lumps must be located in a
  2060. single wad file, and ALL flats' lumps must be in a single wad file. Wall
  2061. patches CAN be used in external wads, because the PNAMES lump gives a
  2062. number to every pname, and is used as a quick-index list to load in
  2063. wall patches.
  2064.   Version 1.666 was rumored to be able to include sprites in pwads (in
  2065. fact the README says it can), but it can't.
  2066.  
  2067.  
  2068. [5-1]: Picture Format
  2069. =====================
  2070.  
  2071.   Each picture has three sections. First, an 8-byte header composed of
  2072. four short-integers. Then a number of long-integer pointers. Then the
  2073. picture's pixel/color data. See [A-1] for concise BNF style definitions,
  2074. here is a meatier explanation of the format:
  2075.  
  2076. (A) The header's four fields are:
  2077.  
  2078.   (1) Width. The number of columns of picture data.
  2079.   (2) Height. The number of rows.
  2080.   (3) Left offset. The number of pixels to the left of the center;
  2081.     where the first column gets drawn.
  2082.   (4) Top offset. The number of pixels above the origin;
  2083.     where the top row is.
  2084.  
  2085.   The width and height define a rectangular space or limits for drawing
  2086. a picture within. To be "centered", (3) is usually about half of the
  2087. total width. If the picture had 30 columns, and (3) was 10, then it
  2088. would be off-center to the right, especially when the player is standing
  2089. right in front of it, looking at it. If a picture has 30 rows, and (4)
  2090. is 60, it will appear to "float" like a blue soul-sphere. If (4) equals
  2091. the number of rows, it will appear to rest on the ground. If (4) is less
  2092. than that for an object, the bottom part of the picture looks awkward.
  2093.   With walls patches, (3) is always (columns/2)-1, and (4) is always
  2094. (rows)-5. This is because the walls are drawn consistently within their
  2095. own space (There are two integers in each SIDEDEF which can offset the
  2096. starting position for drawing a wall's texture within the wall space).
  2097.  
  2098.   Finally, if (3) and (4) are NEGATIVE integers, then they are the
  2099. absolute coordinates from the top-left corner of the screen, to begin
  2100. drawing the picture, assuming the VIEW is full-screen (i.e., the full
  2101. 320x200). This is only done with the picture of the player's current
  2102. weapon - fist, chainsaw, bfg9000, etc. The game engine scales the
  2103. picture down appropriatelyif the view is less than full-screen.
  2104.  
  2105. (B) After the header, there are N = field (1) = <width> = (# of columns)
  2106. 4-byte <long> integers. These are pointers to the data for each COLUMN.
  2107. The value of the pointer represents the offset in bytes from the first
  2108. byte of the picture lump.
  2109.  
  2110. (C) Each column is composed of some number of BYTES (NOT integers),
  2111. arranged in "posts":
  2112.  
  2113.   The first byte is the row to begin drawing this post at. 0 means
  2114. whatever height the header (4) upwards-offset describes, larger numbers
  2115. move correspondingly down.
  2116.   The second byte is how many colored pixels (non-transparent) to draw,
  2117. going downwards.
  2118.   Then follow (# of pixels) + 2 bytes, which define what color each
  2119. pixel is, using the game palette. The first and last bytes AREN'T drawn,
  2120. and I don't know why they are there. Probably just leftovers from the
  2121. creation process on the NeXT machines. Only the middle (# of pixels in
  2122. this post) are drawn, starting at the row specified in the first byte
  2123. of the post.
  2124.   After the last byte of a post, either the column ends, or there is
  2125. another post, which will start as stated above.
  2126.   255 (0xFF) ends the column, so a column that starts this way is a null
  2127. column, all "transparent". Draw the next column.
  2128.  
  2129.  
  2130. -----------------------------------------------
  2131. CHAPTER [6]: Flats (Floor and Ceiling Textures)
  2132. -----------------------------------------------
  2133.  
  2134.   All the lumpnames for flats are in the directory between the F_START
  2135. and F_END entries. Calling them flats is a good way to avoid confusion
  2136. with wall textures. There is no look-up or meta-structure in flats as
  2137. there is in walls textures. Each flat is 4096 raw bytes, making a square
  2138. 64 by 64 pixels. This is pasted onto a floor or ceiling with the same
  2139. orientation as the automap would imply, i.e. the first byte is the color
  2140. at the NW corner, the 64th byte (byte 63, 0x3f) is the NE corner, etc.
  2141.   The blocks in the automap grid are 128 by 128, so four flats will fit
  2142. in each block. Note that there is no way to offset the placement of flats,
  2143. as can be done with wall textures. They are pasted according to grid lines
  2144. 64 apart, reckoned from the coordinate (0,0). This allows flats to flow
  2145. smoothly even across jagged boundaries between sectors with the same
  2146. floor or ceiling height.
  2147.  
  2148.   As discussed in chapter [5], replacement and/or new-name flats don't
  2149. work right from pwad files unless they are all in the same wad.
  2150.   Theoretically, you can change all the flats want by constructing a
  2151. new DOOM.WAD or ALLFLATS.WAD pwad, but you have to make sure no floor
  2152. or ceiling uses an entry name which isn't in your F_ section. And you
  2153. have to include these four entries for DOOM 1 use, although you can
  2154. change their actual contents (pictures): FLOOR4_8, SFLR6_1, MFLR8_4,
  2155. and FLOOR7_2. The first three are needed as backgrounds for the episode
  2156. end texts. The last is what is shown "outside" the border of the display
  2157. window if the display is not full-screen.
  2158.  
  2159.  
  2160. [6-1]: Animated Flats
  2161. ---------------------
  2162.  
  2163.   See Chapter [8-4-1] for a discussion of how the animated walls and
  2164. flats work. Unfortunately, the fact that the flats all need to be
  2165. lumped together in one wad file means that its not possible to change
  2166. the animations via a pwad file, unless it contains ALL the flats, which
  2167. amounts to several hundred k. Plus it is illegal to distribute the
  2168. original data, so to pass around modifications, either all the flats
  2169. must be all-new, or a utility must be used to construct a FLATS.WAD
  2170. on an end-user's hard drive, using the original DOOM.WAD plus the
  2171. additions. (Note: Bernd Kreimeier, listed in [A-5], has written a
  2172. utility that does just this. It is called DMADDS11).
  2173.  
  2174.  
  2175. -----------------------------
  2176. CHAPTER [7]: Sounds and Music
  2177. -----------------------------
  2178.  
  2179.  
  2180. [7-1]: PC Speaker Sound Effects
  2181. ===============================
  2182.  
  2183.   DP* entries in the directory refer to lumps that are sound data for
  2184. systems using the PC speaker.
  2185.   It's a quick and simple format. First is a <short> that's always 0,
  2186. then a <short> that's the number of bytes of sound data, then follow
  2187. that many bytes worth of sound data. That is, the lump's bytes will be
  2188. 0, 0, N, 0, then N bytes of data. The DP* lumps range in size from around
  2189. 10 bytes to around 150 bytes, and the data seem to range from 0 to 96
  2190. (0x00 to 0x60). The numbers obviously indicate frequency, but beyond
  2191. that I don't know the exact correlation in Hz, nor the time duration
  2192. of each byte worth of data. Feel free to figure this out and tell me.
  2193.  
  2194.  
  2195. [7-2]: Soundcard Sound Effects
  2196. ==============================
  2197.  
  2198.   DS* entries in the directory refer to lumps that are sound data for
  2199. systems using soundcards.
  2200.   This data is in a RAW format for 8-bit 11 KHz mono sound - first is
  2201. an 8-byte header composed of 4 unsigned short integers:
  2202.  
  2203. (1) 3           (means what?)
  2204. (2) 11025       (the sample rate, samples per second)
  2205. (3) N           (the number of samples)
  2206. (4) 0
  2207.  
  2208.   Each sample is a single byte, since they are 8-bit samples. The
  2209. maximum number of samples is 65535, so at 11 KHz, a little less than
  2210. 6 seconds is the longest possible sound effect.
  2211.  
  2212.  
  2213. [7-3]: Music
  2214. ============
  2215.  
  2216.   D_* entries is the directory refer to lumps that are music. This
  2217. music is in the MUS file format, which goes like this:
  2218.  
  2219. offset  type    contents
  2220.  
  2221. 0       ASCII   "MUS" and CTRL-Z (hex 4d 55 53 1a)
  2222. 4      <short>  # of bytes of music data
  2223. 6      <short>  # of bytes of header data (offset to start of music)
  2224. 8      <short>  number of primary channels
  2225. 10     <short>  number of secondary channels
  2226. 12     <short>  number of instrument patches
  2227. 14     <short>  0
  2228. 16     <short>s instrument patch numbers
  2229. X to end  ?     Music data
  2230.  
  2231.   X is the header size (the second short). Drum patch numbers (greater
  2232. than 128) are 28 less than the numbers listed in the DMXGUS lump.
  2233.   What the exact format of the music data is, I don't know.
  2234.  
  2235.  
  2236. [7-4]: GENMIDI
  2237. ==============
  2238.  
  2239.   This has something to do with General MIDI, obviously. This lump
  2240. has 3 sections: an 8-byte header (the ASCII text "#OPL_II#"), then
  2241. 150 36-byte records (1 for each instrument), then 150 32-byte strings
  2242. (names of instruments, padded with zeros). Perhaps the 36 bytes contain
  2243. waveform information for the General MIDI standard instruments (this
  2244. guess is based on exactly one glance at a dump of the byte values,
  2245. so don't put too much faith in it).
  2246.  
  2247.  
  2248. [7-5]: DMXGUS
  2249. =============
  2250.  
  2251.   This lump is used to do instrument patch mappings on the Gravis
  2252. Ultra-Sound soundcard. It's in a very simple format - ASCII text!
  2253. Here's the start and end of the DMXGUS lump from DOOM 1 version 1.2,
  2254. which is 200 lines, of which the first 10 are comments:
  2255.  
  2256. #Purpose: Different size patch libraries for different memory sizes.
  2257. #         The libraries are built in such a way as to leave 8K+32bytes
  2258. #         after the patches are loaded for digital audio.
  2259. #
  2260. #Revision History: 06/22/93 - Fixed problem with 512K patch library
  2261. #                  07/26/93 - patch names changed in various releases
  2262. #
  2263. #
  2264. #Explanation of Columns: Patch #  256K  512K  768K  1024K  Patch Name
  2265. #
  2266. 0, 2, 1, 1, 1, acpiano
  2267. 1, 2, 1, 1, 1, britepno
  2268. 2, 2, 1, 1, 1, synpiano
  2269. .
  2270. .
  2271. .
  2272. 213, 128, 128, 128, 128, castinet
  2273. 214, 128, 128, 128, 128, surdo1
  2274. 215, 128, 128, 128, 128, surdo2
  2275.  
  2276.  
  2277. --------------------------------
  2278. CHAPTER [8]: Miscellaneous Lumps
  2279. --------------------------------
  2280.  
  2281.  
  2282. [8-1]: PLAYPAL
  2283. ==============
  2284.  
  2285.   There are 14 palettes here, each is 768 bytes = 256 rgb triples.
  2286. That is, the first three bytes of a palette are the red, green, and
  2287. blue portions of color 0. And so on. Note that the values use the
  2288. full range (0..255), while standard VGA digital-analog converters
  2289. use values 0-63.
  2290.   The first palette, palette 0, is used for most situations.
  2291.   Palettes 10-12 are used (briefly) when an item is picked up, the
  2292. more items that are picked up in quick succession, the brighter it
  2293. gets, palette 12 being the brightest.
  2294.   Palette 13 is used while wearing a radiation suit.
  2295.   Palettes 3, 2, then 0 again are used after getting berserk strength.
  2296.   If the player is hurt, then the palette shifts up to number X, then
  2297. comes "down" one every second or so, to palette 2, then palette 0
  2298. (normal) again. What X is depends on how badly the player got hurt:
  2299. Over 100% damage (add health loss and armor loss), X=8. 93%, X=7. 81%,
  2300. X=6. 55%, X=5. 35%, X=4. 16%, X=2. These are just rough estimates
  2301. based on a single test session long ago. Why bother tracking down
  2302. the exact division points?
  2303.  
  2304.   Unknown: what palettes 1 and 9 are for.
  2305.  
  2306.  
  2307. [8-2]: COLORMAP
  2308. ===============
  2309.  
  2310.   This contains 34 sets of 256 bytes, which "map" the colors "down" in
  2311. brightness. Brightness varies from sector to sector. At very low
  2312. brightness, almost all the colors are mapped to black, the darkest gray,
  2313. etc. At the highest brightness levels, most colors are mapped to their
  2314. own values, i.e. they don't change.
  2315.   In each set of 256 bytes, byte 0 will have the number of the palette
  2316. color to which original color 0 gets mapped.
  2317.   The colormaps are numbered 0-33. Colormaps 0-31 are for the different
  2318. brightness levels, 0 being the brightest (light level 248-255), 31 being
  2319. the darkest (light level 0-7). Light level is the fifth field of each
  2320. SECTOR record, see [4-9].
  2321.   Colormap 32 is used for every pixel in the display window (but not
  2322. the status bar), regardless of sector brightness, when the player is
  2323. under the effect of the "Invulnerability" power-up. This colormap is
  2324. all whites and greys.
  2325.   Colormap 33 is all black for some reason.
  2326.   While the light-amplification goggles power-up is in effect, everything
  2327. in the display uses colormap 0, regardless of sector brightness.
  2328.  
  2329.  
  2330. [8-3]: ENDOOM
  2331. =============
  2332.  
  2333.   When you finally have to leave DOOM, you exit to dos, and a colorful
  2334. box of text appears. This is it. It is 4000 bytes, which are simply
  2335. stored in the screen memory area for 80x25 16-color text mode. Thus
  2336. it follows the same format as screen memory does: each character on
  2337. the screen takes up two bytes. The second byte of each pair is from
  2338. the (extended) ASCII character set, while the first byte of each pair
  2339. is the color attribute for that character. The color attribute can
  2340. be explained thus:
  2341.  
  2342.  bit 7    6   5   4   3   2   1   0
  2343.   +-----+---+---+---+---+---+---+---+
  2344.   |     |   .   .   |   .   .   .   |
  2345.   |Blink| Background|  Foreground   |
  2346.   |     |   .   .   |   .   .   .   |
  2347.   +-----+---+---+---+---+---+---+---+
  2348.  
  2349.   So the foreground color can be from 0-15, the background color can
  2350. be from 0-7, and the "blink" attribute is either on or off. All this
  2351. very low-level info can be found in many ancient PC programming books,
  2352. but otherwise it might be hard to locate...
  2353.  
  2354.  
  2355. [8-4]: TEXTURE1 and TEXTURE2
  2356. ============================
  2357.  
  2358.   These are lists of wall texture names used in SIDEDEFS lumps. Each
  2359. wall texture is composed of one or more wall patches, whose names are
  2360. listed in the PNAMES lump. But in a texture, the wall patches are not
  2361. referred to by name, rather by the index number indicating what position
  2362. they occupy in the PNAMES lump.
  2363.   The TEXTURE2 lump is only present in the registered DOOM.WAD. The
  2364. TEXTURE1 lump is identical in DOOM.WAD and the shareware DOOM1.WAD, and
  2365. it only refers to pname numbers up to 163, because the shareware wad
  2366. only has the first 163 wall patches, not all 350.
  2367.  
  2368.   A TEXTURE lump starts with a 4-byte long integer N which is the number
  2369. of textures defined in it. Following it are N long integers which are the
  2370. offsets in bytes from the beginning of the TEXTURE lump to the start of
  2371. each texture's definition.
  2372.   Then there are N texture definitions, which have the following format.
  2373. The first (texture name) field is an 8-byte string (less than 8 byte
  2374. names are padded with zeros), the rest of the fields are 2-byte short
  2375. integers:
  2376.  
  2377. (1) The name of the texture, used in SIDEDEFS, e.g. "FIREWALL".
  2378. (2) always 0.
  2379. (3) always 0.
  2380. (4) total width of texture
  2381. (5) total height of texture
  2382.  
  2383.     The fourth and fifth fields define a "space" (usually 128 by 128
  2384.       or 64 by 72 or etc...) in which individual wall patches are placed
  2385.       to form the overall picture. To tile vertically on a very tall wall
  2386.       without exhibiting the "Tutti Frutti" effect, a texture must have
  2387.       height 128, the maximum. There is no maximum width.
  2388.  
  2389. (6) always 0.
  2390. (7) always 0.
  2391. (8) Number of 5-field (5 <short>) patch descriptors that follow. This
  2392. means that each texture entry has variable length. Many entries have just
  2393. 1 patch, the most used in DOOM in a single texture is 64.
  2394.  
  2395.   Patch descriptor:
  2396.  
  2397.   (a) x offset from top-left corner of texture space defined in fields
  2398.     4 and 5 to start placement of this patch
  2399.   (b) y offset
  2400.   (c) number (0...) of the entry in the PNAMES lump that contains the
  2401.     lump name from the directory, of the wall patch to use...
  2402.   (d) always 1, is for something called "stepdir"...
  2403.   (e) always 0, is for "colormap"...
  2404.  
  2405.   Each texture's entry ends after the last of its patch descriptors.
  2406.   Note that patches can have transparent parts, since they are in the
  2407. same picture format as everything else. Thus there can be (and are)
  2408. transparent wall textures. These should only be used on a border between
  2409. two sectors, to avoid "hall of mirrors" problems.
  2410.   Also, textures intended for use as the "middle" texture of a 2-sided
  2411. SIDEDEF (e.g. transparent textures) should only be composed of a single
  2412. patch. A limitation in the game engine will cause the "medusa" effect
  2413. if there is more than 1 patch in any middle texture that is visible in
  2414. the display window. This effect causes the computer to slow to a crawl
  2415. and make play impossible until the offending wall is out of view.
  2416.  
  2417.  
  2418. [8-4-1]: Animated Walls
  2419. -----------------------
  2420.  
  2421.   Some of the walls and floors are animated. In the case of wall
  2422. textures, it is possible to substantially customize these animations.
  2423. Flats' animations can theoretically also be modified, but since flats
  2424. don't work from pwads, that can make the effort very difficult.
  2425.   The game engine sets up a number of wall animation cycles based on
  2426. what entries it finds in the TEXTURE lumps. It also sets up flat
  2427. animations based on what lumps exist between F_START and F_END.
  2428. Versions before 1.666 can have up to 9 animated walls and 5 animated
  2429. flats. Version 1.666 (DOOM 1 or 2) can have 13 walls and 9 floors
  2430. animate.
  2431.   For wall animations, the entries in the columns "First" and "Last"
  2432. below, and all the entries between them (in the order that they occur
  2433. in the TEXTURE lump) are linked. If one of them is listed as a texture
  2434. on a sidedef, that sidedef will change texture to the next in the cycle
  2435. about 3 times a second, going back to <First> after <Last>. Flats work
  2436. similarly, except the order is dictated by the wad directory. If both
  2437. of the <First> and <Last> texture/flat names are not present, no problem.
  2438. Then that potential cycle is unused. But if <First> is present, and
  2439. <Last> either is not present or is listed BEFORE <First>, then an
  2440. error occurs while the DOOM operating system sets up, and it aborts.
  2441.   Note that much longer sequences are possible! The entries between
  2442. <First> and <Last> can be almost anything; they need not be the same
  2443. in number as in the original, nor do they have to follow the same
  2444. naming pattern. Thus one could set up SLADRIP1, TRON2, TRON3, TRON4,
  2445. ..., TRON67, SLADRIP3 for a 69-frame animated wall!
  2446.   The "Ver" column indicates what version of DOOM is required. "All"
  2447. indicates all versions have it. The "r" signifies that the shareware
  2448. DOOM1.WAD does not contain the necessary picture lumps. The "2" means
  2449. that only DOOM 2 has the necessary picture lumps, but version 1.666 of
  2450. DOOM.EXE for DOOM 1 also has the capability to use these animation-cycle
  2451. names (for pwad designers).
  2452.  
  2453. First       Last         Ver    Normal # of frames
  2454.  
  2455. BLODGR1     BLODGR4       r     4
  2456. BLODRIP1    BLODRIP4      r     4
  2457. FIREBLU1    FIREBLU2      r     2
  2458. FIRELAV3    FIRELAVA      r     2 (3 patches are in DOOM.WAD, 1 is unused)
  2459. FIREMAG1    FIREMAG3      r     3
  2460. FIREWALA    FIREWALL      r     3
  2461. GSTFONT1    GSTFONT3      r     3
  2462. ROCKRED1    ROCKRED3      r     3
  2463. SLADRIP1    SLADRIP3     All    3
  2464.  
  2465. BFALL1      BFALL4        2     4
  2466. SFALL1      SFALL4        2     4
  2467. WFALL1      WFALL4        2     4
  2468. DBRAIN1     DBRAIN4       2     4
  2469.  
  2470. (floor/ceiling animations):
  2471.  
  2472. NUKAGE1     NUKAGE3      All    3
  2473. FWATER1     FWATER4       r     4
  2474. SWATER1     SWATER4       -     4 (SWATER lumps aren't in any DOOM.WAD)
  2475. LAVA1       LAVA4         r     4
  2476. BLOOD1      BLOOD3        r     3
  2477.  
  2478. RROCK05     RROCK08       2     4
  2479. SLIME01     SLIME04       2     4
  2480. SLIME05     SLIME08       2     4
  2481. SLIME09     SLIME12       2     4
  2482.  
  2483.  
  2484. [8-4-2]: The SKY Textures
  2485. -------------------------
  2486.  
  2487.   The SKY1, SKY2, and SKY3 textures are rather special in that they are
  2488. used as sky backgrounds when the player is out in the open. They can
  2489. also be used on regular walls, but they usually aren't, because then
  2490. they just look like a painting. The "background" effect is done by
  2491. the game engine. There is a special flat, F_SKY1, which is used to
  2492. indicate that a floor or ceiling is "transparent" to the SKY beyond.
  2493. The picture data in the F_SKY1 flat is not even used.
  2494.   Upper textures between F_SKY1 ceilinged sectors do not have the
  2495. specified texture (if any) drawn. Instead, they are "sky". Likewise
  2496. with lower textures between F_SKY1 floored sectors, but it doesn't
  2497. work as well, because if the player's viewpoint is below the top of
  2498. a lower-texture-sky (i.e. if any part of it is in the upper half of
  2499. the display), it causes a hall-of-mirrors effect.
  2500.   SKY textures as sky backgrounds are mirror-images of what they look
  2501. like on walls.
  2502.   The SKY textures are always placed with their tops at the top of the
  2503. view window. Since they cannot be more than 128 high, just like any
  2504. other texture, a rather ugly "seam" in the sky is sometimes visible
  2505. if the player can see too far "down".
  2506.   SKY textures do move horizontally, though, to give a realistic
  2507. effect. Doing a complete 360 degree turn will scroll by a 256-wide
  2508. SKY four times. A 1024-wide SKY will exactly circumscribe the horizon.
  2509. The 0 column of the SKY texture will be at due north (as on the automap),
  2510. the 256 column is at west, 512 is south, and 768 is east. So the middle
  2511. part of a 256-wide SKY is visible at NW, SW, SE, and NE.
  2512.  
  2513.   SKY textures can be composed of several patches, just like regular
  2514. textures, but trying to animate the sky doesn't work. DOOM.EXE can be
  2515. changed so that SKY2 is the start of an animation cycle, and indeed
  2516. on a wall it will animate, but the sky background does not. This is
  2517. perhaps related to the way that "middle" textures of sidedefs do not
  2518. animate.
  2519.  
  2520.  
  2521. [8-5]: PNAMES
  2522. =============
  2523.  
  2524.   This is a list of all the names of lumps that are going to be used
  2525. as wall patches. DOOM assigns numbers to these names, in the order
  2526. that they are listed. The numbers are then used in TEXTURE1 and TEXTURE2
  2527. entries to refer to wall patch lumps. In a texture composition entry,
  2528. 0 means the first pname, 1 is the second, ...
  2529.  
  2530.   The first four bytes of the PNAMES lump is a long integer N.
  2531.   Then follow N pnames, each of which occupies 8 bytes. Pnames less than
  2532. 8 bytes long are padded with zeros. These names duplicate an entry in
  2533. the directory (but are not case sensitive - lowercase letters will match
  2534. uppercase letters and vice versa). Unlike sprites and floors, wall
  2535. patches can be loaded from external pwads. Whichever pwad was listed
  2536. last on the command line and contains a lump with the same name as the
  2537. one in the PNAMES lump (which itself could be from a pwad) is the pwad
  2538. that is used to get the picture data for that wall patch.
  2539.  
  2540.  
  2541. [8-6]: DEMOs
  2542. ============
  2543.  
  2544.   If you start DOOM and do nothing, after a few seconds, it automatically
  2545. shows a demo of play on some level. Also, external demos can be recorded
  2546. and played back by using the command line parameters explained in the
  2547. README and/or the DOOM FAQ. All external demos have a .LMP extension
  2548. which the DOOM OS attaches; you only type the [demoname] without the
  2549. .LMP extension.
  2550.   The DOOM.WAD lumps DEMO1, DEMO2, and DEMO3 are in exactly the same
  2551. format as these external .LMP files. Strictly speaking, the "demo"
  2552. format should not be called the "LMP" format, because any external
  2553. file without a wadfile header, i.e. it is just raw data, is a "lump"
  2554. and deserves the .LMP extension.
  2555.  
  2556.   A DOOM demo has three parts:
  2557.  
  2558.   (1) header - 7 or 13 bytes
  2559.   (2) data recording player moves - 4 bytes per player per gametic
  2560.   (3) quit byte - equals 128 (0x80)
  2561.  
  2562. (1) There are two different kinds of header depending on the version of
  2563. DOOM used to record the demo. Versions up to 1.2 use a 7-byte header:
  2564.  
  2565.   byte  range   purpose
  2566.  
  2567. 0       0-4     skill level. 0="I'm too young to die", 4="Nightmare!"
  2568. 1       1-3     episode.
  2569. 2       1-9     mission/map.
  2570. 3       0-1     player 1 is present if this is 1.
  2571. 4       0-1     player 2.
  2572. 5       0-1     player 3.
  2573. 6       0-1     player 4.
  2574.  
  2575.   Versions after 1.2 use a 13-byte header:
  2576.  
  2577. byte    range   purpose
  2578.  
  2579. 0       104-106 version. 104=1.4 beta, 105=1.5 beta, 106=1.6 beta or 1.666
  2580. 1       0-4     skill level. 0="I'm too young to die", 4="Nightmare!"
  2581. 2       1-3     episode. In DOOM 2 this is always 1.
  2582. 3       1-32    mission/map/level. In DOOM 1, it's 1-9. In DOOM 2, it's 1-32.
  2583. 4       0-2     mode. 0=single or cooperative, 1=deathmatch, 2=altdeath
  2584. 5       0-      respawn. 0=no respawn parameter, (any other value)=respawn.
  2585. 6       0-      fast. 0=no fast parameter, (any other value)=fast.
  2586. 7       0-      nomonsters. 0=monsters exist, (any other value)=nomonsters.
  2587. 8       0-3     viewpoint. 0=player 1's status bar, ..., 3=player 4.
  2588. 9       0-1     player 1 is present if this is 1.
  2589. 10 0x0a 0-1     player 2.
  2590. 11 0x0b 0-1     player 3.
  2591. 12 0x0c 0-1     player 4.
  2592.  
  2593. (2) The player-move data is recorded in 4-byte chunks. Every 1/35 of a
  2594. second is a gametic, and for every gametic, there is one 4-byte chunk
  2595. per player. So the time duration of a demo (in seconds) is approximately
  2596. equal to its length in bytes divided by (140 * number_of_players).
  2597.  
  2598.   The four bytes recording each player's actions are:
  2599.  
  2600.   (a) Forward/Backward Movement.
  2601.   (b) Strafe Right/Left Movement.
  2602.   (c) Turn Left/Right.
  2603.   (d) other actions - use/activate, fire, change weapons.
  2604.  
  2605.   The first three are signed bytes (i.e. of type <char>).
  2606.  
  2607.   (a) Ranges from -127 to 127, negative numbers are backward movement,
  2608.       positive numbers are forward movement. Without the -turbo option
  2609.       above 100, values outside -50..50 cannot be achieved. With a
  2610.       keyboard or joystick, these are the regular values:
  2611.  
  2612.       Move forward:   25 (0x19)   with Speed on:  50 (0x32)
  2613.       Move backward: -25 (0xE7)   with Speed on: -50 (0xCE)
  2614.  
  2615.       Fancy mouse use can achieve any number in the range.
  2616.  
  2617.   (b) Ranges from -127 to 127, negative numbers are left-strafe movement,
  2618.       positive numbers are right-strafe movement. The keyboard values are:
  2619.  
  2620.       Strafe right: 24  (0x18)    with Speed on:  50 (0x32)
  2621.       Strafe left: -24  (0xE8)    with Speed on: -50 (0xCE)
  2622.  
  2623.   (c) Ranges from -127 to 127, negative numbers are right turns, positive
  2624.       numbers are left turns. The keyboard values vary from version to
  2625.       version, but are all in the range -5..5, and that's with Speed on.
  2626.  
  2627.       Using the mouse can achieve much higher numbers here. I doubt if
  2628.       the maximums of 127 and -127 can actually be achieved in play,
  2629.       though.
  2630.  
  2631.   (d) the bits of this byte indicate what actions the player is engaged in:
  2632.  
  2633.       bit 0     Fire current weapon
  2634.       bit 1     Use (a switch, open a door, etc.)
  2635.       bit 2     Change weapon to the one indicated in bits 3-5:
  2636.  
  2637.       bits 5-3 = 000 Fist or Chainsaw
  2638.          001 Pistol
  2639.          010 Shotgun
  2640.          011 Chaingun
  2641.          100 Rocket Launcher
  2642.          101 Plasma Rifle
  2643.          110 BFG 9000
  2644.          111 Super Shotgun (DOOM 2 only)
  2645.  
  2646.       bit 6     unused
  2647.       bit 7     indicates a special action which alters the meanings
  2648.           of the other bits:
  2649.  
  2650.         bits 1-0 = 01 pause or unpause
  2651.              = 10 save game in slot # recorded in bits 4 to 2
  2652.                 (slot number can thus be 0 to 7 but
  2653.                  should NOT be 6 or 7 or else!)
  2654.  
  2655.   There might be other special actions. The save game action happens
  2656. during replay of the demo, so be careful when playing demos if you
  2657. have important savegames! One or more of them could conceivably get
  2658. overwritten.
  2659.  
  2660. (3) The last byte of a demo has the value 128 (0x80)
  2661.  
  2662.  
  2663. [8-6-1]: Level changes from 1.2 to 1.666 DOOM.WAD
  2664. =================================================
  2665.  
  2666.   Many people have experienced the error "Demo from a different game
  2667. version", because DOOM versions will only play back demos that were
  2668. recorded with the same version number. Theoretically, though, ANY
  2669. version can be converted to ANY other version. Versions up to 1.2
  2670. don't even require any modification, and versions 1.4 and up just
  2671. require that their first byte be changed. To change between the two
  2672. families (pre-1.4 and post-1.2) would just require extra header bytes
  2673. be added/shaved.
  2674.   But there are serious complications to converting demos. There have
  2675. been some minor changes and bug-fixes to the levels from version to
  2676. version. Since the demos only record player actions, they have NOTHING
  2677. about the level in them, so they depend on the level used for playback
  2678. to be the same as the level used for recording. Some kinds of differences
  2679. in the playback level can cause the demo to become "unsynchronized"
  2680. with the level, and players will seem to have gone crazy. For example,
  2681. if a deathmatch start-position is at a different location, when a
  2682. demo-player is spawned there, they will try to open doors that don't
  2683. exist at the new location, shoot at people who aren't there, etc.
  2684. The entire playback is ruined from that point on. Some examples of
  2685. changes that don't matter are different floor and wall textures, light
  2686. levels, and linedef "unpegged" flags. But most changes DO matter.
  2687.   Note that changes like (nomonsters) vs. (monsters), (respawn) vs.
  2688. (regular), (altdeath) vs. (regular deathmatch) will very quickly lead
  2689. to unsynchronized goofball players.
  2690.  
  2691.  
  2692.  
  2693. ---------------------------
  2694. CHAPTER [9]: Savegame Files
  2695. ---------------------------
  2696.  
  2697.  
  2698. -------------------------------
  2699. CHAPTER [10]: The DOOM.EXE File
  2700. -------------------------------
  2701.  
  2702.   Via pwads, a great many characteristics of the DOOM environment can
  2703. be changed: maps, pictures, sounds, etc. But there are also a lot of
  2704. neat things that can be done by patching the DOOM.EXE file itself.
  2705. There is a large collection of data at the end of the EXE file, and by
  2706. patching some bytes, we can turn literal values into variables. For
  2707. example, the player has a 16-unit "radius" which prevents him from
  2708. entering very small passageways. The player's radius can be made 1 and
  2709. his "height" 1, so he can enter mouse-sized crawlspaces. There are a
  2710. lot more exciting examples, such as invisible monsters, cyber-demons
  2711. that look like players, super-fast shotguns, and a hundred others, but
  2712. I won't describe all of that here. See appendix [A-4] for some EXE
  2713. utilities and documents. Here I will simply give the data that has
  2714. been figured out to date.
  2715.   I freely mix hex and decimal numbers below. Hopefully you can tell from
  2716. the context. All of the stuff below applies to registered version 1.2,
  2717. and some of it applies to version 1.666 also. This chapter has not yet
  2718. been completely updated for 1.666, but it soon will be.
  2719.  
  2720. [10-1]: Version 1.2 DOOM.EXE Data Segment Overview
  2721. ==================================================
  2722.  
  2723.   The data begins at 0x6f414 (455700) and continues to the end of the
  2724. file, 0x8db27 (580391). Here's an overview of the sections:
  2725.  
  2726. start length what
  2727.  
  2728. 6f414  3d30  TEXT STRINGS
  2729. 73412  1a34  various unknowns, probably to do with I/O, sound, mouse, etc.
  2730. 74bf8 10000  looks like hard-coded math tables, for speed?
  2731. 84bf8   148  misc.
  2732. 84d40    82  gamma correction messages
  2733. 84dc2   280  "are you sure you want to quit" messages
  2734. 85042   3a2  MENUS (new game, load game, etc.)
  2735. 853e4   140  ?
  2736. 85524   36c  configuration options and defaults, like in DEFAULT.CFG
  2737. 85890   174  ?
  2738. 85a04    60  ?
  2739. 85a64    54  ?
  2740. 85ab8    c4  ?
  2741. 85b7c    20  max ammo at start, and ammo per thing
  2742. 85b9c    c0  ammo type and frame #s for the weapons
  2743. 85c5c   188  ANIMATED WALLS and FLOORS
  2744. 85de4   258  SWITCH-WALLS
  2745. 8603c    c0  ?
  2746. 860fc    d4  ?
  2747. 861d0   500  5 colormaps for use with the gamma correction setting 0-4
  2748. 866e4    fc  ?
  2749. 867e0    40  pointers to chatmacros, "Green:", etc.
  2750. 86820    88  pointers to level names, used on Automap
  2751. 868a8    d8  splat mark coordinates for end-level screen
  2752. 86980   5a8  wimap patch animations for end-level screen
  2753. 86f28   224  SONG NAMES list of pointers
  2754. 8714c   8b8  SOUND TABLE
  2755. 87a04   1a4  SPRITE NAMES list of pointers
  2756. 87ba8  3800  STATE TABLE
  2757. 8b3a8    20  ?
  2758. 8b3c8  2368  THING TABLE
  2759. 8d730   3fd  ?
  2760.  
  2761. [10-2]: Version 1.666 DOOM.EXE Data Segment Overview
  2762. ====================================================
  2763.  
  2764.  
  2765. [10-3]: Detail on some EXE Data Structures
  2766. ==========================================
  2767.  
  2768.   More detail on some of the data follows. The "names" of each section
  2769. are the hexadecimal offsets to the start of that data, in the registered
  2770. versions 1.2 and 1.666 of DOOM.EXE. 1.2 offsets are to the left of the
  2771. asterisk, 1.666 to the right. "Integer" means a 4-byte <long> integer
  2772. in hi-lo format, unless otherwise noted (e.g. "2-byte short integer").
  2773.  
  2774. 6f414 *** 82a14
  2775.  
  2776.   START OF DATA. Several times I'll refer to "pointers". All of these
  2777. pointers are integers. Add the values of these pointers to $6f414 or
  2778. $82a14 depending on the version, and you'll get the location of what's
  2779. being pointed to.
  2780.   Note: there's also at least one other kind of pointer in here, with
  2781. larger values, that point to a location in the code, NOT the data. I call
  2782. these "code-pointers" for now. I know it's a lame term.
  2783.  
  2784. 6f414 *** a2228
  2785.  
  2786.   TEXT STRINGS. They all start on 4-byte boundaries, i.e. at xxxx0/4/8/c.
  2787. $00 ends the string. Then the next one starts at the next boundary, so a 4
  2788. byte string is followed by $00, then 3 bytes of random junk, then the next
  2789. string.
  2790.  
  2791. 73140
  2792.  
  2793.   I think this is the last string, "TZ"
  2794.  
  2795. 73144
  2796.  
  2797.   Misc. stuff I haven't investigated. Some of it has to do with sound card
  2798. stuff and mice and joysticks, because at 7384c is "DMXGUS.INI" and at 74ba8
  2799. are pointers which point to the strings "None", "PC_Speaker", "Adlib", etc.
  2800.  
  2801. 74bf8
  2802.  
  2803.   64k of precisely ordered numbers, which leads me to believe they are
  2804. pre-calculated math tables, to speed up some floating point operations
  2805. used in the screen draw routine. Any other guesses?
  2806.  
  2807. 84bfc
  2808.  
  2809.   3 pointers to the episode 1/2/3 end texts, "Once you beat...", "You've
  2810. done it...", and "The loathsome Spiderdemon is dead..."
  2811.  
  2812. 84c24
  2813.  
  2814.   pointer to the string "doom.wad"
  2815.  
  2816. 84c74
  2817.  
  2818.   pointer to the string "default.cfg"
  2819.  
  2820. 84c78
  2821.  
  2822.   8 integers: 1, 25, 50, 24, 40, 640, 1280, 320
  2823.  
  2824. 84c98
  2825.  
  2826.   2 code-pointers
  2827.  
  2828. 84ccc
  2829.  
  2830.   29 integers, with values like 90 and 135 and 180. Angles?
  2831.  
  2832. 84d40
  2833.  
  2834.   "Gamma correction OFF", 00s, "Gamma correction level 1", ... 4. Each
  2835. occupies $1a bytes.
  2836.  
  2837. 84dc2
  2838.  
  2839.   8 text messages used to confirm quitting, each uses $50 bytes
  2840.  
  2841. 85042
  2842.  
  2843.   MENUS. I know this controls to some extent which menu pictures are used
  2844. for which menu, but I haven't figured it all out yet.
  2845.  
  2846. 853e4
  2847.  
  2848.   14 ints: 42, 22, 23, 24, 28, 29, 31, 40, zeros
  2849.  
  2850. 8541c
  2851.  
  2852.   256 bytes, values from 00-ff, no two the same, "random" order.
  2853.  
  2854. 85524
  2855.  
  2856.   The configuration options. Each is 5 integers: a pointer to a string,
  2857. like "mouse_sensitivity", a code-pointer, the default value for that
  2858. option, a 0 or 1 (1 for all the "key_" options), and a 0. It would be
  2859. pretty dense to do anything with this, I think.
  2860.  
  2861. 85890
  2862.  
  2863.   About 117 integers, with a definite structure, but I can't figure it
  2864. out, and changing/experimenting seems to do nothing.
  2865.  
  2866. 85a64
  2867.  
  2868.   21 sets of 4 bytes: 0, 0, 1, 0, 320, 168, "33", 0, 1, $(b2 26 26 2e),
  2869. $(ff 63 fd ff), a pointer that points to the $(b2...), 0, 1, "ema", 0, 0,
  2870. 1, 0, 1, "xma". All these are unchanged from version 0.99 through 1.2,
  2871. except the pointer obviously.
  2872.  
  2873. 85ab8
  2874.  
  2875.   Ints: 0, -1, -1, 0, 0, 0, 0, 4, 7, 10, 12, 14, 15, 15, 0, 0, 112, 96, 64,
  2876. 176, then 16 that are members of this set {-65536, -47000, 0, 47000, 65536},
  2877. then 4, 5, 6, 7, 0, 1, 2, 3, 8, 3, 1, 5, 7
  2878.  
  2879. 85b7c *** 95714
  2880.  
  2881.   AMMO AMOUNTS. 8 integers: 200, 50, 300, 50, 10, 4, 20, 1. The first four
  2882. are the maximum initial capacity for ammo, shells, cells, and rockets. The
  2883. backpack doubles these amounts. The second four are how many ammo in a
  2884. clip, shells, rockets/rocket, and cells/cell item. Boxes have 5x as much.
  2885.  
  2886. 859bc *** 95734
  2887.  
  2888.   AMMO TABLE. 8 sets of 6 integers (9 sets in 1.666):
  2889.  
  2890.   version 1.2                             version 1.666
  2891.  
  2892. Punch     5  4  3  2  5  0              Punch     5  4  3  2  5  0
  2893. Pistol    0 12 11 10 13 17              Pistol    0 12 11 10 13 17
  2894. Shotgun   1 20 19 18 21 30              Shotgun   1 20 19 18 21 30
  2895. Chaingun  0 34 33 32 35 38              Chaingun  0 51 50 49 52 55
  2896. Laucher   3 42 41 40 43 46              Laucher   3 59 58 57 60 63
  2897. Plasma    2 59 58 57 60 62              Plasma    2 76 75 74 77 79
  2898. BFG       2 66 65 64 67 71              BFG       2 83 82 81 84 88
  2899. Chainsaw  5 53 52 50 54  0              Chainsaw  5 70 69 67 71  0
  2900.                   Super-Shotgun   1 34 33 32 35 47
  2901.  
  2902.   The first number of each set is the ammo type. Type 5 never runs out.
  2903. The next three numbers are 3 state #s (see the STATE TABLE below) for the
  2904. pictures displayed when moving while holding that weapon. You know, the
  2905. "bobbing weapon" effect? Fifth is the first state of the "shoot" sequence
  2906. for that weapon, and last is the first state of the "firing" sequence. The
  2907. "firing" pictures are the ones that are lit up, fire coming out, etc.
  2908.  
  2909. 85c5c *** 9580c
  2910.  
  2911.   ANIMATED WALLS and FLOORS. Each is 26 bytes: an integer, a 8-byte string,
  2912. $00, a 8-byte string, $00, and a final integer.
  2913.  
  2914. 0 NUKAGE3  NUKAGE1  8
  2915. 0 FWATER4  FWATER1  8
  2916. 0 SWATER4  SWATER1  8
  2917. 0 LAVA4    LAVA1    8
  2918. 0 BLOOD4   BLOOD1   8
  2919.                <---- v1.666 has four more:  0 RROCK08  RROCK05  8
  2920. 1 BLODGR4  BLODGR1  8                               0 SLIME04  SLIME01  8
  2921. 1 SLADRIP4 SLADRIP1 8                               0 SLIME08  SLIME05  8
  2922. 1 BLODRIP4 BLODRIP1 8                               0 SLIME12  SLIME09  8
  2923. 1 FIREWALL FIREWALA 8
  2924. 1 GSTFONT3 GSTFONT1 8
  2925. 1 FIRELAVA FIRELAV3 8
  2926. 1 FIREBLU2 FIREBLU1 8
  2927. 1 ROCKRED3 ROCKRED1 8
  2928.                <---- V1.666 has four more:  1 BFALL4   BFALL1   8
  2929.                             1 SFALL4   SFALL1   8
  2930.                             1 WFALL4   WFALL1   8
  2931.                             1 DBRAIN4  DBRAIN1  8
  2932.  
  2933.   Obviously the 0/1 means floor or wall. The first string is the name of
  2934. the animation cycle's LAST listed texture, the second string is the FIRST
  2935. listed texture. The cycle includes them and all entries between them in
  2936. whichever wad file is in effect (It doesn't have to be DOOM.WAD, a pwad
  2937. with new TEXTURE1 and 2 resources works quite nicely). The final 8
  2938. doesn't seem to mean much.
  2939.  
  2940. 85dc8
  2941.  
  2942.   A -1 then a bunch of zeros, maybe space for another animation cycle?
  2943.  
  2944. 85de4 *** 95a64
  2945.  
  2946.   SWITCH WALL NAMES. Each is 20 bytes: an 8-byte string, 00, another
  2947. string, 00, and a 2-byte short integer. There are 28 switch names here
  2948. in v1.2 and 39 switch names in v1.666. When a switch is pulled, the game
  2949. checks to see if the wall texture is on this list. If it is, it changes
  2950. the wall texture to the corresponding alternate texture. The <short>
  2951. is 1, 2, or 3. 1 means it's in all versions, 2 means only registered
  2952. DOOM 1 and DOOM 2, 3 means DOOM 2 only.
  2953.  
  2954. 86028
  2955.  
  2956.   20 zeros, again, room for one more?
  2957.  
  2958. 8603c ***
  2959.  
  2960.   48 integers: 3 0 2 1 3 0 2 0 3 1 2 0 0 0 0 0
  2961.            2 0 2 1 0 0 0 0 3 1 3 0 0 0 0 0
  2962.            2 0 3 1 2 1 3 1 2 1 3 0 0 0 0 0
  2963.  
  2964. 860fc ***
  2965.  
  2966.   50 integers, all are either 50 or -50.
  2967.  
  2968. 861d0 ***
  2969.  
  2970.   5 sets of 256 bytes, each is a COLORMAP, for the gamma correction
  2971. settings OFF, 1, 2, 3, 4.
  2972.  
  2973. 866d0 ***
  2974.  
  2975.   5 integers: 1, 0, -1, 0, 0
  2976.  
  2977. 866e4 ***
  2978.  
  2979.   13 sets of 5 - 10 bytes, each set terminated by a $FF
  2980.  
  2981. 8675e ***
  2982.  
  2983.   $74 $20
  2984.  
  2985. 86760 ***
  2986.  
  2987.   13 pointers to the stuff at 866e4. An integer '0' between each pointer.
  2988.  
  2989. 867c8 ***
  2990.  
  2991.   6 integers: -1, -1, 0, -1, 0, 1
  2992.  
  2993. 867e0 ***
  2994.  
  2995.   10 pointers to the 10 default chatmacros, then 4 pointers, to "Green:",
  2996. "Indigo:", "Brown:", "Red:"
  2997.  
  2998. 86820 ***
  2999.  
  3000.   AUTOMAP LEVEL NAMES. 27 pointers to the level names used on the automap.
  3001.  
  3002. 8689c ***
  3003.  
  3004.   The ascii letters "gibr" - the keys for sending messages in multiplayer.
  3005.  
  3006. 868a8 ***
  3007.  
  3008.   SPLAT MARK COORDINATES. At what screen coordinates to place the WISPLAT
  3009. picture on the end-level screen, for th 27 levels. 54 integers, 27 pairs.
  3010. e1m1 x, e1m1 y, ..., e3m9 y.
  3011.  
  3012. 86980, 86bb0, 86da8 ***
  3013.  
  3014.   END-LEVEL MAP ANIMATIONS. Each is 14 integers. The first one is (0, 11,
  3015. 3, 224, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0). The first number is 0 for all the
  3016. ones on maps 0 and 2 (episodes 1 and 3), and it's 2 for map 1. The 11 is
  3017. always 11 except the last one of map 2 is 8. The 3 means 3 pictures are
  3018. involved in the animation, e.g WIA00100, WIA00101, and WIA00102. 224 and 104
  3019. are the x and y coordinates. The sixth number is not 0 for map 1 - it's
  3020. from 1 to 8. This controls the way the Tower of Mystery "appears". All the
  3021. other numbers are always 0.
  3022.  
  3023. 86ef8 ***
  3024.  
  3025.   Three integers, how many animations for WIMAP0, 1, 2 respectively.
  3026.  
  3027. 86f04 ***
  3028.  
  3029.   Three pointers, to the starts of the animations for WIMAP0, 1, 2
  3030. respectively.
  3031.  
  3032. 8714c ***
  3033.  
  3034.   SOUND TABLE. 61 and 1/2 sounds are listed here. Each is 9 integers: a
  3035. pointer to the string which is the sound's "name", then a 0 or 1, then
  3036. a value ranging from 32 to 128, then 0, -1, -1, 0, 0, 0. The names are
  3037. "pistol", "shotgn", ... "hoof", "metal", "chgun". Prefix DS or DP and you
  3038. get the entries in DOOM.WAD for the sound data. The "chgun" is the 1/2 -
  3039. there's no "DSCHGUN" in doom.wad, and the entry in this table is incomplete
  3040. anyway, lacking the all-important 0, -1, -1, 0, 0, 0 ending :-). There seem
  3041. to be a few glitches in the way the sounds were fit into the whole scheme,
  3042. this is just one of them.
  3043.  
  3044. 879ec ***
  3045.  
  3046.   pointer to start of SOUND TABLE.
  3047.  
  3048. 879f0 ***
  3049.  
  3050.   Integer = 150. 150 whats?
  3051.  
  3052. 87a04 ***
  3053.  
  3054.   SPRITE NAME POINTERS. 105 pointers to the strings "TROO", "SHTG", ...,
  3055. "SMRT".
  3056.  
  3057. 87ba8 *** 9834c
  3058.  
  3059.   STATE TABLE. 512 entries in v1.2, 967 entries in v1.666. Each entry
  3060. is 28 bytes in 7 integers:
  3061.  
  3062. (1)     sprite number 0-..., lookup in sprite name pointers list.
  3063. (2)     sprite frame, 0="A" in a sprite lump, 1="B", etc.
  3064. (3)     duration, how many gametics this state is displayed until
  3065.       it looks for the next. -1 (0xffffffff) is forever.
  3066. (4)     a "code pointer" which indicates what action(s) accompany
  3067.       the displaying of this state.
  3068. (5)     next state in sequence. 0 means no next state, sequence is done.
  3069. (6)     always 0, has no effect.
  3070. (7)     always 0, has no effect.
  3071.  
  3072.  
  3073. 8b3a8 ***
  3074.  
  3075.   Two integers: 1, 0, then 6 code-pointers.
  3076.  
  3077. 8b3c8 *** 9ed10
  3078.  
  3079.   THING TABLE. 103 entries in v1.2 which are each 88 bytes = 22 integers.
  3080. 136 entries in v1.666, which are each 92 bytes = 23 integers.
  3081.  
  3082. (1)     Thing number, as used in maps. See [4-2-1]. Some of them are
  3083.       equal to -1, e.g. the players' entry, and all projectiles.
  3084. (2)     "Spawn" state. State number (from STATE TABLE) for when this
  3085.       thing first appears.
  3086. (3)     Health. Inanimates can't be killed, so it doesn't apply to them.
  3087. (4)     "Moving" state. First state # of monsters pursuing, etc.
  3088. (5)     "See player" sound. For monsters who become activated. Also for
  3089.       projectiles' first sound. Note that sounds are 1-..., not 0-...
  3090.       0 indicates no sound.
  3091. (6)     Reaction Time. Lower is faster.
  3092. (7)     "Attack" sound.
  3093. (8)     "Pain" state.
  3094. (9)     Painchance. The chance out of 256 that a monster will be disrupted
  3095.       when it gets hurt. Otherwise, they keep attacking.
  3096. (10)    "Pain" sound.
  3097. (11)    "Close attack" state.
  3098. (12)    "Distance attack" state.
  3099. (13)    "Death" state, or "explode" for projectiles.
  3100. (14)    "Explosive death" state, only some monsters can be "mushed".
  3101. (15)    "Death" sound, or "explode" for projectiles.
  3102. (16)    Speed of movement. Projectiles' speed are * 65536.
  3103. (17)    Horizontal size (radius) * 65536
  3104. (18)    Height * 65536
  3105. (19)    Mass
  3106. (20)    Missile damage. Also, the Lost Soul has a 3 here, for it's attack.
  3107. (21)    "Act" sound, for wandering monsters.
  3108. (22)    Flags, see below
  3109. (23)    "Respawn" state, for monsters being ressurected. VERSION 1.666 ONLY
  3110.  
  3111.   Flags. 0 = condition is false. 1 = condition is true.
  3112.  
  3113.   bit   flagname        effect on thing
  3114.  
  3115.   0     Special         it is a gettable thing (ammo, health, etc.)
  3116.   1     Solid           creatures can't pass through (but projectiles can)
  3117.   2     Shootable       can be hurt (note barrels have this set)
  3118.   3     NoSector        totally invisible
  3119.   4     NoBlockmap
  3120.   5
  3121.   6     (InPain)        ?
  3122.   7
  3123.   8     SpawnCeiling    hung from ceiling
  3124.   9     NoGravity       floating monsters and not-on-ground things
  3125.   10    Dropoff         doesn't automatically hug floor if "jump" off ledge
  3126.   11    Pickup          can pick up gettable items
  3127.   12    (NoClip)        walks through walls
  3128.   13
  3129.   14    Float           floating monsters
  3130.   15    (Semi-NoClip)   climb tall steps
  3131.   16    Missile         projectiles
  3132.   17    (Disappearing   ?
  3133.      Weapon)
  3134.   18    Shadow          semi-invisible like Spectres
  3135.   19    NoBlood         uses PUFF instead of BLUD when hurt (e.g. barrels)
  3136.   20    (SlideHelpless) ?
  3137.   21
  3138.   22    CountKill       Monster: counts toward KILLS ratio on inter-level
  3139.   23    CountItem       Artifact: counts toward ITEMS on inter-level screen
  3140.   24    (Running)       ?
  3141.   25    NotDMatch       this thing doesn't get spawned in deathmatch modes
  3142.   26    Color0          \ 00 = green stays green  01 = change to dark greys
  3143.   27    Color1          / 10 = change to browns   11 = change to dark reds
  3144.   28-                   unused
  3145.  
  3146. 8d730 *** n/a
  3147.  
  3148.   Misc junk I can't figure out.
  3149.  
  3150. 8db27 *** a7b99
  3151.  
  3152.   End of DOOM.EXE
  3153.  
  3154.  
  3155. ------------------------------------------------------------
  3156. APPENDIX [A-1]: Backus-Naur Form definitions of WAD elements
  3157. ------------------------------------------------------------
  3158.  
  3159.   The descriptions below use a modified Backus-Naur Form (BNF) notation.
  3160. Each entry looks like
  3161.  
  3162. <keyword>       := description          ;type or comment (optional)
  3163.            description cont'd.  ;type or comment (optional)
  3164.  
  3165.   Descriptions composed of more than one sequential keyword or element
  3166. are usually listed with one element per line. This is for clarity and also
  3167. allows each succesive element to be assigned different types without extra
  3168. lines.
  3169.  
  3170. <keyword>       := <whatever>           ;<type>
  3171.  
  3172.   is a shorthand for
  3173.  
  3174. <keyword>       := <whatever>
  3175. <whatever>      := <type>
  3176.  
  3177.   The description is one or more of the following predefined types,
  3178. and/or previously or subsequently defined keywords.
  3179.  
  3180. <byte>          is an unsigned 8-bit integer (0 to 255).
  3181. <char>          is a signed 8-bit integer (-128 to 127).
  3182. <ushort>        is an unsigned 16-bit integer in lo-hi format (0 to 65535)
  3183. <short>         is a signed 16-bit integer (-32768 to 32767).
  3184. <long>          is a signed 32-bit integer (-2147483648 to 2147483647).
  3185. <string8>       is an ASCII string of from 1 to 8 bytes. If its length is
  3186.           less than 8 bytes, the remainder are zeros (hex 00).
  3187.  
  3188.   Any of these may be followed by a range: <byte:1..99> means a byte
  3189. restricted to the range 1 to 99 inclusive. A single number means that
  3190. value is literally included: <byte:192> inserts that 8-bit value.
  3191.  
  3192.   { } are used to enclose a group of elements.
  3193.  
  3194.   | is used to separate choices - exactly one of the choices applies.
  3195.  
  3196.   [ ] are used following an element or group of elements to indicate
  3197. an array. Usually a literal value or a keyword will be used to denote
  3198. how many members the array has. <rook> [666] means that the element
  3199. <rook> is repeated 666 times in sequence. {<Scylla> <Charybdis>} [zeus]
  3200. means that whatever the value of <zeus> is, there are that many pairs
  3201. of <Scylla> and <Charybdis>. [1..16] indicates the value may be from
  3202. 1 to 16 inclusive, and [...] indicates an indefinite number.
  3203.  
  3204.   A literal string "ABCD" may appear, in which case those ASCII characters
  3205. are directly inserted.
  3206.  
  3207. ------
  3208.  
  3209. <WAD file>      := "PWAD"|"IWAD"
  3210.            <numlumps>
  3211.            <infotableofs>
  3212.            <lumps>
  3213.            <directory>
  3214.  
  3215. <numlumps>      := <long>               ;number of lumps in WAD file
  3216. <infotableofs>  := <long>               ;file offset to directory start
  3217.  
  3218. <lumps>         := <lump> [numlumps]
  3219. <lump>          :=                      ;see different kinds below
  3220.  
  3221. <directory>     := {<lumpinfo> | <otherinfo>} [numlumps]
  3222. <lumpinfo>      := <filepos>            ;<long>
  3223.            <size>               ;<long>
  3224.            <name>               ;<string8>
  3225.  
  3226. <otherinfo>     := <marker> | <label>
  3227. <marker>        := <dummynumber>        ;<long> with any value
  3228.            <long:0>
  3229.            <"S_START" | etc>    ;<string8>
  3230.  
  3231. <label>         := {<"E"> <episode> <"M"> <mission>} | {<"MAP"> <level>}
  3232. <episode>       := "1"|"2"|"3"
  3233. <mission>       := "1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
  3234. <level>         := "01"|"02"|"03"|"04"|"05"|"06"|"07"|"08"|"09"|"10"
  3235.            |"11"|"12"|"13"|"14"|"15"|"16"|"17"|"18"|"19"|"20"
  3236.            |"21"|"22"|"23"|"24"|"25"|"26"|"27"|"28"|"29"|"30"
  3237.            |"31"|"32"
  3238.  
  3239. ------
  3240. different kinds of lumps:
  3241. ------
  3242.  
  3243. <PLAYPAL>       := <palette> [14]
  3244. <palette>       := {<red> <green> <blue>} [256]
  3245. <red>           := <byte>
  3246. <green>         := <byte>
  3247. <blue>          := <byte>
  3248.  
  3249. ------
  3250.  
  3251. <COLORMAP>      := <color_map> [34]
  3252. <color_map>     := <mapping> [256]
  3253. <mapping>       := <byte>
  3254.  
  3255. ------
  3256.  
  3257. <ENDOOM>        := <character_cell> [1000]
  3258. <character_cell>:= <color_attributes>           ;<byte>
  3259.            <character>                  ;<byte>
  3260.  
  3261. ------
  3262.  
  3263. <demo>          := <header>
  3264.            <gametic_data>
  3265.            <byte:128>
  3266. <header>        := {<header_12> | <header_16>}  ;different versions
  3267. <header_12>     := <skill>
  3268.            <episode>
  3269.            <map>
  3270.            <player> [4]
  3271. <header_16>     := <version>
  3272.            <skill>
  3273.            <episode>
  3274.            <map>
  3275.            <mode>
  3276.            <respawn>
  3277.            <fast>
  3278.            <nomonsters>
  3279.            <viewpoint>
  3280.            <player> [4]
  3281. <skill>         := <byte:0..4>
  3282. <episode>       := {<byte:1..3> | <byte:1>}     ;DOOM 1 or DOOM 2
  3283. <map>           := {<byte:1..9> | <byte:1..32>} ;DOOM 1 or DOOM 2
  3284. <player>        := <byte:0..1>          ;0 means not present, 1 means present
  3285. <version>       := <byte:104..106>      ;versions 1.4, 1.5, 1.6 (also 1.666)
  3286. <mode>          := <byte:0..2}          ;cooperative|deathmatch|altdeath
  3287. <respawn>       := <byte>               ;0 is off, non-zero is on
  3288. <fast>          := <byte>               ;0 is off, non-zero is on
  3289. <nomonsters>    := <byte>               ;0 is off, non-zero is on
  3290. <viewpoint>     := <byte:0..3>          ;shown from this player's view
  3291.  
  3292. <gametic_data>  := <gametic> [...]
  3293. <gametic>       := <player_move> [1..4] ;1-4 is # of players present in demo
  3294. <player_move>   := <forward>            ;<char>
  3295.            <strafe>             ;<char>
  3296.            <turn>               ;<char>
  3297.            <use>                ;<byte>
  3298.  
  3299. ------
  3300.  
  3301. <GENMIDI>       := "#OPL_II#"
  3302.            <instr_data> [150]
  3303.            <instr_name> [150]
  3304. <instr_data>    := <byte> [36]          ;format unknown to me
  3305. <instr_name>    := <byte> [32]          ;padded with 0s
  3306.  
  3307. ------
  3308.  
  3309. <DMXGUS>        := pointless to describe here, see section [7-5]
  3310.  
  3311. ------
  3312.  
  3313. <song>          := "MUS"
  3314.            <byte:26>
  3315.            <music_length>       ;<ushort>
  3316.            <music_start>        ;<ushort>
  3317.            <primary_channels>   ;<ushort>
  3318.            <secondary_channels> ;<ushort>
  3319.            <num_instr_patches>  ;<ushort>
  3320.            <ushort:0>
  3321.            <instr_patches>
  3322.            <music data>
  3323. <instr_patches> := <instr_patch> [num_instr_patches]
  3324. <instr_patch>   := <ushort>             ;Drum patch #s 28 less than in DMXGUS
  3325.  
  3326. <music data>    := ???
  3327.  
  3328. ------
  3329.  
  3330. <soundeffect>   := <ushort:3>
  3331.            <ushort:11025>       ;sampling rate
  3332.            <num_samples>        ;<ushort>
  3333.            <ushort:0>
  3334.            <samples>
  3335. <samples>       := <sample> [num_samples]       ;<byte>
  3336.  
  3337. ------
  3338.  
  3339. <PC_sound>      := <ushort:0>
  3340.            <num_PC_samples>     ;<ushort>
  3341.            <PC_samples>
  3342. <PC_samples>    := <PC_sample> [num_PC_samples]
  3343. <PC_sample>     := <byte>               ;seem to range [0..96]
  3344.  
  3345. ------
  3346.  
  3347. <TEXTURE1>      := <num_textures>       ;<long>
  3348.            <tex_offsets>
  3349.            <tex_entries>
  3350. <tex_offsets>   := <tex_offset> [num_textures]
  3351. <tex_offset>    := <long>
  3352. <tex_entries>   := <tex_entry> [num_textures]
  3353. <tex_entry>     := <tex_name>           ;<string8>
  3354.            <short:0>
  3355.            <short:0>
  3356.            <tex_width>          ;<short>
  3357.            <tex_height>         ;<short>
  3358.            <short:0>
  3359.            <short:0>
  3360.            <num_patches>        ;<short>
  3361.            <patches>
  3362. <patches>       := <patch> [num_patches]
  3363. <patch>         := <x_offset>           ;all are <short>
  3364.            <y_offset>
  3365.            <pname_number>       ;lookup in <PNAMES> for picture
  3366.            <short:1>            ;supposedly <stepdir>
  3367.            <short:0>            ;supposedly <color_map>
  3368.  
  3369. ------
  3370.  
  3371. <PNAMES>        := <num_pnames>         ;<long>
  3372.            <pnames>
  3373. <pnames>        := <pname> [num_pnames]
  3374. <pname>         := <string8>]           ;match the <name> from the
  3375.                     ;<lumpinfo> of a <picture>
  3376.  
  3377. ------
  3378.  
  3379. <picture>       := <header>
  3380.            <pointers>           ;offsets to <column> starts
  3381.            <pixel_data>
  3382. <header>        := <width>              ;all are <short>
  3383.            <height>
  3384.            <left_offset>
  3385.            <top_offset>
  3386. <pointers>      := <pointer> [width]    ;<long>
  3387. <pixel_data>    := <column> [width]
  3388. <column>        := <post> [...]
  3389.            <byte:255>           ;255 (0xff) ends the column
  3390. <post>          := <rowstart>           ;<byte>
  3391.            <num_pixels>         ;<byte>
  3392.            <unused>             ;<byte>
  3393.            <pixels>
  3394.            <unused>             ;<byte>
  3395. <pixels>        := <pixel> [num_pixels] ;<byte>
  3396.  
  3397. ------
  3398.  
  3399. <flat>          := <colorbyte> [4096]   ;<byte>
  3400.  
  3401. ------
  3402.  
  3403. <maplevel>      := <THINGS>
  3404.            <LINDEDEFS>
  3405.            <SIDEDEFS>
  3406.            <VERTEXES>
  3407.            <SEGS>
  3408.            <SSECTORS>
  3409.            <NODES>
  3410.            <SECTORS>
  3411.            <REJECT>
  3412.            <BLOCKMAP>
  3413.  
  3414. <THINGS>        := <thing> [...]
  3415. <thing>         := <x_position>         ;all are <short>
  3416.            <y_position>
  3417.            <angle>
  3418.            <type>
  3419.            <options>
  3420.  
  3421. <LINEDEFS>      := <linedef> [...]
  3422. <linedef>       := <vertex_start>       ;all are <short>
  3423.            <vertex_end>
  3424.            <flags>
  3425.            <function>
  3426.            <tag>
  3427.            <sidedef_right>
  3428.            <sidedef_left>       ;if <short: -1> there's no left side
  3429.  
  3430. <SIDEDEFS>      := <sidedef> [...]
  3431. <sidedef>       := <xoffset>            ;<short>
  3432.            <yoffset>            ;<short>
  3433.            <uppertexture>       ;<string8>
  3434.            <lowertexture>       ;<string8>
  3435.            <middletexture>      ;<string8>
  3436.            <sector_ref>         ;<short>
  3437.  
  3438. <VERTEXES>      := <vertex> [...]
  3439. <vertex>        := <X_coord>            ;both are <short>
  3440.            <Y_coord>
  3441.  
  3442. <SEGS>          := <seg> [...]          ;<segs> stored by <subsector> order
  3443. <seg>           := <vertex_start>       ;all are <short>
  3444.            <vertex_end>
  3445.            <bams>
  3446.            <line_num>
  3447.            <segside>
  3448.            <segoffset>
  3449.  
  3450. <SSECTORS>      := <subsector> [...]
  3451. <subsector>     := <numsegs>            ;both are <short>
  3452.            <start_seg>
  3453.  
  3454. <NODES>         := <node> [...]
  3455. <node>          := <x>                  ;first four are <short>
  3456.            <y>
  3457.            <dx>
  3458.            <dy>
  3459.            <bbox> [2]
  3460.            <child> [2]
  3461. <bbox>          := <boxtop>             ;all are <short>
  3462.            <boxbottom>
  3463.            <boxleft>
  3464.            <boxright>
  3465. <child>         := <ushort>             ;if 0x8000 it's a subsector
  3466.  
  3467. <SECTORS>       := <sector> [...]
  3468. <sector>        := <floorheight>        ;<short>
  3469.            <ceilingheight>      ;<short>
  3470.            <floorpic>           ;<string8>
  3471.            <ceilingpic>         ;<string8>
  3472.            <lightlevel>         ;<short>
  3473.            <special_sector>     ;<short>
  3474.            <tag>                ;<short>
  3475.  
  3476. <REJECT>        := <bitarray>           ;see [4-10] for this one
  3477.  
  3478. <BLOCKMAP>      := <xorigin>            ;<short>
  3479.            <yorigin>            ;<short>
  3480.            <xblocks>            ;<short>
  3481.            <yblocks>            ;<short>
  3482.            <listoffsets>
  3483.            <blocklists>
  3484. <listoffsets>   := <listoffset> [numofblocks]
  3485. <listoffset>    := <ushort>
  3486. <numofblocks>   := <short>              ;note it equals <xblocks> * <yblocks>
  3487. <blocklists>    := <blocklist> [numofblocks]
  3488. <blocklist>     := <short: 0>           ;for dynamic thinglist pointer
  3489.            <lines_in_block>
  3490.            <short: -1>
  3491. <lines_in_block>:= <linedef_num> [...]  ;the numbers of all the <linedef>s
  3492.                     ;that are in the block
  3493. <linedef_num>   := <short>
  3494.  
  3495.  
  3496. ----------------------------------
  3497. APPENDIX [A-2]: DOOM engine limits
  3498. ----------------------------------
  3499.  
  3500. Maximum width of a TEXTURE = NONE?
  3501. Maximum height of a TEXTURE = 128
  3502. Maximum edges in display that can have their sides rendered = 128 in 1.2
  3503.                                   256 in 1.6+
  3504. Maximum blocks in a BLOCKMAP = about 13000, or 113 * 113
  3505. Maximum THINGS in view at once = 64, extras are not drawn
  3506. Maximum patches on a texture used on a
  3507.   2Sided "middle" texture before "medusa" effect = 1
  3508. Maximum # of "plats" = 30 (up/down moving floors, and lifts)
  3509.  
  3510. Maximum # of "scrolling" walls per level (line type 48) = 64
  3511.  
  3512.  
  3513. -------------------------------------------
  3514. APPENDIX [A-3]: DOOM.WAD changes and errors
  3515. -------------------------------------------
  3516.  
  3517.   There are some imperfections in the DOOM.WAD file. All versions up
  3518. to 1.666 have the SW18_7 lump included twice. Versions before 1.666
  3519. have the COMP03_8 lump twice. And with version 1.666 somebody really
  3520. messed up, because every single DP* and DS* and D_* lump that's in
  3521. the shareware DOOM1.WAD is in the registered DOOM.WAD twice. The error
  3522. doesn't adversely affect play in any way, but it does take up an
  3523. unnecessary 800k on the hard drive.
  3524.  
  3525.   Some of the lumps in the sprite section are unused. Versions before
  3526. 1.666 had PBULx0 and PSHEx0, x=A-B, which were pictures of bullet and
  3527. shell casings being ejected after the player fired a weapon (this
  3528. feature was obviously removed). Also there were four more "fireball"
  3529. sprite-lump sets: BAL3x0, BAL4x0, x=A-E, and BAL5x0 and BAL6x0, x=A-B.
  3530. The only unused lump left in 1.666 is SMT2A0, which is a small grey
  3531. stalagmite, similar to the SMIT sprite which is THING #47. There are
  3532. some new sprite lumps in version 1.666 of DOOM 1 which are "semi-unused"
  3533. because they aren't used in DOOM 1, but they ARE used in DOOM 2. They
  3534. are all projectile sprites, so it's probably just a little leftover
  3535. from compiling the WAD.
  3536.  
  3537.   So, in case it might help with converting demos, or for any other
  3538. reason, here is a list, entirely by Paul Falstad, of all the changes
  3539. to the levels between DOOM 1.2 and DOOM 1.666. The 1.4 and 1.5 beta's
  3540. levels are in most if not all respects identical to 1.666's - I haven't
  3541. checked.
  3542.  
  3543. E1M2
  3544. - Linedef #530 changed from a door that closes to one that stays open.
  3545.   This is the south side of the door out of the maze.  This allows
  3546.   deathmatch players who started in there to get out from the inside.
  3547.  
  3548. E1M4
  3549. - The swastika got changed to a different shape.  A bunch of things in
  3550.   the swastika room got moved around to accomodate the new layout.
  3551. - Thing #185 (a deathmatch start position) got moved from (768, 1952) to
  3552.   (736, 1824).  This is in the room with the ledge NW of the player 1
  3553.   starting room; the deathmatch start got moved off the ledge onto the
  3554.   main floor.
  3555.  
  3556. E1M5
  3557. - Thing #216 (a deathmatch start) got moved from (-2112, 512) to
  3558.   (-800, 1200); that is, it got moved from the west courtyard (the one
  3559.   with the supercharger) to the hidden hallway just south of the pentagram.
  3560. - Sector #105's floor was lowered from 88 to 80.  In other words, the
  3561.   window west of the yellow keycard was enlarged a bit.  Also, the
  3562.   associated linedefs are no longer marked impassable.
  3563.  
  3564. E1M6
  3565. - Thing #116 (the sargeant in the middle of void space in the southeast
  3566.   corner of the map) got removed.
  3567. - Sectors #139 and #142 got their floor changed from FLOOR0_6 to FLOOR4_8
  3568.   for consistency with the surrounding sectors.  (These are the floors
  3569.   underneath the yellow doors on the northwest and northeast corners
  3570.   of one of the rooms.)
  3571.  
  3572. E1M7
  3573. - Linedef #782 was type 0; now it's type 31 (door that stays open).
  3574.   This is south side of the last door before the exit door; it can now
  3575.   be opened from the inside, so a deathmatch player that started in the
  3576.   exit room can get out.
  3577.  
  3578. E1M8
  3579. - The computer map in the pentagram got changed to a shotgun.
  3580. - Linedefs 35, 136, and 140 no longer have their upper textures unpegged.
  3581.   This is the secret door to the supercharger; it now looks like a real
  3582.   door when it opens.
  3583. - A secret door was added in the east baron's alcove. When you push on
  3584.   the east wall, a secret chamber opens with a switch.  That switch
  3585.   lowers the lift to the south, so that you can get back into the complex.
  3586.   (Though you could anyway, by jumping through the window on the west or
  3587.   east side of the hallway south of the lift...)
  3588.   Actually, it lowers the lift to the lowest adjacent floor, which
  3589.   (after the two barons are dead) is lower than the hallway floor
  3590.   height.  Probably not the intended effect.
  3591. - Vertex #223 got moved ever so slightly NW for some reason.
  3592.  
  3593. E2M4
  3594. - Northwest of the big green "O", there is a secret room with partial
  3595.   invisibility.  The door to the room closes when you walk north through
  3596.   a hallway just southwest of it; you're supposed to shoot the door to
  3597.   open it.  However, if you run north quickly over the trigger line and
  3598.   then run east through the door, you can just make it before the door
  3599.   closes, but in 1.2 you'd be trapped inside, since the door would not
  3600.   open from the east side.  In 1.666, the linedef type of the east edge
  3601.   of the door has been changed so that you can open the door from inside
  3602.   the secret room.
  3603.  
  3604. E3M1
  3605. - Sector 8's trigger number is now 0.  Previously, it was 6, which is the
  3606.   same number as one of the lines you walk over when getting the shotgun.
  3607.   This line would cause the floor to be lowered.  However, sector 8's floor
  3608.   is already lower than that of any adjacent sectors, so nothing happened.
  3609.  
  3610. E3M4
  3611. - Sidedefs 1327 and 1332 had their texture offsets fixed.  These are
  3612.   the sidedefs on either side of the window between the room with the
  3613.   beserker and the room with two spectres and a teleporter, east of
  3614.   the player one starting point.  Now, the window looks better than it
  3615.   did before, but still not perfect.
  3616.  
  3617. E3M6
  3618. - There is now a BFG9000 sitting in the northwest window in the building
  3619.   which you're facing at the start of the level.  It only appears in
  3620.   multiplayer mode.
  3621. - The structure which has the switch leading to the secret level had its
  3622.   north wall thickened, so that you can't trigger the switch from outside
  3623.   of the structure.
  3624.  
  3625.  
  3626. ------------------------------------
  3627. APPENDIX [A-3]: A BLOCKMAP algorithm
  3628. ------------------------------------
  3629.  
  3630. this section is being removed
  3631.  
  3632. ---------------------------------------
  3633. APPENDIX [A-4]: Other helpful documents
  3634. ---------------------------------------
  3635.  
  3636.   There are several other excellent sources of information about
  3637. DOOM, editing DOOM levels, changing the DOOM.EXE, and pwads.
  3638. Some of the following items get widely distributed (BBS, Usenet,
  3639. online services, FTP) and some don't. Three prominent FTP sites
  3640. with huge quantities of doom-related material are:
  3641.  
  3642.     infant2.sphs.indiana.edu    /pub/doom and subdirectories
  3643.                   (../wad_edit/text has most documents)
  3644.     wuarchive.wustl.edu         /pub/msdos_uploads/games/doomstuff
  3645.     ftp.uwp.edu                 /pub/incoming/id
  3646.                 /pub/msdos/games/id/home-brew/doom
  3647.  
  3648.   The infant2 site also has a number of mirrors.
  3649.   As time passes, newer versions of these documents may be released,
  3650. and/or the file names will change:
  3651.  
  3652. DESIGN12.ZIP    Level Design FAQ, edited by Tom Neff
  3653.           Truly has lots of good questions, and good answers,
  3654.           to common questions related to level design. Covers
  3655.           the simple stuff, and some of the most advanced
  3656.           topics too. Also, it is editor-nuetral, i.e. it
  3657.           does not restrict itself to any single level editor.
  3658.           Highly recommended.
  3659.  
  3660. DMFAQ666.ZIP    The Official DOOM FAQ 6.666 by Hank Leukart.
  3661.           A huge collection of information about the history
  3662.           of DOOM, notes on game play, and lists of add-on
  3663.           utilities available to enhance play.
  3664.  
  3665. DOOMBSP.ZIP     The source code from id's bsp routines, which build
  3666.           the NODES structure and the REJECT and BLOCKMAP too.
  3667.           If you want to see C, here it is.
  3668.  
  3669. METRICS.ZIP     "DOOM Metrics", by Scott Amspoker. Has some more info
  3670.           and more explanations related to [4-2-2]: Thing Sizes,
  3671.           and how monsters prefer stairs that aren't too steep.
  3672.  
  3673. TEXPATCH.ZIP    Textures To Patches, by Gregory Lewis. Shows the
  3674.           patch composition of every texture in registered
  3675.           DOOM.
  3676.  
  3677. TEXTURES.ZIP    "Managing Textures and the Unpegged Attribute", by
  3678.           Scott Amspoker. Explains in great depth how textures
  3679.           are drawn on walls, how the unpegged flag works, and
  3680.           how texture offsets apply.
  3681.  
  3682. DH200.ZIP       DOOM.EXE Hack Editor, by Greg Lewis. This program
  3683.           allows changes to be made to the DOOM.EXE file and
  3684.           they can be saved/loaded via patch files. The thing
  3685.           and frame tables (discussed in chapter [10]) are the
  3686.           main emphasis of this excellent utility.
  3687.  
  3688. ???             "Fun with Dehacked", edited by Dan Lottero. Has a lot
  3689.           of tips and tricks for using the DOOM.EXE Hack Editor
  3690.           (dehacked).
  3691.  
  3692. ???             "Blackadder's DeHackEd Patch Reviews", by Michael Adcock.
  3693.           Last updated 24Jul94?
  3694.  
  3695. ???             "DOOM Deathmatch Wad Ranking", by James Dicke and Jim
  3696.           Urbas. Is a good system for rating how good and how
  3697.           fun deathmatch play is on pwads. If you want to find
  3698.           the best deathmatch levels, this is a good place to
  3699.           start.
  3700.  
  3701. ???             pwad review documents and lists.
  3702.  
  3703. ???             "The unofficial LMP format description 1.0", by
  3704.           Uwe Girlich
  3705.  
  3706. -------------------------------
  3707. APPENDIX [A-5]: Acknowledgments
  3708. -------------------------------
  3709.  
  3710.   The following people either brought mistakes to my attention, or
  3711. provided additional information that I've incorporated into these
  3712. specs. Thanks for all the help! Sorry if I left anyone out.
  3713.   If you have any comments or questions, have spotted any errors,
  3714. or have any possible additions, please send me e-mail. If you've
  3715. contacted me before, please note my new address (msfell@aol.com).
  3716.  
  3717. id Software
  3718.     Created DOOM, added the -file parameter, used a simple format
  3719.     for the WAD, and occasionaly released specifications and
  3720.     technical information about DOOM and DOOM 2 :-)
  3721.  
  3722. All PWAD designers and doom-utility programmers everywhere!
  3723.  
  3724. Coleman Reed Ammerman (cammer@cs.tamu.edu) and John Wolsh
  3725.     They were the first to document the DEMO format.
  3726.  
  3727. Scott Amspoker (scott@bbx.basis.com)
  3728.     Wrote the METRICS and TEXTURES articles.
  3729.  
  3730. Jeff Bird (jeff@wench.ece.jcu.edu.au)
  3731.     Good ideas about the NODES, and a blockmap algorithm.
  3732.  
  3733. Alistair Brown (A.D.Brown@bradford.ac.uk)
  3734.     Helped me understand the NODES and explained REJECT.
  3735.  
  3736. Frans P. de Vries (fpdevries@hgl.signaal.nl)
  3737.     The cool ASCII DOOM logo used for the header. Also, gave a
  3738.     comprehensive list of typos and mistakes in the 1.3 specs.
  3739.  
  3740. Paul Falstad (pjf@crash.cts.com)
  3741.     I got ALL of the [8-6-1] information from his messages.
  3742.  
  3743. Robert Fenske (rfenske@swri.edu)
  3744.     Passed along a great linedef flag list. Also helped with linedef
  3745.     types, blockmap, special sectors, and general suggestions.
  3746.  
  3747. Nelson Fernandez Jr. (nelson@netcom.com)
  3748.     Distributed information about savegame files.
  3749.  
  3750. Uwe Girlich (girlich@aix520.informatik.uni-leipzig.de)
  3751.     Wrote "The unofficial LMP format description 1.0"
  3752.  
  3753. Stuart Herbert (ac3slh@sunc.sheffield.ac.uk)
  3754.     Clarifying how pegged/unpegged flags work.
  3755.  
  3756. Herre de Jonge (herre@morra.et.tudelft.nl)
  3757.     First pointed out the stairs mistake in the 1.3 specs.
  3758.  
  3759. Tom Klok (a344@mindlink.bc.ca)
  3760.     DMXGUS and MUS file format info.
  3761.  
  3762. Bernd Kreimeier (bernd@nero.uni-bonn.de)
  3763.     Wrote DMADDS11. Sprites, savegames, sounds, and lots of other help.
  3764.  
  3765. Steve Larsen (larsen@sunset.cs.utah.edu)
  3766.     Several patches for the DOOM.EXE file
  3767.  
  3768. Hank Leukart (ap641@cleveland.freenet.edu)
  3769.     Edits the DOOM FAQ and distributes these specs!
  3770.  
  3771. Greg Lewis (gregl@umich.edu)
  3772.     Wrote DeHackEd, and gave lots of info on EXE variables.
  3773.  
  3774. Joel Lucsy (jjlucsy@mtu.edu)
  3775.     Info on COLORMAP and PLAYPAL.
  3776.  
  3777. Sean Malloy (malloy@nprdc.navy.mil)
  3778.     Step-by-step proof of exactly how stairs work.
  3779.  
  3780. John A. Matzen (jamatzen@cs.twsu.edu)
  3781.     Instrument names in GENMIDI.
  3782.  
  3783. Steve McCrea (sm@eng.cam.ac.uk)
  3784.     Animated textures and textures larger than 256 wide.
  3785.  
  3786. Brian McKimens (samneric@connected.com)
  3787.     Comprehensive work on linedefs' function types.
  3788.  
  3789. Tom Neff (tneff@panix.com)
  3790.     Edits (writes) the DESIGNxx.FAQ. Suggested BNF and wrote the
  3791.     intro to [A-1]. Created the WIF text standard. General advice.
  3792.  
  3793. Tom Nettleship (mastn@midge.bath.ac.uk)
  3794.     Explained BSP trees in comp.graphics.algorithms messages.
  3795.  
  3796. Elias Papavassilopoulos (ep104@cus.cam.ac.uk)
  3797.     Tons of technical info on EXE files in general and DOOM.EXE.
  3798.  
  3799. Robert D. Potter (potter@bronze.lcs.mit.edu)
  3800.     Theory about what BLOCKMAP is for and how the engine uses it.
  3801.  
  3802. Raphael Quinet (eedraq@chapelle.ericsson.se)
  3803.     Lots of rigorous contributions on linedef types and special
  3804.     sectors. Not to mention DEU!
  3805.  
  3806. Colin Reed (dyl@cix.compulink.co.uk)
  3807.     I had the x upper and lower bounds for node bounding boxes
  3808.     backwards a few versions ago.
  3809.  
  3810. Joost Schuur (jschuur@studserv.zdv.uni-tuebingen.de)
  3811.     Runs the doom-editing mailing list.
  3812.  
  3813. Steve Simpson (ssimpson@world.std.com)
  3814.     Corrected an error in the PNAMES section
  3815.  
  3816. S. Sproston (S.Sproston-SE2@cs.bham.ac.uk)
  3817.     Excellent work on linedef types.
  3818.  
  3819. Matt Tagliaferri (matt.tagliaferri@pcohio.com)
  3820.     Pointed out omission of TEXTURE1/2 pointer table in the 1.1
  3821.     specs. Also provided a good BLOCKMAP algorithm.
  3822.  
  3823. Ted Vessenes (tedv@geom.umn.ed)
  3824.     I had the THING angles wrong in the original specs.
  3825.  
  3826. You! Thanks for reading the "Unofficial" DOOM Specs!
  3827.  
  3828.