Difference between revisions of "Sprite"

From 3DGE Wiki
Jump to: navigation, search
(Created page with "{{DoomWiki}}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 c...")
 
(No difference)

Latest revision as of 21:25, 19 January 2017

Doomwiki
For more information on this article, visit the Sprite page on the Doom Wiki.

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 complicated process involving patches to the IWAD. 3DGE handles these graphics differently, allowing you to easily add or change sprites with a PWAD.

More advanced techniques, such as fine-tuning offsets or the footprint, can be defined in either DDFWikiLogoIcon.pngIMAGES or DDFWikiLogoIcon.pngSPRITES. Alternatively, PNG sprites can use the grAb chunk.

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 frame A is an invisible sprite. Even if graphics are provided (for example, a TNT1A0 lump), it will remain invisible. For actors needing to be invisible, use TNT1.

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.

Angles

Generally, items and decorations have only one angle, denoted by a 0 (zero) after their frame letter. E.g. BON1A0 will be used to represent the health bonus no matter which angle you are looking at it from. Moving actors such as monsters and players typically have eight rotations in the original games. 3DGE however allows you to have up to 16 rotations for each sprite. Here is a table that shows what character to use for each angle: <css>table.wikitable th.inner { background-color: #d3a7e5; } table.wikitable th.middle { background-color: #c1edfd; } table.wikitable th.outer { background-color: #b6fda2; }</css>

Sprite angle keys
for each amount
of rotations
4
135°
C
157.5°
5
180°
D
202.5°
6
225°
B
112.5°
4 5 6 E
247.5°
Inner ring:
No rotation
3
90°
3 0 7 7
270°
Middle ring:
8 rotations
A
67.5°
2 1 8 F
292.5°
Outer ring:
16 rotations
2
45°
9
22.5°
1
G
337.5°
8
315°

e.g POSSA9 would be used to represent the Template:Class at an angle of 22.5 degrees. POSSAA is the trooper from a 67.5 degree angle.

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.

Note that positioning of the frame's "original" and the mirror is important. The frame not being mirrored goes first, along with the number.

If for example, a sprite's 90 degree angle is facing to the right, it should be named like POSSA7A3. Otherwise, if it's facing to the left, it should be POSSA3A7. This is because the first side defined (in this case, the 270 degree frame known as 'angle 7') is destined to be the "original" sprite, which the engine will then mirror if another frame is defined after that one.

It's also possible to change sprite frame references to mimic, for example, a character's right leg going forward and stepping down with POSSA8C2, so actors can be more precise, even if it's not exactly the same. This can be used to help with flow, such as a big monster's walking cycle.