The Stupid SE 0 Tricks HOW-TO 1.02 for Duke Nukem 3D by Tim Conneen FILES: se0trick.txt This document se0trick.map Accompanying example map SYNOPSIS: Newly discovered special effects inherent to the engine and achieved without alterations to CON files! Build horizontal crushers, gaping pits, stretching doors, shifting passages, and whatever else you can come up with! Read on to learn how -- and don't forget to 'duke3d map se0trick.map' and 'build se0trick.map' to really learn about these effects. LEGAL NOTICES: Neither this document nor the accompanying map file 'se0trick.map' are products of 3D Realms Entertainment, nor are they endorsed nor sanctioned by 3DRealms in any way. 3DRealms, Duke Nukem 3D, and Build are trademarks of 3DRealms Entertainment (a division of Apogee Software Ltd). Other trademarks not mentioned specifically here are also acknowledged. Use of the techniques described in this file could result in the corruption of the user's map file. The reader is encouraged to periodically back up maps in progress when applying these effects, and under all circumstances. The author will not be held liable for any damages related to the use of these files. The author makes no representations about the suitability of this document or the accompanying map file 'se0trick.map' for any purpose. They are provided 'as is' without express or implied warranty. This document and the accompanying map 'se0trick.map' Copyright 1997 by Timothy Conneen. Permission to copy and distribute these files in their original, unmodified form for any purpose is hereby granted. - - - - - - - - - - - CONTENTS I) Introduction 0) Attaching a sector to a vertex (creating a tangent sector) 1) Horizontal crusher, undulating passageway, oscillating walls 2) Pit yawns open under Duke's feet/Hole opens up in ceiling 3) Stretch-wrap door/curtain 4) Shiftable passageways 5) Rotate-rise bridge as vehicle A) Appendix: On rotate-rise bridges and gear sectors B) Release notes I) Introduction This text file and the accompanying Duke Nukem 3D 1.3d map file describe how to create several effects which I have personally never seen used before in any Duke map (*). They are, however, readily buildable and, in some sense, inherent to the Build engine. My examples include a horizontal crusher, an undulating passageway, a room with eerily oscillating walls, a pit which yawns open under your feet, a hole that gapes open in the ceiling, a new kind of stretching-wrapping curtain-like door, and a shiftable passageway. These novel effects 'hinge' on one technique: the use of gears or rotate-rise sectors as tools to control the positions of the vertices of other sectors or walls. Many kinds of effects can be achieved in this way; sectors that grow, shrink, bend, shift, morph, or just move can all be created. Sections 0-4 of this document (and rooms 0-4 of se0trick.map) illustrate how to make a few examples I have come up with. In section 5 I explain how to use a rotate-rise bridge as a vehicle (which is not new). In an appendix, I summarize the properties of gear sectors and rotate-rise bridge sectors. (*) If anyone has seen these effects or effects like them used before, please let me know! I'd like to give credit where it's due. I can say this much: they were new to me when I came up with them. Recently I came across another file full of cool Build tricks, "The Build Trick Tutorial" by Patola (you'll find it on www.elitegames.com), which does include an example of a gear sector attached to one vertex of another sector, creating a sort of fast-moving giant minute-hand that rotates around on the floor and weirdly turns inside-out every 180 degrees. I felt vindicated find that the author didn't go on to do the things I do here, though. Anyway, nice work Patola! I especially loved the looping bottomless pits; and that 3-floor elevator is the most exciting thing I've seen for a while! You could make a 1000 floor elevator that way. 0) Attaching a sector to a vertex (creating a tangent sector) (Corridor 0 in se0trick.map) An illustration of how to create a new sector attached to another sector or wall at only one vertex is given in corridor 0. This type of structure is essential to the effects demonstrated in corridor 1. I call such sectors 'tangent sectors', not only because they are touched by another sector at just one point, but because 'tangent sector' is a lot shorter than 'sector which is touched by another sector at only one point'. Build won't let you click the same vertex twice while drawing a new sector, so drawing the sector directly is not possible. Instead, you must draw a sector that shares a segment of the existing wall next to the vertex, and then split off the part you need. If the tangent sector isn't meant to be seen (as is often the case below), make sure its ceiling and floor are flush with & textured like the surroundings, and shrink the sector to the smallest possible size - until it's just large enough to hold its sprites. Also, tangent sectors need no more than 3 sides. The five blocks in room 0 show these steps. Blocks 4 and 5 have their tangent sectors turned into gear sectors, causing the motion of the corners of the blocks. The tangent sectors are shrunken down to the minimum size needed to contain their sprites, making them almost invisible; here, the floor textures of the sectors are left different from the texture of the surrounding floor, so that they are visible as they rotate right through the blocks they're connected to. Note that no distortion appears when the tangent sectors rotate through the other sectors - however: CAUTION: ugly occlusion errors will happen _after a save and restore_ if a tangent sector is used to animate a vertex of an interior sector (as opposed to a vertex of an exterior wall). Blocks four and five in room 0 illustrate this problem. Nasty stripes appear in the floor near the moving vertex of the short block (an interior sector) after the game has been restored, whereas the tall block (a void area) looks just fine. The applications in corridor 1 only use tangent sectors attached to exterior walls, so they are perfectly stable after save-restores. CAUTION: Build does not seem to expect to find sectors which are touched at only one vertex during certain map operations - especially the 'join' operation. When you create a sector as described here, avoid erasing it by joining it directly to the surrounding sector (whereby the sector and the bizarreness of the singular vertex are removed at the same time). This can create unpredictable results, and possibly corrupt the map. Instead, reverse the process of creating it: re-make the missing half of the sector you used to create the tangent sector, join the two halves to dispel strangeness of the singular vertex (now the sector shares a wall with something), and then join that to the surrounding sector. That should get rid of the sector without any complications. 1) Horizontal crusher, undulating passageway, oscillating walls (Corridor 1 in se0trick.map) A permanently rotating sector can be attached to a vertex of any wall to cause it to move in a circle at a controllable speed. Corridor 1 provides three examples of this effect: the horizontal crusher at the near end of the hall; the segment of passage which undulates side-to- side; and the chamber at the end of the hall whose walls breathe in and out eerily. These are all nice-looking effects; however, Duke will occasionally be unexpectedly killed when he pushes against such an animated wall, so use this trick with caution. Try running and strafing into the various permanently moving walls on the map to judge how bad the problem is. The undulating passageway is fairly dangerous, but I had to try very hard to get the moving sectors in room 0 to kill me; heck, ordinary swinging doors are more dangerous! The eerily breathing walls in the room at the end are kept safe behind normal, blocking two-sided walls. Moving walls can push a stationary Duke without harm; it's only when Duke pushes back that jibbings occur. This is of no concern in intentionally deadly traps (like the crusher in corridor 1), but it can spoil some effects. To make a wall's vertex move in a circle about some point: - Attach a tangent sector to the vertex (see section (0)). Leave the sector tags at (h=0,l=0). - Put a SE(channel,0) pointing down and a GPSPEED(0,speed) (128 gives a period of about 4 seconds) in the tangent sector. - Put a SE(channel,1) somewhere on the map; this is the center of the circular path along which the tangent sector, and the vertex of interest, will move. Point it up for clockwise motion; down for counterclockwise motion. If an animated wall is the first wall of its sector, and the floor [ceiling] is set to relative (using 'r'), then the floor [ceiling] texture will move with the wall. Moving walls don't push monsters. Monsters sometimes end up outside animated walls, in the void space. Try to coax the two liztroops at the end of the hall into the undulating passage to judge how bad this looks. 2) Pit yawns open under Duke's feet/Hole opens up in ceiling (Corridor 2 in se0trick.map) Rotate-rise bridge sectors attached to the vertices of a sector may be used to collapse the sector into a single point near the middle. This allows the creation of (among other things) holes in the floor which can be opened and closed. The sector itself may have sector effectors or tags of its own (e.g., floor rise), and may be filled with enemies and items, which remain hidden while the hole is closed (or, somewhat hidden; see below). Here are step-by-step directions on how to build an opening & closing pit like the one down corridor 2 in se0trick.map: - Create the pit sector: draw it and lower its floor. The pit can be of any shape, but there is an important constraint on the location of its vertices: none of them should move into or through any of the walls as it rotates. This could happen with a very jagged pit. Another important consideration is that all of the vertices should all be on the grid, as should the collapse point, or placing the pivot points for the r.r.b. sectors will be difficult. - Choose the texture and shade for the sector surrounding the pit now. If you decide to change these later, you'll need to change those of every little sector surrounding the pit as well. Set the floor and ceiling of the pit sector to non-relative (hit them with 'r' in 3D mode until the value of the 'flags' byte shown by 'tab' in map mode is the lower of the two). Otherwise, the ceiling and floor over the pit will rotate with one of the walls as it opens. Same goes for the surrounding floor and ceiling; set them to non-relative, or at least make sure that their firstwall is not one of the pit walls. - Draw a narrow sector surrounding the pit sector. You'll need to do this by 'cutting it out' of the surrounding sector: starting at a vertex of the pit sector, draw all but one of the walls of the new sector, and finish at a neighboring vertex of the pit sector. Then draw in the last wall. - At each of the vertices of the pit, cut a small four-sided sector out of the new surrounding sector. These small sectors will be used to move the pit's vertices inward and close the pit. They should each share one wall with the pit sector, one with the exterior sector, and two with the narrow sectors surrounding the pit. Tag each one (0,30); they're the rotate-rise bridge (r.r.b.) sectors which make this effect possible. - Each of these small sectors gets a SE(channel_n,0), pointed downward (different channel number for each tangent sector). Be sure that the SE is not elevated, or the floor of the r.r.b. sector will rise to the SE height as the pit closes. Give the sprite palette 1 for clockwise motion, or leave it at 0 for counterclockwise motion. It's simplest to have all of the r.r.b. sectors rotate in the same direction. If you mix directions, make sure the sectors' paths don't criss-cross at any point. Note that the long, narrow sectors between the r.r.b. sectors do not need tags or SEs. - Each r.r.b. sector also gets an A(0,trigger_channel) (there is just one trigger_channel for the whole set) and a GPSPEED(0,256), where 256 = 90 degrees. You can use a different rotation angle, but placing the pivot sprites becomes more complicated (although it could be done with the coordinate display and a little math). - For each SE(channel_n,1), place a SE(channel_n,1) at the point around which the pit vertex should rotate 90 degrees to reach its closed position. It's too not hard to find the pivot point: it's a point which is both [X grid steps right and Y grid steps up from the pit vertex] and { [Y grid steps right and -X grid steps up from the closed position of the vertex] for cw rotation, or [-Y grid steps right and X grid steps up from the close position of the pit vertex] for ccw rotation }. - Put a M(stopsound,startsound) in one or more of the rotate-rise bridge sectors. Use none, one, or several with different sounds if you like. - Place one or more switches or touchplates with lowtag = trigger_channel somewhere. - To make the pit start out closed, place a T(1,trigger_channel) (touchplate that fires once) in the sector where Duke starts. This will close the pit on startup. Note that you'll have to reverse the hitags and lowtags of any M sprites you use on rotate-rise bridges when you trigger them on startup (believe it or not). The alternative is to design the pit in the closed state, or to design it and then move all of the vertices together, which is a pain in the neck, and very difficult to untangle if you need to make changes or repair texture alignments. Phew! Your pit should now open and close. Note that in se0trick.map, the floor of the pit is made to rise after it opens, using an SE 31. There are endless other possibilities: - More than one interior sector - Sloped interior/exterior sectors - Nested holes (would work?) - Hole with a passage at bottom (sector-over-sector trick; should not be any HOM problems if the hole is deep enough). The hall beyond the floor hole in corridor 2 leads to a room where a hole opens up in the ceiling (and some baddies and items fall out). It was made from a slightly modified copy of the pit example. Regarding placing sprites in the pit: sprites you place in the pit will be visible right through the floor _when the pit is closed_. The problem is that they end up having positions outside the boundaries of the sector they are supposed to be contained in; the game reacts by drawing the sprite when it shouldn't. The workaround is to spawn items in the pit when it opens. They should be spawned very close to the middle, or they'll pop up to the top as the border of the pit passes under them. Another workaround is to make the pit deep enough, and the surroundings constricted enough, that the sprites are always below the player's field of view, even when he's looking down, whenever he can see the pit. In the case of the ceiling hole, the effect of this problem is for sprites to become 'hidden in plain sight' (visible but untouchable) when the pit is closed around them as they rest on the floor. Close the ceiling hole in the example map before picking up the chaingun and ammo to see this problem. Quirks in behavior of this effect: most sprites which are deposited on the area of the pit when it is closed will float in mid-air in the same spot when the pit is opened again, instead of falling in. Blood pools and footprints do it, as well as ammo and weapons dropped by dead baddies, and even pipe-bombs thrown by the player. If the pit only gets to operate once, this won't be a problem. Players, monsters, and corpses fall into the pit well enough, but they get popped to the top as the pit closes. If the pit is required to operate only once, floating sprites may not be an issue (if nothing dies on the pit before it opens). Here it can operate many times; switches toggling the pit and its floor, as well as a switch operating the ceiling hole, have been included in the rooms to allow twiddling. Further notes: originally, I made the floor hole using so-called 'tangent sectors' (see above) tagged as rotate-rise bridges to move the vertices. However, this suffered from the save-restore bug associated with tangent sectors and interior sectors (described in section 0). Eventually I found that the narrow surrounding sectors were needed, and that the r.r.b. sectors needed to share a wall with the pit sector and one with the outside sector in order to eradicate all nasty HOMs and occlusion errors after save-restores. Anyone who wishes to experiment with new kinds of structures is encouraged to check how their designs behave after a save and restore. 3) Stretch-wrap door/curtain (Corridor 3 in s30trick.map) Corridor 3 includes two examples of door-like structures achieved using chains of sectors in which every other sector is hidden inside the chain (i.e. built with no walls on the outside) and tagged as a rotate-rise bridge. When activated, the r.r.b. sectors move through their arcs and drag the vertices of the sectors in between, which stretch and twist their way to new positions determined by the locations of SE 1s and GPSPEED lowtags. Room 3 contains two examples. Door "A", the contracting door at the room's entrance, was made using just two small r.r.b. sectors on the ends of a thin sector which is itself tagged as a drop-floor. The r.r.b. sectors rotate 90 degrees in opposite directions so that they converge almost on a point; the floor-drop (SE(0,31)) in the middle is triggered at the same time, so that the door seems to shrink vertically and horizontally into the little nub on the floor which remains when the door is in its open position. (I'm not sure why the floor-rise leaves that little nub instead of going flush, but I kind of like it anyway, so I declared it a feature :). The floor-rise has a GPSPEED(0,384); this makes it drop the 24-click height of the SE(0,31) in what seems like exactly the time taken for the r.r.bs. to perform their rotation (which is fixed and independent of the angle of the rotation). The GPSPEED needs to be given a lowtag of 16*z, where z is the height traversed by the floor-drop between its two positions, to be synchronized with the r.r.bs. (confirmed by experiment; z=24 here). The second example, the contracting curtain activated by the "B" switches, uses 12 r.r.b. (tag (0,30)) sectors joined and surrounded (except on one end) by 11 normal sectors. The sectors are built in a straight row, as short as possible; the r.r.b. sectors need only three sides, and should be thin enough to prevent the outside walls from crossing the inside walls. Their GPSPEEDs are tagged symmetrically from 512/6 for the innermost 2 to 512 (=180 degrees) for the outermost, in increments of 512/6. Half of the SE(chan_n,0) sprites (which need to point down) are given palette 1, so that their rotation angles are negative. By rotating through successively larger angles, the r.r.b. sectors move apart, dragging the vertices of the visible exterior walls with them and causing the curtain to extend. The positions of the SE(chan_n,1) sprites (different chan_n for each r.r.b.) determine the shape of the extended curtain. Here, most of the pivot points are piled up in one spot a moderate distance from the row of sectors, so that the extended curtain is roughly circular. The pivot points for the end sectors are placed so that the two sectors just meet (and don't overlap) when they've moved their 180 degrees. All of the r.r.b. sectors are activated by A(0,trigger_channel) sprites. An M(endsound,startsound) in one of the r.r.b. sectors sets the sounds (or, an M(startsound,endsound) when the sectors are to be triggered at startup, as they are here; see the appendix). 4) Shiftable passageways (Corridor 4 in se0trick.map) Corridor 4 demonstrates the use of a rotate-rise bridge sector joined to an exterior wall to cause the walls of a passageway to shift to a different position. Here, the r.r.b. shifts the divider of a fork in the passageway from one side to the other. The r.r.b. sector (tag (0,30)) is built right into the divider it moves (it's the very tip, as a matter of fact) and is solid (has its ceiling lowered to the floor). It gets a SE(chan,0), pointed down and given palette 0 for ccw rotation (or 1 for cw). A GPSPEED(0,256) sets the rotation angle to 90 degrees. The SE(chan,1) is placed along the center axis of the divider, at +/- 45 degrees to the starting and ending positions of the tip (use the grid). Many kinds of morphing passages, sectors, doors, and curtains would seem to be possible using the basic techniques of sections 2 through 4. Sophisticated methods for positioning the r.r.b. sectors and chosing their pivot points and rotation angles could lead to very impressive effects indeed. 5) Rotate-rise bridge as vehicle (Corridor 5 in se0trick.map) Rotate-rise bridge sectors can also be used as 2-way vehicles (like the 2-way subway effect) which move on circular paths. I think I remember seeing this in a map before... the author declared in the accompanying text file that his map contained _three_ subways. I can't say for sure, but I think he had a two-way train, a one-way train, and one of these. Hence, I can't claim this trick as my idea (rats! :). Anyway, this is just an ordinary r.r.b. sector, with the pivot point set far outside the sector. Remember, the SE 0 points down. The rotation occurs in about two seconds, so the farther the vehicle has to go, the faster it moves. The example in se0trick.map is rather fast. The 'rise' aspect of the r.r.b. was also used in this example, creating the walls which pop up on the back end of the vehicle when it changes direction. The path of the vehicle has been littered with weapon sprites to demonstrate that no, the vehicle doesn't sweep up items it runs over, and no, Duke won't pick them up when he rides the vehicle over them. A pig-cop is spawned on the track by a touchplate on the vehicle. Trigger the vehicle right after he's spawned to see that the vehicle _will_ sweep up monsters it runs into. A) APPENDIX: Notes about gear sectors and rotate-rise bridge sectors Since the effects described in this document make such heavy use of gears and rotate-rise bridges, I'd like to provide a quick summary of the facts about these two kinds of sectors. Gear sectors: - Sector is tagged ... almost anything you like! The sector can simultaneously be used as, for instance, an under/overwater sector, a ceiling door, etc.. Activators/masterswitches it contains will apply to any added effect, not the gear effect. Tag the sector (0,0) if no other effect is needed. - SE(chan,1) anywhere (inside or outside of gear sector) is pivot point for rotation. Direction: down=clockwise rotation; up=counterclockwise. - SE(chan,0) somewhere inside gear sector. Direction: Down = rotate naturally about SE 1. All points of sector rotate around SE 1. Probably want to use this. Up = somewhat bizarre: At startup, gear sector is rotated around SE 0 so that the top end of the sector faces away from the SE 1. Then, the re-oriented sector rotates normally, as though the SE was facing down. (But, why?) Sprites on gear are not rotated at startup, but still rotate with gear; may appear to float in mid-air. - GPSPEED(h=irrelevant,l=gear_speed) sets speed of gear. Higher-->faster; 512 = about 1 rotation per second. - Floor flagged [r]elative: sprites, Dukes on gear move with gear; gear texture moves properly. Floor flagged non-[r]elative: sprites on gear stay still, floating in mid-air if gear moves out from under them. Duke stays still (falling it gear moves out from under him). Ceiling: might want to flag non-[r]elative so that texture does not rotate with gear (unless the gear's in the ceiling :). - SE palettes irrelevant. - A(,) and D(,) sprites can not affect gears; they rotate permanently. - Music/sound effects sprites in gear sectors just act in ambient sound mode. If you want an ambient sound near the gear, there is no special reason to put it in the gear sector itself. Rotate-rise bridge sectors: - Sector is tagged (h=0,l=30) - SE(chan,1) anywhere (inside or outside of gear sector) is pivot point for rotation. Direction, palette irrelevant. - SE(chan,0) somewhere inside gear sector. Palette sets rotation direction: 1=clockwise, 0=counterclockwise. Height: floor of sector will rise/drop to level of SE 0 at a fixed rate as sector rotates. Rises quickly enough to gain 32 clicks in the (fixed) time taken for the sector to rotate. Will stop rising before sector stops rotating if height < 32 clicks over floor; will keep rising after rotation stops if height > 32 clicks over floor. Of course, if SE 0 sits on floor, floor elevation is fixed. Direction: down = rotate sector around SE 1 as usual. up = rotate sector around SE 0; SE 1 still needed on map, but it no longer serves any purpose. - GPSPEED(h=irrelevant,l=rot_angle) sets rotation angle. 1024 = 360 degrees. Angle is traversed in a fixed amount of time (about 2 seconds); larger angles result in faster rotation. - A(irrelevant,chan) or D(delay,chan) activates the sector. A masterswitch will work only once; however, multiple masterswitches with different channels can be placed in the sector, and the sector will activate once for each. - M(stopsound,startsound) sets the sounds played when the sector is activated. The stopsound plays at the end of the rotation, not the end of the rising. Bizarre exception: if the sector is triggered at the very beginning of the game by a T(1,chan) placed in Duke's starting sector, then the tags must be M(startsound,stopsound). Strange & wonderous.... B) Appendix: Release notes This document and the accompanying map se0trick.map are by Tim Conneen . Comments about these files are appreciated. The effects demonstrated in se0trick.map appear to be quite stable and functional in version 1.3d of Duke Nukem 3d. It is unknown how they behave in the Plutonium Pack/Atomic Edition of the game; however, there seems to be no reason to believe they wouldn't work. Perhaps this question will be answered in a future version of this file. Consider this a plug: please play my soon-to-be-released map "confessn.map", the map which could finally bring an end to the tragic cycle of destruction created by the cursed Nuke Button. Thanks to Klaus Breuer, Brett Gmoser, and Jonah Bishop for the various Build FAQs, without which this file certainly never would have existed. Changes in 1.02: Added acknowedgements for the FAQers and changed the advert for my new map again, since some other hoser released a map called "penitent". No changes to map file or instructions. --- End "The Stupid SE 0 Tricks HOW-TO 1.02"