Creating maps with GZDooM features allows you to break free of many of the bounds imposed by even advanced source ports such as ZDooM. True 3D architecture, the use of models, and dynamic lights are a few of the features that break GZDooM out of the DooM source port mold. In this section I'll provide the basics of exploiting these features.
A. Creating a 3D Bridge
- 1. Create the sector that you want as the 3D sector. Often, as in the case with a bridge, this will be a sector within another sector (let's call it the "main sector" to distinguish it from the 3D sector). You do not need to assign any new attributes (e.g., lighting, floor/ceiling texture, sidedef texture) to this sector that you want to appear on the 3D portion, as such attributes will only affect the area of the "main sector", not the 3D sector. In other words, it will simply be a sector that is identical to the surrounding sector, exceptthat it will have a unique sector tag. (That's not to say that you can't assign it other properties, such as height, lighting, floor/ceiling texture; it's just that these properties will manifest themselves in your main sector, not in your 3D sector (except lighting, which will affect the 3D bridge. But more on lighting later.)
2. Assign a sector tag to the 3D sector (say it is tag = 1).
3. In the void space of the map create a sector. This is known as the "control" sector. I usually place this sector in the general vicinity of the 3D sector so that I can readily identify the control parameters if I need to.
4. Set the floor height of the control sector to be the same as the bottom height of your 3D sector, and the ceiling height of the control sector to be the same as the top height of the 3D sector. So, suppose you have a "main" sector that has a floor height = 0, and ceiling height = 256, and you want a 3D bridge crossing this main sector. You want the bottom surface of the bridge to be at a height of 112, and the top surface to be at a height of 128. Your control sector will have a floor height = 112, and a ceiling height = 128.
5. Say you want the top surface of the bridge to have a flat texture = STEP1 and the bottom surface to have a flat texture = SLIME15. You will give your control sector a floor flat texture = SLIME15, and a ceiling flat texture = STEP1.
6. Say you want the sides of the bridge to have a texture = METAL6. You will assign one linedef of your control sector a texture = METAL6. (There's a reason I chose this particular texture, but more on that later.)
7. If you want the space below the bridge to be "shadowed", you can change the light value of the control sector to be slightly below the light value of the 3D sector. Usually, an 8-unit or 16-unit difference is sufficient to provide the shadowed effect.
8. Now you will need to actually assign the GZDooM special that will make the magic work. Select the linedef of your control sector that has texture = METAL6, and give it the Sector_Set3DFloor special. How you do this will depend on which map editor you are using, but in DooM Builder you simply scroll down the linedef specials until you get to 'Sector', expand the options and scroll down until you find 'H Sector Set 3D Floor (160)'.
9. In the same menu as the one you used for 7, above, assign your tag number of the 3D sector (in this case tag = 1). For 'Type' select the value 1 (for solid 3D floor) and for 'Alpha' insert the value 255 (for completely opaque). Ignore the 'Flag' and the 'Tag HiByte' arguments for a simple 3D bridge and if you don't have an inordinately high number of sector tags in your map.
10. Save your file, and you have a 3D bridge that you can walk under, walk on, place enemies or things on, shoot, etc.
11. Now about the choice of METAL6 as texture. You'll notice that the texture has a light strip at the top. If you want the light to appear on the side of the bridge, you're in good shape, because the steps I outlined above will take care of everything. (Note that the light strip is only 12 units tall, but your bridge is 16 units tall, which will result in a slight bit of the metal to appear on your bridge.) If you do not want the light to form the side of your bridge, change the y-offset of your 3D sector (not your control sector). Something like y-offset = 32 will do the trick. Also note that having the top of your 3D bridge at height = 128, and using a texture with 128-unit height means that you won't need to worry about upper unpegging the sidedef. If your bridge height changes, or you use a different texture, you may need to play around with unpegging and y-offset to get your bridge-side texture just right.
B. Creating Swimmable Water
- 1. Follow Steps 1-3 for Creating a 3D Bridge, above. The main difference is that in this example you will be creating a "hole" in the ground, so you will need to give textures to the lower sidedefs of this sector. (You can also create "columns" of water, but that's a tutorial for a different day.) Create a sector that's 64 units deep within the "main sector", assign it the lower sidedefs, and change the floor texture if you wish.
2. Set the floor height of the control sector to be the same as the bottom height of your 3D sector (i.e., your water or slime pool), and the ceiling height of the control sector to be the same as the top height of the 3D sector. So, suppose you have a "main" sector that has a floor height = 0, and ceiling height = 256, and you want a 3D water pool in the main sector. You want the bottom surface of the pool to be at a height of -64, and the top surface to be at a height of -16. Your control sector will have a floor height = -64, and a ceiling height = -16. I have chosen the surface of the water to be just 16 units below the floor of the main sector so that it will be easy for the player to "climb out" of the pool. However, you can lower the surface of the water even further if you want the player to have to "jump out" of the pool.
3. You will give your control sector a ceiling flat texture that corresponds to your water texture (i.e., FWATER1). Of course you can do the same thing for blood (BLOOD1), lava (LAVA1), nukage (NUKAGE1), or slime (SLIME01). Your control sector's floor flat is generally immaterial, and you can assign it whatever you wish.
4. If you want the underwater space to be "shadowed", you can change the light value of the control sector to be slightly below the light value of the 3D sector. Usually, an 8-unit or 16-unit difference is sufficient to provide the shadowed effect. You can also assign a 'fog' effect, or provide an underwater color. These are best done via a script. A line in an OPEN script such as: Sector_SetFade(tag, 40, 119, 205) creates a nice turquoise-colored underwater. Play with those values to suit your needs. Incidentally, the 'tag' referred to in the script is the tag you give your control sector.
5. Select any linedef of your control sector, and give it the Sector_Set3DFloor special. assign your tag number of the 3D sector (in this case tag = 1). For 'Type' select the value 2 (for swimmable 3D floor) and for 'Alpha' insert an appropriate value less than 255 (the lower the value the more the translucency). The texture you use for your linedef is irrelevant in this case; it becomes relevant if you have a water column.
6. You're done.