An actively spinning fan in the vanilla Doom engine that moves horizontally in a ceiling or floor
Doom's animated textures and transparent patches make this easy to implement
Creating the Fan Texture
Figure: fan texture
Figure: Blank fan texture
Figure: Fan patch dimensions
Choose a pixel width for the fan texture. The patch must use Doom's texture widths: 8, 16, 32, 64, 128, 256, 512, 1024
Take the width of the blade and multiple by two. The next highest number in the sequence above will be the width of the patch
Examples:
If fan blade width is < 64 -> 128 wide image
If fan blade width is < 128 -> 256 wide image
If fan blade width is < 256 -> 512 wide image ('uge fan!)
Put one blade on the left side of the texture and the opposite blade on the right side of the texture. For instance, if you want a 48 wide blade and have it 16 tall you would: 48x2=96 Next number in sequence is 128, so dimension of the patch is 128x16 so the blade will be from (0,0) to (48,16) and the mirror image of it will be from (64,0) to (112,16)
You do not want the blades to make contact because when the texture is rendered in-game, the player may see the mirror blade's pixels at the inside or outside edge of the blade. Also ensure where the background color is aqua (r000g255b255) for transparency
It is a good idea to keep the fan bottom dark and the top light for an effective 3D look.
Save as fan1.bmp
Create a new blank image using the same dimensions as the fan texture (for the above example, 128x16) and ensure it's all aqua (red 0, green 255, blue 255)
Save as fan2.bmp
Animating the Texture
Place your patches (fan and blank textures) into a wad using a doom wad utility such as Wintex. Then go into editing the texture1 resource (where you put patch(es) onto the texture used in the editor/game.)
Now this part has some flexibility. If you use a Boom compatible port such as Zdoom, MBF, and SMMU, you may create an ANIMATED lump (also Dosdoom through DDF) to create a brand new animation with the ability to make the fan either move faster or slower. To find out how to do such a thing please refer to each port's documentation. In here I'll describe how to make the animation using just regular doom2.exe.
Pick one of the animated texture sequences. (such as WFALL1-4 which isn't used in Doom2 but can be used for add-ons) Animated sequences have a start texture and an end texture and anything in between them in the list will be animated within the frame set in order from top to bottom. This is very important information to have.
You have to decide how smooth you want the fan animation to be. I will use four fan 'spots' for every 1/4 of a turn (the fan should have at least this). First stick the actual fan texture on the first animation frame. (e.g., WFALL1)
Next you'll have to put the blank patch onto two separate textures, both HAVE to be right after the first animation in the texture list. (eg: I'll use WFALL2 and WFALL3, but these two textures can be called anything)
Lastly you must create/modify the last animation frame, meaning the END texture in the sequence (e.g., WFALL4). In this on you will also input the blank texture. Remember all of the above textures should be the size of the patches included. (e.g., in this one, 128x16)
Save & quit, maybe clean out the wad (File->Cleanup WAD in Wintex)
Map geometry
Open your favorite editor and create a new map or open an existing one. Please make sure the texture wad you made is loaded. Most editors support using add-on textures but with some (like Waded) you may have to merge the wad into your IWAD with a tool like deusf. (Go find some help somewhere else for this, I don't feel like explaining this :)
Now you must choose how far from the ceiling/floor opening's walls you want to be from the fan. Smaller fans should have a smaller distance and larger fans should be further from the openings walls. This is all just my opinion of how it looks of course. Since the fan blade used in this example is 48 wide I'll only make the fan 8 from the walls. So create the circle, square, etc. around the fan area. (where you want it)
You must now make the actual fan blade linedefs. Use two sided linedefs and make four lines which are perpendicular (90 degrees) lines to each other. In between each of these make the "amount of animation frames minus one" linedefs. So if there's four frames for the fan, stick in three lines between each perpendicular line. If there's 8 there should be seven linedefs. The best method for this is too create a line 45 degrees in between and then 22.5 degree lines in between the center one and the 90 degree ones.
Choose if you want a 'core' or central piece for the fan and if so simply create it in the middle (best if it's scrolling and also has some support going up from the middle of it)
Make sure all of the lines are the blade's width wide (eg: 48 in this instance)
Have all the lines pointed the same way (making it all much easier) so the middle line coming out of the linedef when highlighted is pointing towards the back of the next line (clockwise).
For placing textures on the lines, put the first animation frame texture on the first perpendicular lines you placed. (both sides) and align accordingly. One side will be X aligned 0 and the other side's X will be half of the texture width. You'll have to Y align too to make sure the fan's height is correct.
Put the second animation on the next four lines clockwise.
The third goes on the four 45 degree lines.
The fourth goes on the four lines that point at the back of the first 90 degree frame.
Note that the X and Y alignments are all the same on each linedef. Side1 X,Y on all are the same and Side2 X,Y are all the same. This is easy to do if you have your lines pointing the correct way.
Run the Map!
Save the map in the editor and if you like, merge the textures in with the map wad. All should work well if you followed the above methods.