Animated Textures

For simple scrolling textures, these animations can be defined in the linedef and sector properties. For more complicated animations, they must be built with individual frames. These type of animations are defined with the ANIMDEFS text lump for the PC engines of Doom 64.

Inbuilt Animations

In built into the engine is a set of texture scrolling animations that can be activated by setting the appropriate flags on the linedef or sector. This allows any texture to be scrolled without having to define it in the ANIMDEFS text lump (PC engines) or source code (N64 engines). This is particularly good for waterfalls and flowing liquids, but can be used for other hellish effects.

Wall Scroll

Wall scrolling is defined on the linedef with these flags: Scroll Up, Sroll Down, Scroll Left, Scroll Right. In some instances you will also need either "Upper Unpegged", "Lower Unpegged", or both.

Floor Scroll

Floor scrolling is defined on the sector with these flags: Scroll Up, Sroll Down, Scroll Left, Scroll Right. You can additionally enable "Toggle Fast Scrolling" to increase its speed. This scroll will move the player but not other things. You can also combine this with the "Liquid Effect".

Liquid Effect

The "Liquid Effect" is a special flag for a sector. This effect is created in game by taking two sequential textures from the wad, superimposing them over each other, and scrolling them in different directions. This means that when adding new liquid textures, they must be located next to each other in the wad. The names do not matter, only the texture order within the wad. As the liquid effect can only used on floors, liquid textures will be stretched to fit into 64 by 64 map units.

ANIMDEFS Examples

Only the ANIMDEFS from the "last loaded" wad will be used. If you want to use some new animations and some of the original animations in the same wad, you must include the definitions for the original animations in your ANIMDEFS.

There are two types of animations that can be defined in Doom 64.

  1. Sequential animations which require that the textures to be animated are located one after another in the wad, just like in the original Doom.
  2. Palette animations which cycle the palette within the texture itself to make the animation. Only one texture is used per palette animation.

Textures can be used in more than one animation.

Basic Example

Let's look at a basic new animation, as found in this example.

animpic "FACE1"
{
	restartdelay = 30
	frames = 2
	speed = 8
}

Animpic defines the first texture in the sequence of textures to be animated. Restartdelay defines how much of a pause there is between when the animation completes and when it starts over from the beginning. In this case one second. Frames indicates how many textures total there are in the animation. In this particular animation the texture FACE1 and the texture right after it in the wad will be used. Speed is the delay between individual frames of the animation.

If you run the example wad above, you'll notice that the texture on the left animates, while the texture on the right does not. This is because the texture on the left (FACE1) has an ANIMDEF, but the texture on the right (FACE2) does not. Though FACE2 is used in an animation (because it is the next texture in the wad after FACE1), it will still not be animated when used, because it has no ANIMDEF itself. FACE2 could have an ANIMDEF however, assuming there was another texture after it in the wad. There is nothing that prevents a texture used within a different animation from having it's own animation. The next example will take a look at that.

Moderate Example

Now let's look at a more complicated example with two animations, which share some of the same textures.

animpic "FACE1"
{
	restartdelay = 60
	frames = 3
	speed = 5
}

animpic "FACE2"
{
	restartdelay = 30
	frames = 2
	speed = 8
}

The animation FACE1 uses textures FACE1, FACE2, and FACE3 in the example wad which is shown in the leftmost texture in the example map. Here FACE1's animation blinks less often than FACE2's animation because of the longer restart delay. The animation FACE2 uses textures FACE2 and FACE3 which is the central texture in the example map. Then texture FACE3 is not animated, the rightmost texture in the example map, as there is no animation definition for it.

Advanced Example

Finally, let's take a look at the true potential for flexibility with animations. In this example there's a new waterfall that can be used in game in four different ways (long animation, medium animation, short animation, and no animation), all by using the same five textures.

animpic "WATERFLA"
{
	restartdelay = 0
	frames = 5
	speed = 4
	rewind
}

animpic "WATERFLB"
{
	restartdelay = 0
	frames = 3
	speed = 5
	rewind
}

animpic "WATERFLC"
{
	restartdelay = 0
	frames = 2
	speed = 4
	rewind
}

There's a few things of note here. There's a new command used, rewind. This makes the animation run backwards when it reaches the end, allowing for smoother animations. You may notice that the third animation only has 2 frames. It may seem like there is no use for rewind in this case, but take a look at the restartdelay. It is 0, meaning no delay. If rewind was not used in that animation, there would be only way to have the textures change at an even pace. Restartdelay would have to be set the same as speed (4). If you were to alter the speed at any point, both speed and restartdelay would have to be changed. Otherwise the animation would become uneven. Using rewind and setting restartdelay to 0 always ensures that the animation will be evenly paced throughout, making it useful even if there are only two frames in the animation.

In this advanced example wad there are five textures present: WATERFLA, WATERFLB, WATERFLC, WATERFLD, and WATERFLE, in that order. When you run the map this is also the order the textures are shown before you. Animated textures can also be used with the liquid effect sector flag. In the example map there are some pools where the center pool is the original water liquid effect. The four pools along the back edge of the map are the new textures used in combination with the liquid effect sector flag. From right to left these are using (animated) WATERFLA, WATERFLB, WATERFLC, and (not animated) WATERFLD. The first three have only subtle differences from each other, as they all use animated textures. Then the rightmost one, WATERFLD, shows what the effect is like without the animation.

Palette Animations

Palette animations are enabled by the cyclepalettes definition. This was used as a memory saving technique for Doom 64 to save space on the ROM cartridge. As memory tends to be not an issue with Doom 64 anymore, engines like Doom 64 EX+ no longer support palette animations. Below is the animation used for some teleports found in the hell levels.

animpic "CTEL"
{
    restartdelay = 0
    frames = 8
    speed = 3
    cyclepalettes
}

Here the animation refers to a single texture, defined by animpic, and this texture can have up to 256 colors. However only the first 16 colors of the palette are used initially. Then it will swap to the subsequent sets of 16 colors to create an animation. Thus this technique animates by changing colors and has some limits. Since there is a maximum of a 256 color palette, there is a maximum of 16 frames.

To create a palette animation create a texture with a palette of 16 colors in a graphics editing program such as Photoshop or GIMP. Then expand that palette into 256 colors. If you know what colors you want to alter, you can begin editing the subsequent sets of 16 palette colors. Keep in mind, for the next animation frame, the 17th palette color will replace the 1st palette color, the 18th palette color will replace the 2nd palette color, and so forth. Also you can duplicate the image and edit the palette in that image to see the effects of the animation, then copy the new set of 16 colors to the next row of 16 colors of the original palette.