home *** CD-ROM | disk | FTP | other *** search
/ Shadow Warrior / SWARRIOR.bin / goodies / doc / ADVANCED.TXT next >
Text File  |  1997-08-25  |  17KB  |  326 lines

  1. --------------------------------------
  2. Advanced Shadow Warrior Mapping Topics
  3. Written By Keith Schuler
  4. (c) 1997 3D Realms Entertainment
  5. --------------------------------------
  6.  
  7. This briefly documents some of the more advanced topics in Shadow Warrior
  8. mapping. Almost all of these are demonstrated to some degree in EXAMPLE.MAP
  9. (found on your Shadow Warrior CD in the \GOODIES\TOOLS directory).
  10.  
  11. Refer to these documents in the \GOODIES\DOC directory on your Shadow
  12. Warrior CD for other important information:
  13.  
  14. ADVANCED.TXT - Brief explanations of room-over-room, sector objects, and
  15. other advanced Shadow Warrior mapping topics.
  16. EDITART.TXT  - Instructions and reference for using the EDITART program.
  17. EXAMPLE.TXT  - Documentation to accompany EXAMPLE.MAP, which includes
  18. demonstrations of almost all of Shadow Warrior's map functionality.
  19. SLABSPRI.TXT - Instructions and reference for using the SLABSPRI program.
  20. SWSOUNDS.TXT - An index of the sound effects and ambient sounds.
  21. SPRITAGS.TXT - Sprite tagging reference. Your guide to all the special
  22. sprites in Shadow Warrior and how to use them.
  23. SWBUILD.TXT  - A tutorial and reference guide to using the BUILD editor.
  24. WALLTAGS.TXT - Wall and sector tagging reference. These are all the wall and
  25. sector tags used in Shadow Warrior.
  26. -----------------------------------------------------------------------------
  27.  
  28. Timing Vators                                                   1
  29. Room-Over-Room                                                  2
  30.         How It Works                                            2.1
  31.                 BOUND_FLOOR_BASE_OFFSET and BOUND_FLOOR_OFFSET  2.1.1
  32.                 VIEW_LEVEL1 and VIEW_LEVEL2                     2.1.2
  33.                 The Floor Mirror                                2.1.3
  34.         The Rules Of Construction                               2.2
  35.                 BOUND_FLOOR_BASE_OFFSET and BOUND_FLOOR_OFFSET  2.2.1
  36.                 VIEW_THRU_FLOOR and VIEW_THRU_CEILING           2.2.2
  37.                 VIEW_LEVEL1 and VIEW_LEVEL2                     2.2.3
  38.                 Raising ceilings and lowering floors            2.2.4
  39.                 Z heights and overlap                           2.2.5
  40. Advanced Room-Over-Room                                         3
  41.         Visible Ceilings And Floors                             3.1
  42.         Translucent Water                                       3.2
  43.         Sloping Room-Over-Room                                  3.3
  44. Sector Objects                                                  4
  45.         Rules of construction                                   4.1
  46.                 The Wall Loop                                   4.1.1
  47.                 The Bounding Box                                4.1.2
  48.                 The Center Sector Lotag                         4.1.3
  49.                 The Center Sector Hitag                         4.1.4
  50.                 Sector Object Limitations                       4.1.5
  51.         What Can You Do With It                                 4.2
  52.                 Follow A Track                                  4.2.1
  53.                 Auto Turret                                     4.2.2
  54.                 Driveables                                      4.2.3
  55.                 Bind It Across Floors                           4.2.4
  56. SWSAVE                                                          5
  57.  
  58. ---------------------
  59. 1.      Timing Vators
  60. ---------------------
  61.  
  62. Timing vators can be used to time events, cause things to happen after a
  63. pause, or whatever. A timing vator is usually just a small sector somewhere
  64. that the player can't get into. A SECT_VATOR (hitag 92) ST1 in the sector
  65. has a TAG6 match equal to the event you want to trigger. Adjust the speed or
  66. height of the vator to make a longer or shorter timer. Examples of timing
  67. vators exist in almost every map of Shadow Warrior.
  68.  
  69. ----------------------
  70. 2.      Room-Over-Room
  71. ----------------------
  72.  
  73. Room-Over-Room is the most significant feature of Shadow Warrior. It allows
  74. for building genuinely 3-dimensional areas by placing one layer of sectors
  75. over another, and allowing players and sprites to pass freely between the
  76. two layers. It is, admittedly, a hack, and as such several rules of
  77. construction must be followed in order for it to work at all. This being
  78. the case, we'll start off by explaining what the heck the BUILD engine is
  79. doing to produce this effect anyway.
  80.  
  81. 2.1     How It Works:
  82.  
  83. The BUILD engine is sector based, which means every sector must have walls,
  84. a ceiling, and a floor. Sectors can overlap each other, but these
  85. overlapping sectors can never see each other, or the view becomes garbled.
  86.  
  87.         2.1.1 BOUND_FLOOR_BASE_OFFSET and BOUND_FLOOR_OFFSET
  88.  
  89.         These two ST1's (hitags 202 and 203, respectively) are used to drag
  90.         groups of sectors over top of each other at premap. The BASE_OFFSET
  91.         serves as an "anchor point." The next OFFSET processed is moved to
  92.         the same x,y location as the BASE_OFFSET, dragging every sector
  93.         connected to it along for the ride.
  94.  
  95.         2.1.2 VIEW_LEVEL1 and VIEW_LEVEL2
  96.  
  97.         Let's assume for now that the player will be viewing the lower
  98.         layer (level 1) from within the upper layer (level 2). That's when
  99.         the VIEW_LEVEL1 (hitag 110) ST1 kicks in. Behind the scenes,
  100.         VIEW_LEVEL1 causes Shadow Warrior to draw level 1 as though the
  101.         player were standing in it, but with one difference: the ceiling
  102.         is moved up really, really high. If the player had been instead
  103.         standing in the lower layer (level 1) and looking up at level 2,
  104.         then the VIEW_LEVEL2 (hitag 111) sprite does a similar action.
  105.         Behind the scenes, VIEW_LEVEL2 causes Shadow Warrior to draw level
  106.         2 as though the player were standing in it, but with one
  107.         difference, the floor is moved down really, really low.
  108.  
  109.         2.1.3 The Floor Mirror
  110.  
  111.         Okay, so behind the scenes, we've drawn this weird looking area with
  112.         a really high ceiling or low floor. Now Shadow Warrior draws the
  113.         layer that the player is actually standing in, but it doesn't draw
  114.         anything where the floor mirror is. The "floor mirror" (tile #341)
  115.         is a special texture used expressly for this purpose. Because
  116.         Shadow Warrior didn't draw anything where the floor mirror was, the
  117.         scene appears to "see through" it into the other layer. That's the
  118.         image that the player sees on the screen at the next refresh.
  119.  
  120. 2.2     The Rules Of Construction
  121.  
  122.         2.2.1 BOUND_FLOOR_BASE_OFFSET and BOUND_FLOOR_OFFSET
  123.  
  124.         As stated above, these are necessary in order to drag one level over
  125.         the other. The lotag is the order in which they are processed, so
  126.         you'd set a BASE_OFFSET first, with a lotag of 0. Then you'd set up
  127.         all the OFFSETS you wanted to align to that BASE_OFFSET.
  128.  
  129.         2.2.2 VIEW_THRU_FLOOR and VIEW_THRU_CEILING
  130.  
  131.         One VIEW_THRU_CEILING (hitag 120) ST1 must be placed in a sector in
  132.         level 1 with a floor mirror texture on the ceiling. The lotag is a
  133.         view match tag, and must be the same as the lotag for the
  134.         VIEW_THRU_FLOOR sprite, as well as all the VIEW_LEVEL1 and
  135.         VIEW_LEVEL2 sprites in the room-over-room area. One VIEW_THRU_FLOOR
  136.         (hitag 121) ST1 must be place in a sector in level 2 with a floor
  137.         mirror texture on the floor, again, the lotag must be the same as
  138.         the VIEW_THRU_CEILING sprite. Both of the VIEW_THRU sprites must be
  139.         in the same relative positions in their respective sectors. Any
  140.         sectors in level 1 with a floor mirror texture must be congruent
  141.         to their matching sectors in level 2.
  142.  
  143.         2.2.3 VIEW_LEVEL1 and VIEW_LEVEL2
  144.  
  145.         These VIEW sprites are responsible for the actual drawing of room
  146.         over room, so there must be one in every sector where the player
  147.         can see the other level. Remember how the first area is drawn as
  148.         though the player's view were there, with the ceiling pushed up?
  149.         This means that there must be valid player space in level 1
  150.         everywhere the player can view it from level 2. This means that if
  151.         a player is standing anywhere in level 2, he cannot be standing over
  152.         "null space" in level 1. Also note that the VIEW_LEVEL sprites
  153.         should always be angled downward in 2D mode.
  154.  
  155.         2.2.4 Raising ceilings and lowering floors
  156.  
  157.         Because Shadow Warrior temporarily alters ceiling and floor heights
  158.         in room over room areas, two side effects will occur. The first is
  159.         that you can never see the ceiling of level 1 from level 2, nor see
  160.         the floor of level 2 from level 1. The second is that wall textures
  161.         will move depending on whether they are oriented to the ceiling or
  162.         floor. Keep this in mind when constructing your room over room areas.
  163.  
  164.         2.2.5 Z heights and overlap
  165.  
  166.         Level 1 and level 2 must be constructed with proper Z heights,
  167.         because Shadow Warrior won't do it for you. By this I mean that the
  168.         floor of level 2 must actually be higher than the ceiling of level 1.
  169.         The difference between the two is called the "overlap." At least
  170.         some overlap is necessary for room over room to behave correctly.
  171.         To build overlap correctly, follow these guidelines:
  172.  
  173.                 1> The height of the floor mirror (on the ceiling) in level 1
  174.                    must be the exact same as the height of the -floor- (not
  175.                    the floor mirror) in level 2.
  176.                 2> The height of the floor mirror in level 2 must be the
  177.                    same as the height of the -ceiling- (not the floor mirror)
  178.                    in level 1.
  179.  
  180.  
  181. -------------------------------
  182. 3.      Advanced Room-Over-Room
  183. -------------------------------
  184.  
  185. Confused by room over room yet? Now let's move on the exceptions and special
  186. cases!
  187.  
  188. 3.1     Visible Ceilings And Floors
  189.  
  190.         Above, we stated that you can never see the floor of level 2 from
  191.         level 1, and you can never see the ceiling of level 1 from level 2.
  192.         We lied. In $SHRINE.MAP, you can see sloping floors in level 2
  193.         from level 1 out in front of the temple. In $AUTO.MAP you can see
  194.         a car on the floor of level 2 from level 1. This is a special
  195.         trick, and you'll need to look at those maps to see how its done.
  196.         Here are some guidelines:
  197.  
  198.         1> You must use two sets of VIEW_LEVEL and VIEW_THRU tags. Depending
  199.            on the sector, some VIEW_LEVEL tags will be turned "on" (pointing
  200.            down) and some will be turned "off" (pointing up.)
  201.         2> The player can only see the floor/ceiling from the sector with
  202.            the floor mirror texture, so be sure to construct your area
  203.            accordingly.
  204.         3> The player cannot see the floor/ceiling and see more floor mirror
  205.            on the other side. It just won't work.
  206.  
  207. 3.2     Translucent Water
  208.  
  209.         To do this, build level 1 like any room over room area, but tag it
  210.         to be water, too, by placing a SECT_UNDERWATER (hitag 8) sprite in
  211.         there. The floor mirror sector is the sector you can enter and
  212.         exit the water from. The floor mirror sector in level 2 should not
  213.         have a DIVE_SECTOR (hitag 7) sprite, but it will need a
  214.         FLOOR_Z_ADJUST (hitag 98) with a lotag of 40. This allows the player
  215.         to wade along the surface without "falling" underwater. Use a
  216.         CEILING_FLOOR_PIC_OVERRIDE (hitag 136) to give the water a texture.
  217.  
  218.         NOTE: This technique was also used to create reflective or masked
  219.               floors in Shadow Warrior.
  220.  
  221. 3.3     Sloping Room-Over-Room
  222.  
  223.         Yes, it can be done. Look at $AIRPORT.MAP for an example.
  224.  
  225.  
  226. ----------------------
  227. 4.      Sector Objects
  228. ----------------------
  229.  
  230. A "sector object" is a group of connected sectors that operate as a unit.
  231. Driveables, amoebas, turrets, and numberous other things can be built using
  232. sector objects.
  233.  
  234. 4.1     Rules of construction:
  235.  
  236.         4.1.1 The Wall Loop
  237.  
  238.         Any sector object must be entirely surrounded by an unbroken
  239.         "wall loop." This means that no line can connect a vertex on the wall
  240.         loop to a vertex within the sector object. One line of this wall loop
  241.         must have a lotag set to TAG_WALL_LOOP_OUTER (walltag 504).
  242.  
  243.         4.1.2 The Bounding Box
  244.  
  245.         Every sector must have two SECT_SO_BOUNDING (hitag 500-600) ST1. One
  246.         sprite (BOUND_SO_UPPER) is placed in the upper left corner of the
  247.         sector object, while the other (BOUND_SO_LOWER) is placed in the
  248.         lower right corner. These two sprites form an imaginary rectangle.
  249.         Place these sprites so that this "imaginary rectangle" is large
  250.         enough to contain the entire outer wall loop plus any sprites you
  251.         want to move with the sector object. For sector object #0, the
  252.         BOUND_SO_UPPER sprite is hitag 500, and the BOUND_SO_LOWER sprite
  253.         is hitag 501. For sector object #1, use 505 and 506, respectively.
  254.         Sector object #2 uses 510 and 511. This continues all the way up
  255.         to sector object #19, which uses hitags 595 and 596.
  256.  
  257.         4.1.3 The Center Sector Lotag
  258.  
  259.         Every sector object must contain one and only one sector tagged as
  260.         its "center sector." This determines the center point around which
  261.         the sector object will pivot. The lotag of the center sector will
  262.         always be the same as the hitag of the sector object's
  263.         BOUND_SO_LOWER sprite. So, sector object #0 uses 501, #1 uses 506,
  264.         #2 uses 511, and so on all the way up to sector object #19, which
  265.         has a center sector lotag of 596.
  266.  
  267.         4.1.4 The Center Sector Hitag
  268.  
  269.         The sector hitag of the center sector is the track # that the
  270.         sector object will follow. See SPRITAGS.TXT for a description of
  271.         track sprites. If you don't want the sector object to follow a
  272.         track, set the hitag to -1. Other special cases include: 95 for a
  273.         killable sector object, 96 for an auto-turret, and 98 for a
  274.         driveable.
  275.  
  276.         4.1.5 Sector Object Limitations
  277.  
  278.         You can have up to twenty (0-19) sector objects in a map. Each
  279.         sector object can contain up to 30 sectors.
  280.  
  281. 4.2     What Can You Do With It?
  282.  
  283.         4.2.1 Follow A Track
  284.  
  285.         This is the most common use of a sector object. Set the hitag equal
  286.         to a track # and make the thing wander around. See SPRITAGS.TXT
  287.         to find out what you can do with tracks.
  288.  
  289.         4.2.2 Auto Turret
  290.  
  291.         Set the center sector hitag to 96, then put an AUTO_TURRET (hitag 81)
  292.         ST1 in the center sector. Put in a SO_ANGLE (hitag 16) to tell it
  293.         which way is the front, and then the sector object will always turn
  294.         to track the movement of the player. Add a SHOOT_POINT and the
  295.         auto-turret will shoot at the player.
  296.  
  297.         4.2.3 Driveables
  298.  
  299.         Set the center sector hitag to 98, then put in a SECT_OPERATIONAL
  300.         (hitag 1) and a SO_ANGLE and your sector object can now be driven
  301.         around by the player. It can never leave the sector surrounding the
  302.         wall loop, though, so keep that in mind.
  303.  
  304.         4.2.4 Bind It Across Floors
  305.  
  306.         If you want to place a sector object in water or in room over room
  307.         areas, you're going to want a "bottom" that moves with the top
  308.         half of the SO. This can be done pretty easily with
  309.         BOUND_FLOOR_BASE_OFFSET and BOUND_FLOOR_OFFSET. If the sector object
  310.         finds itself in a BOUND_FLOOR area, it will automatically try to
  311.         find its other half in the matching BOUND_FLOOR area. All the
  312.         secondary part needs is a wall loop tagged with 504 or 508, and
  313.         it will move as a unit. See rooms FB,FC, FE, and FF in EXAMPLE.MAP.
  314.  
  315. --------------
  316. 5.      SWSAVE
  317. --------------
  318.  
  319. SWSAVE is a powerful and convenient debugging feature of Shadow Warrior. We
  320. found it to be immensely useful for finding stacked sector walls that don't
  321. match up, as well other odd uses. While in the game, press "T" and type in
  322. "SWSAVE" just like a cheat code. The program will save the map in its
  323. current state as SWSAVE.MAP, which you can then load into BUILD.
  324. BOUND_FLOOR_OFFSET dragging will have taken place, so you'll see room over
  325. room area sectors in their actual positions during the game.
  326.