| Author |
Message |
C. Zoui Ree-Yees
Joined: 03 Aug 2008
|
Posted: Sep 19, 2008 02:49 Post subject: .WAX Cells: Order, Timing, and Beyond |
|
|
I need to make sure the order and timing of the cells for .gif construction corresponds with AI behavior. For some cells, the order and animation they are used to emulate is obvious, like when the Commando walks toward you. Others I can't quite place, even after trying to observe the AI. I'm also curious how the game elements determine what cells of the wax are displayed.
I'm using Cyra to get a better idea of what is proper. Below are the cells for the Commando, presented in the exact order in which they were exported via BMPDF. Cyra considers COMMANDO.WAX to have 13 Waxes, 22 Sequences, 59 Frames, and 36 Cells. After viewing each wax, it is clear that:
Wax 2 uses #20 only. Is this when the Commando aims his weapon, right before he fires?
Wax 3 uses #'s 21-27, in that order. This is the first of two death animations. What weapons does this respond to? Blasters? Anything else?
Wax 4 uses #'s 28, 29, then 23-27. This is the second of two death animations. It's the same as the first only it displays a bright white/blue impact on the chest. What weapons does this respond to? The Repeater? Anything else?
Wax 5 uses #27 only. Why is this needed?
Wax 6 uses #'s 30, 31, 32, 33, 34, 33 (Flipped Across the Horizontal), 32 (FATH), 31 (FATH), then 30. This emulates the Commando spinning around 360 degrees while standing still.
Wax 7 uses #35 only. Is this right after the Commando fires his weapon?
Wax 8 uses #'s 0-3. This is just the forward walking motion.
Wax 9 uses #'s 0-3.
Wax 10 uses #'s 0-3.
Wax 11 uses #'s 0-3.
Wax 12 uses #'s 0-3.
Wax 13 uses #'s 35 and 21. Given Waxes 20 and 35, what's this supposed to be, especially since #35 comes first?
Wax 1 uses #'s 0-3 (2x), 4-7 (4x), 8-11 (4x), 12-15 (4x), 16-19 (4x), 12-15 (FATH,4x), 8-11 (FATH,4x), 4-7 (FATH,4x), then 0-3 (2x). This is all of the walking animations rolled into one, proceeding clockwise. But does the Commando ever actually use this entire movement as a sequence (assuming you don't frag him)?
I'd guess that these 13 waxes, either by themselves or in combination, are what Kyle will encounter. But the length of them doesn't make sense; the Sequence used in Wax 8 (comprised of #'s 0-3), for example, repeats 32 times when you ask Cyra to show the wax. Wax 1 repeats different sequences numerous times. Wax 5, meanwhile, only displays its one cell once. And what's up with Waxes 8-12 displaying the exact same sequence?
Also, notice how there are no cells of the Commando facing right, yet Cyra says they are in the game. Cyra uses cells that have been flipped on the horizontal axis to display the commando moving in the right-hand direction. There do not appear to be any cells for facing right that are included in the same base level (for lack of a better description) as the others. Are the flipped cells generated on-the-fly in the game? I'd think this would be too resource intensive.
Anyways, your thoughts, if you please. I'll post questions about the timing later.
When I'm finished, each cell will also be made available separately in a single download, so people may easily use whatever order they want.
|
|
sheepandshepherd Trandoshan
Joined: 01 Apr 2008
|
Posted: Sep 19, 2008 21:24 Post subject: |
|
|
I've never really done much WAX work due to a computer that refuses to run most older programs . . . however, I'm pretty sure the cells are flipped automatically by the engine for your #4-15 frames. You can (unfortunately) notice this in-game, when an enemy should be holding a weapon in the right hand but is holding it in the left when going the other way 
|
|
lucius DarkXL Developer

Joined: 17 Feb 2008
|
Posted: Sep 19, 2008 22:57 Post subject: |
|
|
There are settings in the wax file that tell the engine to flip the sprite for given views/frame. Basically each frame has a pointer to the graphic data and can then set offsets or flip it on render to save memory. So there tends to be fewer sprites in a wax then actual frames.
_________________ DarkXL....http://darkxl.wordpress.com |
|
C. Zoui Ree-Yees
Joined: 03 Aug 2008
|
Posted: Sep 20, 2008 19:08 Post subject: |
|
|
While the real-time cell flipping saves memory, doesn't it add to the CPU processing load at the moment it is flipped? Or is it not that simple?
Re: Timing: Cyra displays animated sub-waxes much too quickly; the speed of the sub-wax as it is displayed in Cyra is unquestionably faster than it should appear in game. I don't think this has anything to do with modern vs. old hardware, but rather the default setting of what I must assume to be 5 centiseconds (hundredths of a second, cs) that Cyra uses to display all sub-waxes. Yes, you can adjust the delay between frames in Cyra and of course in the .gif program I'm using (in cs); the only question is what that delay should be. As you may have guessed by now, I'm trying not to eyeball it.
The only indication of time in Cyra that differs between sub-waxes is listed under "Frame Rate," but this isn't very helpful. Frame rate- per what? Second? Slightly complicating matters is that in the terminology of Cyra, a Frame != a Cell. A cell is the actual sprite picture (shown in my original post), and a frame is either one instance of a cell or a cell that is flipped. There is no summary listing of the # of frames per sub-wax (or to be more precise, the # of frames is listed as 0 for all sub-waxes).
It appears you can count the frames manually, though. So for sub-wax 6 which has a frame rate of 12 and 9 frames, those 9 frames will display over .75 seconds, or .0833 seconds per frame, assuming frame rate is measured in FPS. 8 cs per frame is still way too quick. What am I missing here that can tell what delay to use between frames?
If it helps, the frame rates are as follows (sub-wax #: frame rate #):
1: 5
2: 6
3: 7
4: 7
5: 12
6: 12
7: 6
8: 12
9: 12
10: 12
11: 12
12: 12
13: 6
Again, these numbers can neither represent cs (too fast) nor deciseconds (tenths of a second; too slow). And so we're on the same page, please use the words frame and cell to describe the DF resources as Cyra and myself have described them. I also use the term sub-wax to desribe a wax within a wax.
|
|
Barry Brien Dark Trooper Phase 1
Joined: 26 Sep 2003
|
Posted: Sep 24, 2008 18:33 Post subject: |
|
|
Oh wow you're a brave man. I messed with the wax once. It got messy.
I remember making hi res stormtroopers are few years back by adjusting the wax resolution. Unfortunatley they wer prone to crashing and I abandoned that project fairly soon.
|
|
C. Zoui Ree-Yees
Joined: 03 Aug 2008
|
Posted: Oct 08, 2008 02:14 Post subject: |
|
|
The Tome that is the BMPDF Readme continues to yield ancient wisdom. Additional information about a WAX can be generated in the form of a text file by using the /m switch with WAX2 while converting WAX to BMP. For the commando this gives me the following text (it not only tells me the frame rates, but also which BMPs correspond with which sequence numbers):
| Code: | #Generated by WAX2
SET INDIR
SET OUTDIR
SET PALDIR
WAX commando.WAX
PAL
WAXES 13
0: Seq8=0,1,2,3,4,5,6,7 fr=5 ww=72089 wh=72089
1: Seq8=8,8,8,8,8,8,8,8 fr=6 ww=72089 wh=72089
2: Seq8=9,9,9,9,9,9,9,9 fr=7 ww=72089 wh=72089
3: Seq8=10,10,10,10,10,10,10,10 fr=7 ww=72089 wh=72089
4: Seq8=11,11,11,11,11,11,11,11 fr=12 ww=72089 wh=72089
5: Seq8=12,13,14,15,16,17,18,19 fr=12 ww=72089 wh=72089
6: Seq8=20,20,20,20,20,20,20,20 fr=6 ww=72089 wh=72089
7: Seq8=0,0,0,0,0,0,0,0 fr=12 ww=72089 wh=72089
8: Seq8=0,0,0,0,0,0,0,0 fr=12 ww=72089 wh=72089
9: Seq8=0,0,0,0,0,0,0,0 fr=12 ww=72089 wh=72089
10: Seq8=0,0,0,0,0,0,0,0 fr=12 ww=72089 wh=72089
11: Seq8=0,0,0,0,0,0,0,0 fr=12 ww=72089 wh=72089
12: Seq8=21,21,21,21,21,21,21,21 fr=6 ww=72089 wh=72089
SEQS 22
0: Frames=0,1,2,3
1: Frames=4,5,6,7
2: Frames=8,9,10,11
3: Frames=12,13,14,15
4: Frames=16,17,18,19
5: Frames=20,21,22,23
6: Frames=24,25,26,27
7: Frames=28,29,30,31
8: Frames=32
9: Frames=33,34,35,36,37,38,39
10: Frames=40,41,42,43,44,45,46
11: Frames=47
12: Frames=48
13: Frames=49
14: Frames=50
15: Frames=51
16: Frames=52
17: Frames=53
18: Frames=54
19: Frames=55
20: Frames=56
21: Frames=57,58
Frames 59
...
Cells 36
0: bmp=comma000.bmp
1: bmp=comma001.bmp
2: bmp=comma002.bmp
3: bmp=comma003.bmp
4: bmp=comma004.bmp
5: bmp=comma005.bmp
6: bmp=comma006.bmp
7: bmp=comma007.bmp
8: bmp=comma008.bmp
9: bmp=comma009.bmp
10: bmp=comma010.bmp
11: bmp=comma011.bmp
12: bmp=comma012.bmp
13: bmp=comma013.bmp
14: bmp=comma014.bmp
15: bmp=comma015.bmp
16: bmp=comma016.bmp
17: bmp=comma017.bmp
18: bmp=comma018.bmp
19: bmp=comma019.bmp
20: bmp=comma020.bmp
21: bmp=comma021.bmp
22: bmp=comma022.bmp
23: bmp=comma023.bmp
24: bmp=comma024.bmp
25: bmp=comma025.bmp
26: bmp=comma026.bmp
27: bmp=comma027.bmp
28: bmp=comma028.bmp
29: bmp=comma029.bmp
30: bmp=comma030.bmp
31: bmp=comma031.bmp
32: bmp=comma032.bmp
33: bmp=comma033.bmp
34: bmp=comma034.bmp
35: bmp=comma035.bmp
|
The BMPDF Readme provides the following information to interpret this:
Quote:
WAX is WAX file structure corresponds to some enemy state: walking,
firing, dying, lying dead and so on. Usual assignments are:
(No .WAX file contains more than 14 WAXES out of 32 possible). WAXES entry
number (number, not tag!):
0 - walking
1 - attacking (primary)
2 - dying
3 - dying from strong hit (mine, TD, repeater, so on)
4 - lying dead
5 - staying still
6 - ? (Usually walking)
7 - special attack (TD for reeyees, green junk int. droid)
8 - ? (Usually walking)
9 - ? (Usually walking)
10 - ? (Usually walking)
11 - ? (Usually walking)
12 - getting hit
13 - special action (Using shield for D_TROOP1, flying up for
D_TROOP2 and D_TROOP3)
This pattern may vary (see dianoga for instance).
And finally, according to this excellent page, the "fr" in the generated text file refers to frame rate, or simply the # of frame changes per second. These numbers correspond with the numbers Cyra was giving me, and now that I'm sure how to interpret them, I can space the gifs properly. As it turns out, the number of total frames is irrelevant to the speed at which they are displayed, at least for my purposes.
|
|
C. Zoui Ree-Yees
Joined: 03 Aug 2008
|
Posted: Oct 08, 2008 02:42 Post subject: |
|
|
Riiiiiiiight.
The 8 frames below are clearly designated at 5 fps. 5 FPS = .2 seconds per frame.
The Commando clearly loves two things: The Emperor and speed. This still looks way too fast.
|
|
CarlosG Ree-Yees
Joined: 25 Sep 2003
|
Posted: Nov 11, 2008 23:06 Post subject: |
|
|
If I recall back then I tried to make sense of a file that little was known about. Since then quite a lot has been discovered and redefined I think. But for the time I think I guessed pretty well as to the meaning of the data. Lucas held the true meaning of the data tightly to the chest only leaked out snippets from time to time. So I spent a summer one year furiously coding cause it was quite thrilling.
The code was pretty solid and written for DOS so the extreme acceleration of the animated frames in Cyra on a modern computer is understandable.
Man its wierd to find this place still active.
|
|
Burning Gundam Kell Dragon
Joined: 28 Sep 2003
|
Posted: Nov 12, 2008 00:36 Post subject: |
|
|
And I think it's even weirder that veterans from back in the day are showing up again
You gonna stick around for a while?
_________________ I don't think outside the box... I customize it. |
|
CarlosG Ree-Yees
Joined: 25 Sep 2003
|
Posted: Nov 12, 2008 01:17 Post subject: |
|
|
Burning Gundam wrote:
And I think it's even weirder that veterans from back in the day are showing up again
You gonna stick around for a while?
Well I just don't know Mr. joined three days after I did. hehe
Actually I was looking for some old lyrics to a song I penned back in 98. So I logged on to an old computer and stumbled across an html archive of some utils I wrote for you know what. Naturally I clicked the df-21 link and was stunned and happy to see that the place is still alive.
So I have spent a few hours here reading and reminiscing. It is quite fascinating to see some new talent take a swing at building a new engine and new tools. Exciting days indeed.
No doubt that Duke Nukems Build engine and editor is hands down my favorite editor of all time. And If I understand correctly that the author of the new engine has modeled his after Build, well then all is right in the world of DF.
Very cool.
|
|
The MAZZTer Death Star

Joined: 25 Sep 2003
|
Posted: Nov 12, 2008 01:31 Post subject: |
|
|
I joined one day after you did, I've got seniority over him! 
_________________ http://www.mzzt.net/ | I am a respectable admin with a respectable sig. |
|
CarlosG Ree-Yees
Joined: 25 Sep 2003
|
Posted: Nov 12, 2008 23:01 Post subject: |
|
|
The_Mega_ZZTer wrote:
I joined one day after you did, I've got seniority over him! 
Hey ZZTer. Long time no type. I see that you are still kicking around this dusty hole in the web.
|
|
Nottheking Kell Dragon
Joined: 29 Sep 2003
|
Posted: Dec 10, 2008 20:54 Post subject: |
|
|
I missed out on the party as I was busy for a few days. Still getting used to being a college student and all at that point...
As for the image-flipping, yes, it technically uses a bit more CPU power, but it's largely inconsequential, since in many cases all it needs do is blit the image in the opposite direction, in which cases the extra CPU cost is zero. More importantly, I believe there was like a 36-frame limit or something on WAXes, which makes that by FAR the most constrained resource, so even the problem with the commandos being swap-handed is worth putting up with in order to save a good number of frames.
_________________ Wake up, George Lucas... The Matrix has you.. |
|
|