Sprite
In Doom, a sprite is a series of images that can be used to display a thing. In the original Doom, adding or changing sprites (and flats) was a big pain in the rear involving making patches to the IWAD. ZDoom rectified this, and you can now easily add new sprites to your PWADs.
Contents |
Image names
Sprite image names have the format:
NNNNFA[FA]
where NNNN is an arbitrary name for the sprite, F is a letter specifying the frame position (walking1, walking2, shooting, etc), and A specifies the angle.
Special names
There are three "reserved" sprite names that have specific effects.
- TNT1 A
- Originally introduced by TeamTNT in Boom, TNT1 is an invisible sprite. The frame letter is irrelevant, so A is generally used. Even if graphics are provided (for example, a TNT1A0 lump), it will remain invisible. For actors needing to be invisible, you are advised to use TNT1 instead of other solutions (such as the oft seen NULL) which are not as reliable.
- ---- A
- This sprite is interpreted as "keep previous sprite". The frame letter is irrelevant, so A is generally used. An example is the GenericFreezeDeath state in Actor. To be parsed correctly, this name requires to be within quotes (e.g., "----" A -1).
- #### # (New from 2.5.0)
- This sprite is interpreted as ----, but with the difference that it allows overriding selectively either the sprite or the letter, or both. Using #### for the sprite means "keep previous sprite" and using # for the letter means "keep previous letter". An example is the GenericFreezeDeath state in Actor. To be parsed correctly, this name requires to be within quotes (e.g., "####" "#" -1).
Frames
You can have 29 frames of animation for any one sprite name, one for each letter of the alphabet plus [, \ or ]. For example POSSA1 is the first walking frame of the zombie trooper, POSSG1 is the pain frame (the animations themselves can be controlled with DEHACKED or DECORATE ).
If using the \ frame in a PK3 archive format, note that the file name for the sprite must use a caret (^) instead of a backslash (\). The backslash character is still used in DECORATE, however.
If you require additional frames beyond [\], you can simply create a new sprite name. For instance, after using POSS]0, it would make sense to use POS2A0.
Sprites can also be defined in TEXTURES.
Angles
Generally, items and decorations have only one angle, denoted by a 0 (zero) after their frame letter. Eg BON1A0 will be used to represent the health bonus no matter which angle you are looking at it from.
But you can have up to 16 rotations for each sprite. Here is a table that shows what character to use for each angle:
| degrees | 0 | 22.5 | 45 | 67.5 | 90 | 112.5 | 135 | 157.5 | 180 | 202.5 | 225 | 247.5 | 270 | 292.5 | 315 | 337.5 |
| key | 1 | 9 | 2 | A | 3 | B | 4 | C | 5 | D | 6 | E | 7 | F | 8 | G |
e.g POSSA9 would be used to represent the trooper at an angle of 22.5 degrees. POSSAA is the trooper from a 67.5 degree angle.
You may of course leave out angles 9 to G altogether and use only 8 rotations as per the original Doom spec.
Mirroring
Every sprite image can have one alternative mirrored position. Simply add another frame letter and angle notation after the first in the image name. For example, for POSSA2A8, the actual image with this name will be flipped to show the trooper from the 315 degree angle.
Conflicting sprite names
ZDoom supports Doom/Doom II, Heretic, Hexen, and Strife. Enemies or items from any of these games can be brought into any other game. However, this brings to light the fact that some sprites have the same name in one game as another sprite in another game. For example, the Doom Cacodemon uses sprites named HEAD*, but the Heretic Iron Lich uses the same name. To avoid conflicts and allow all sprites to coexist peacefully, a change was made to ZDoom which changes the name of the sprite ZDoom will look for, so long as it is looking at a PWAD. (That way the original IWADs will still work unchanged.)
Sprites are renamed as follows:
Heretic.wad
BLOD → BLUD (this makes it the same as Doom's blood sprite) HEAD → LICH
Hexen.wad
ARM1 → AR_1 ARM2 → AR_2 ARM3 → AR_3 ARM4 → AR_4 BARL → ZBAR BLOD → BLUD (this makes it the same as Doom's blood sprite) CAND → BCAN EGGM → PRKM GIBS → POL5 (this makes it the same as Doom's gib sprite) ROCK → ROKK SUIT → ZSUI TRE1 → ZTRE TRE2 → TRES WATR → HWAT MNTRF → MNTRU (these lines make MNTRG → MNTRV the minotaur attack MNTRH → MNTRW frames the same as MNTRI → MNTRX in Heretic to avoid MNTRJ → MNTRY having to patch the MNTRK → MNTRZ actor itself) ARTIINVU → ARTIDEFN (this separates it from INVU → DEFN Heretic's invulnerability item)
Strife1.wad
ARM1 → ARM3 ARM2 → ARM4 BAR1 → BARC BARL → BBAR BLST → MAUL BLOD → BLUD (this makes it the same as Doom's blood sprite) CNDL → KNDL LOGG → LOGW MISL → SMIS PMAP → SMAP POT1 → MPOT SHRD → SHAR SHT2 → MPUF SPID → STLK TLMP → TECH TRE1 → TRET TRCH → TRHL VASE → VAZE
The upshot of this is that if you want to include custom Iron Lich graphics, you will now use the new sprite, LICH*, rather than HEAD*. If you then wanted to include Cacodemon graphics, you could safely add HEAD* graphics and there will be no conflicts.
