WindThunder ANI_FILE V1.0 Format

All animations in WindThunder’s Heroine Anthem I&II are stored in the proprietary ANI_FILE format. Their extension is usually .APS, .000 or .001.

The ANI_FILE format is a running format designed to be streamed and played in real time. It’s a little reminiscent of the ANI-JPEG format that never really caught on.

The format begins with a similar header to the AMP_FILE format used for still graphics, but rather than specifying two file sizes, it specifies a file count. For ‘x’ iterations, the game flies through the images stored in the ANI_FILE. Each image begins with a little endian long file size.

At the end of the file, after all the images, is a data footer controlling the image’s animation. The format of this footer is currently unknown.

ID Tag: 'ANI_FILE V1.0' [14 bytes, string]
Image width [4 bytes, long]
Image height [4 bytes, long]
File count [4 bytes, long]
(file loop)
  File size [4 bytes, long]
  (data)
(end loop)
(footer)

A proof of concept to extract an ANI_FILE to a series of images and a data chunk of the footer is included below:

$filename = '001_2b.aps';
$fd = fopen($filename, 'rb');
if(rtrim(fread($fd,14)) != "ANI_FILE V1.0") die;
$imgwidth = unpack('V*', fread($fd, 4));
$imgheight = unpack('V*', fread($fd, 4));
$count = unpack('V*',fread($fd, 4));
for($i=0; $i< $count; $i++) {
  $filesize = unpack('V*', fread($fd, 4));
  $fo = fopen($filename.'.$i', 'w');
  fputs($fo, fread($fd, $filesize));
  fclose($fo);
}
$fo = fopen($filename.'.dat', "w");
fputs($fo, fread($fd, filesize($filename)-ftell($fo)));
fclose($fo);
fclose($fd);

Sample Animation

These files were produced by animating the output of the above code block using VideoMaker.



Info

My name is Derrick Sobodash.

I live in Beijing, China, where I work as a professional copy editor and freelance journalist. My articles have appeared in The Oakland Press, Beijing Today and PiQ.

You may contact me for any reason at derrickļ¼ cinnamonpirate.com or find me on Facebook and Flickr.

Photostream

Dusk across from the Silk MarketSunset on Jianguomen WaiGardens at West Longtan LakeGrounds crew in West Longtan LakePracticing Olympic songsFamilies fishing in West Longtan LakePreening ducksComing in for a landingDucks taking offDucks chasing each other in West LongtanStretching his wingsDuck cleaning its feathers