Transparent Water - Room Over Room



This is a tutorial to teach you how to create the Transparent Water effect through what is known as Room over Room in the Build engine. I will be starting with the water3.map created in the Swim to Another Area tutorial. You may want to have the ADVANCED.TXT sections 2 and 3 handy while going over this tutorial. To view this map in Shadow Warrior download water4.zip




Fig 1. 2D mode view.

1. Continuing on from the Swim to Another Area tutorial, we will need to make some changes to it for the transparent water effect to work. Sector A is our above water sector and sector B is our below water sector. Both of these sectors will have the transparent water surface. The player will not be transported between sectors A and B as they were in the Swim to Another Area tutorial. Rather, we will have a Room over Room situation. This means when the map is loaded in Shadow Warrior the underwater area will be placed in line with the above water areas. So, the heights and alignments of each of the involved sectors MUST be correct, or it will be one garbled mess. This was covered in the prior water tutorials.


Fig 2a. Sector A.

2. Let's work with sector A and the above water area connected with it first. We will not use the ST1 sprite HiTag 7 (SECT_DIVE_AREA). Instead, we will use the ST1 sprite HiTag 98 (FLOOR_Z_ADJUST) give it a LoTag of 40. You will use two new match tags. I will use 3 and 4. If you do not know your next available tag press F5 in 2D mode. Insert two ST1 sprites and give them both a HiTag of 121 (VIEW_THRU_FLOOR). Now give one a LoTag of 4 and the other a LoTag of 3 as shown in Fig 2a. Next, insert two more ST1 sprites in sector A and give them both a HiTag of 111 (VIEW_LEVEL2). Give one a LoTag of 4 and the other a LoTag of 3. The angle of the one with the LoTag of 4 MUST POINT DOWN (not up) for all VIEW_LEVEL2 sprites with this LoTag. To do this place the cursor on the sprite and press the > key till you get to the position you want it to be in (down in our case). Go ahead and insert two VIEW_LEVEL2 sprites in the connecting sectors with the same HiTags and LoTags as shown in Fig 2a. These connecting sectors will be seen when the player is in the water looking through the transparent surface. This is why we insert these sprites here. Again, make sure the ones with the LoTag of 4 the angle is pointing down.

Ok, back to sector A, we need to insert two more ST1 sprites. Give first one a HiTag of 202 (BOUND_FLOOR_BASE_OFFSET), and a LoTag of 0 (zero) or an even number. The second one gets a HiTag of 136 (CEILING_FLOOR_PIC_OVERRIDE) and a LoTag of 780 (water picnum).


Fig 2b. Transparent shot by sector A sector.

Go to 3D mode and change sector A floor to picnum 341. Also, keep the cursor on it and press "P" for parallax floor (flag 1).


Fig 3a. Sector B area.


Fig 3b. Tranparent shot by sector B looking up at sector A.

3. Now, let's work with sector B and the below water area connected with it. We will change the ST1 sprite HiTag 8 (SECT_UNDERWATER) LoTag to 0. Insert two ST1 sprites and give them both a HiTag of 120 (VIEW_THRU_CEILING). Now give one a LoTag of 4 and the other a LoTag of 3 as shown in Fig 3a. These VIEW_THRU_CEILING sprites must be in the exact same location in sector B as the VIEW_THRU_FLOOR sprites are in sector A. Next, insert two more ST1 sprites in sector B and give them both a HiTag of 110 (VIEW_LEVEL1). Give one a LoTag of 4 and the other a LoTag of 3. The angle of the one with the LoTag of 3 MUST POINT DOWN (not up) for all VIEW_LEVEL1 sprites with this LoTag. To do this place the cursor on the sprite and press the > key till you get to the position you want it to be in (down in our case). Go ahead and insert two VIEW_LEVEL2 sprites in the connecting sector with the same HiTags and LoTags as shown in Fig 3a. These connecting sectors will be seen when the player is above the water looking down through the transparent surface. This is why we insert these sprites here. Again, make sure the ones with the LoTag of 4 the angle is pointing down.

Ok, back to sector B, we need to insert two more ST1 sprites. Give first one a HiTag of 203 (BOUND_FLOOR_OFFSET), and a LoTag of 1 or an odd number (one up from the LoTag given to BOUND_FLOOR_BASE_OFFSET in sector A. This sprite needs to be in the exact same position as it's counterpart's location in sector A. The second one gets a HiTag of 136 (CEILING_FLOOR_PIC_OVERRIDE) and a LowTag of 780 (water picnum).

Go to 3D mode and change sector B ceiling to picnum 341. Also, keep the cursor on it and press "P" for parallax ceiling (flag 1).


4. Now comes the complicated stuff. Right now, the Z-coordinates of sector A floor should be the same as the Z-coordinates of sector B ceiling. Raise the ceiling of the tunnel underwater to be equal to the mirror ceiling of sector B. Now the ceiling of tunnel should have the same Z-coordinates as the mirror floor of sector A. Now raise the mirror ceiling of sector B to the same Z-coordinates as the height of the floor in the sector area A (the floor you stand on before going into the water). This will cause an overlap between sector A floor mirror and sector B mirror ceiling. If needed, read section 2.2.5 Z heights and overlap in the ADVANCED.TXT file.

Ok, now that all the sprites have been added and we have our overlap. Go to the sector A area in 3D mode and press "3". This toggles Room over Room draw in Build. Do not go to 2D mode until you have press "3" again to turn it off. If you have done everything correct so far you will get an error message if you are not standing North East of the water. If you are standing in sector A or North East of the water everything should look fine. If you picture in your mine the water area in line with the above water area, the water tunnel runs in the North East direction from the entrance hole. So, when you are standing over the water tunnel everything is fine. However, when you are not standing over the water tunnel you are standing over what is called "null space".

Go to the sector B area and press "3" while in 3D mode and see what happens down there. You will notice everything is fine until you back away from the transparent hole. At the point you get the error is where you have entered "null space" from above. This point is shown in Fig 5a and 5b as NP.

Since we intended to see the sector A area from inside the water we inserted the VIEW_LEVEL2 sprites in those above sectors as shown in Fig 2a. Everywhere we have a VIEW_LEVEL2 sprite in the above sector we must have an area below it with VIEW_LEVEL1 sprites in it. This needed below area is shown in Fig 5a and 5b as N.


Fig 5a. Dealing with null space.

5. To solve the above water area error, create a new sector N in the lower area. It must be at least the same size as the upper level. Use the Space Bar to do this making sure to follow around the sector B area ending up at the starting point. Choose picnum 342 for the floor and ceiling textures as shown in Fig 5b. PgUp sector N all the way to the top. Insert a pair of VIEW_LEVEL1 sprites in sector N.


Fig 1. 3D mode view of sector B area.

To solve the below water area error, I just added a new sector to the below water area. This is the southern L sector. Just insert a vertice on each side and connect them using the Space Bar. Then use the Space Bar and created the line at point NP. Now, lower both sectors L so you can not see the ceiling mirror in sector B.


Fig 6. Area B.

6. Insert a pair of VIEW_LEVEL1 sprites in the lower L sector as shown in Fig 6 and the SECT_UNDERWATER sprites where needed. That's pretty much all you need to do. I know it may sound like alot. Just play around with it to get a better understanding of it.




Back to my Shadow Warrior site.