Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
DanimalKingdom

Maximum number of frames for sprite animation?

Recommended Posts

Hi all,

I made a bunch of totally new enemies for a mod project last year, but I've only just picked Doom back up and I'm pretty rusty with Slumped/XWE.

Can someone tell me what the maximum number of animation frames we have available to work with for our monsters? Am I incorrect in thinking it's just the A-Z, 26frames for animating movement, attacks and deaths?

How does Brutal doom seem to fit in so many death animations? Do they spawn in a separate actor just for the death animations?

I hope this query makes sense; the reason I'm asking is that I want to make a new monster with smooth animation, using more frames than usual (i.e. more than the basic 4-frame walk cycle), but I need to know how many frames I have to work with.

Thanks

Share this post


Link to post

You make a mob that uses sprites with more than one name.

For instance, half a bad guys states might use sprites called POSS, while the other half might use sprites called POS2.

That said, Doom actually supports a couple more frames than 26 per sprite, with some other characters functioning as 27 onward (i.e. Z is 26, 27 is "[", 28 is "\" etc).

Dooms Arch Vile and HeXen's Cleric are the only original game sprites to go above 26 though IIRC.

Share this post


Link to post

Each sprite name is limited to 29 frames: A-Z and [, \, ].

The latter 3 have some interesting issues with extracting the lumps out of WADs later ;)

Share this post


Link to post

First, pick up SLADE 3 instead of Slumped or XWE. SLADE 3 is the successor to Slumped and it is a lot better. Website is here, with forums, wiki, and development builds, and development log at various places of the net.

Secondly, the maximum number of frames for sprite animation is 29: 26 for A-to-Z, and then [, \ and ]. So you can have a sprite named BLAH\0 or STUF]1. It's possible. As far as the original games goes, this is used by the arch-vile in Doom II (all 29 frames), by the cleric in Hexen (28 frames) and the swamp serpent/stalker in Hexen too (27 frames).

As for how Brutal Doom can afford so many animations, it's because it doesn't use vanilla Doom, but an advanced source port based on ZDoom. ZDoom allows greater freedom with sprites and let you define tons of states where you do not necessarily always need to use the same sprite name. So if you want more death frames for your zombie, you can call them ZOMB*, DEAD*, KILD*, A_79*, or whatever else strikes your fancy. With 26 letters, 10 numbers, and additional ASCII characters like _, - or !, you have more than two million possible sprite names, which makes for well over sixty million possible frames.

You're going to run out of RAM before the theoretical limitations kick in.

Vermil said:

Dooms Arch Vile and HeXen's Cleric are the only original game sprites to go above 26 though IIRC.


Also the stalker: SSPT[0 for the frozen death.

Quasar said:

The latter 3 have some interesting issues with extracting the lumps out of WADs later ;)

DOS tools have to rename them; however with Linux/Windows tools, only \ is problematic. ZDoom allows to use the caret (^) instead of the backslash in PK3.

Share this post


Link to post

Doesn't \\ work?

EDIT: oh, I thought you meant code. You and Quasar actually meant file names -_-

Share this post


Link to post

We aren't talking about escaping special characters in a string, here. We're talking about file names.

Anyway, thanks to this thread, I've checked how SLADE behaved when exporting one of these sprites, and fixed the issue. :)

Share this post


Link to post

Amazing, thanks so much for your responses to this thread, this is a huge help!

So I am correct in thinking I should use ZDoom for smoother animations? Does it also support hi-res sprites?

And also, since your responses have been so informative, can I ask a couple more questions?

1) what's the maximum number of frames you can use for a player weapon animation? Again, this is for the purpose of smooth firing/reloading animations. Are we talking 29 as well?

2) Is it possible to implement weapon-shake frames, that loop while the player is moving, to replace the traditional weapon sway of yore?

@Gez, thanks for the heads up on SLADE3, I had seen it mentioned but was not totally clear on what its functions were.

Share this post


Link to post
Quasar said:

Each sprite name is limited to 29 frames: A-Z and [, \, ].


I think that I am correct in saying that [, \ and ] are just the next three characters after Z in a standard font set (right? ANSI?). So I was wondering, is Doom hard coded to stop supporting additional characters after ] or could you just keep going through the character set? I know that ZDoom uses ^ as a replacement for \ in file formats where \ can't be used (zip/pk3) and I think that is the next ANSI character so I'm going to guess not.

Share this post


Link to post
Enjay said:

I think that I am correct in saying that [, \ and ] are just the next three characters after Z in a standard font set (right? ANSI?). So I was wondering, is Doom hard coded to stop supporting additional characters after ] or could you just keep going through the character set?


ASCII, yes.

And in theory, the engine could; however you have a range check preventing it:

//
// R_InstallSpriteLump
// Local function for R_InitSprites.
//
void
R_InstallSpriteLump
( int		lump,
  unsigned	frame,
  unsigned	rotation,
  boolean	flipped )
{
    int		r;
	
    if (frame >= 29 || rotation > 8)
	I_Error("R_InstallSpriteLump: "
		"Bad frame characters in lump %i", lump);
(BTW: frame is obtained by subtracting 'A' from the frame character, and rotation by subtracting '0'.)

Share this post


Link to post
Gez said:

DOS tools have to rename them; however with Linux/Windows tools, only \ is problematic. ZDoom allows to use the caret (^) instead of the backslash in PK3.

FYI: Doomsday uses a percent-encoded representation rather than substituting characters. It would be nice if SLADE supported that at some point, on some level (automatic (de)encoding of names?).

Share this post


Link to post

I think for any advanced ports the best advice would be, not to use frames 27-29 ([\]) at all. They are only of use if sprite names are limited.

Since nothing prevents any actor from using different sprite names, there's really no point whatsoever in using these frames unless you want to remain vanilla compatible.

Share this post


Link to post
DaniJ said:

FYI: Doomsday uses a percent-encoded representation rather than substituting characters. It would be nice if SLADE supported that at some point, on some level (automatic (de)encoding of names?).


I've looked on the Doomsday wiki (at sprite, sprite frame, pk3, and automatic file mapping in pk3) but did not find anything about it. Only result I got for "encoded" or "percent" was the 1.9.7 changelog, which didn't explain anything about the technical details.

If I have actual specs for how it works, I'll implement it right away.

Share this post


Link to post

Well, so basically it is character substitution: if VILE\0 is copy/pasted in a PK3 for Doomsday, it'll have to be named VILE%5C0. Right?

And do [ and ] need encoding as well?

Share this post


Link to post

Yes, all characters outside the range { a-z|A-Z|0-9|-|.|_|~ } are encoded.

Well, I guess its character substitution in the sense that those characters are being replaced with another representation. It is the same character however.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×