Page 2 of 3
Re: Zone 66 compression format
Posted: Tue Nov 16, 2010 6:22 pm
by Darkfox
Malvineous wrote:Hey Darkfox - you said you were interested in the Zone 66 music? I just found a new track I've never heard before, so perhaps you know where in the game it is used (maybe win/game over music or something.) I discovered it as I was browsing through the decompressed files, it looked the same as the other songs. (And I also extracted a CDFM/670 file from the
Amnesia demo and they look the same as well, so now I'm certain this is the music format used.)
The song is stored in zim00.z66 (Adlib version), zim01.z66 (SB version) and zim02.z66 (GUS version).
To listen, overwrite m01gmuz.z66 (the SB version of the intro song) with zim00.z66 or zim01.z66, or for the GUS version, overwrite m03gmuz.z66 with zim02.z66. Then run the game (in DOSBox use "zone66 /sb" or "zone66 /gus" depending on which version you want to hear.)
Granted I never made it all the way to the end of the game, but it's still a surprise to hear a new song! (And this is the second time Zone 66 has done it, I was just as surprised when I found the GUS version of the intro music is a different song to the SB version.)
I do NOT recognize this track either, nice find! But I speculate that this is the end credits/sequence theme. I've never beaten all the zones but I could try to sometime to be certain.
And nice discovery john_doe!

I was wondering where those were stored.
Re: Zone 66 compression format
Posted: Tue Nov 16, 2010 6:48 pm
by john_doe
Also some quick info:
SHIPDAT0.Z66, SHIPDAT1.Z66 and MAPDAT.Z66 are recreated each time when the game starts. The ship files collect player/enemy ship data from each MAP?DAT3.Z66 file and MAPDAT is a list of available maps.
Re: Zone 66 compression format
Posted: Tue Nov 16, 2010 11:47 pm
by Malvineous
Very useful, thanks for the info! I'm (slowly) documenting all this on the
ModdingWiki as I get it implemented in my own utility, and crediting john_doe with it - but let me know if you would prefer some other name to go there instead!
Re: Zone 66 compression format
Posted: Wed Nov 17, 2010 1:43 pm
by john_doe
And here's the spec for MAP?DAT3.Z66. There are still some unknown values left to decipher.
Code: Select all
MapDat3 {
uint8 textColor; // some text color, no clue where this is used
uint8 cannonCount;
uint8 enemyShipCount;
uint8 playerShipCount;
uint8 unk[32]; // This is also stored in MAPDAT.Z66 on game startup
CannonDef cannons[cannonCount];
ShipDef enemyShips[enemyShipCount];
ShipDef playerShips[playerShipCount];
}
CannonDef {
// The unknown values here are also probably similar to the ones used in the ShipDef (armor etc.)
uint16 chunkSize;
char gfx[2]; // Used to build the filename for the graphics in the form "CN??GRFX.Z66"
uint8 unk1;
uint8 gunCount;
uint8 unk3;
uint8 unk4;
uint8 unk5;
coord gfxOffs[16];
coord gunOffs[gunCount];
}
ShipDef {
uint16 chunkSize;
char gfx[2]; // Used to build the filename for the graphics in the form "SH??GRFX.Z66"
char shipName[32];
uint8 payload;
uint8 fuel;
uint8 armor;
uint8 topspeed;
uint8 accel;
uint8 turning;
coord gfxOffs[16];
// No clue what these unks are used for
coord unk1, unk2;
uint8 unk3;
uint8 enginesCount;
coord enginesOffs[enginesCount];
uint8 gunCount;
{
uint8 gunType;
uint8 gunDirection;
coord gunOffs[16];
} guns[gunCount];
}
Re: Zone 66 compression format
Posted: Thu Nov 18, 2010 12:19 pm
by john_doe
I went though the others files left (besides maps, cannon/ship graphics and music):
Code: Select all
CNG.Z66 - Credits text
DEMOK.Z66 - Recorder demo
DEMOT.Z66 - Text displayed during demo
DSFX.Z66 - Sound effects archive (some are raw, some with a ScremTracker 3 instrument header)
ET.Z66 - Text screen
FONT/FONT2.Z66 - Pretty obvious
INSTR.Z66 - Instructions text
MAINGRFX.Z66 - Sprites for weapons/explosions/smoke
MAPAM0.Z66 - Sprite for the tornado
MAPBM0.Z66 - Sprites for water effect (?)
MAPCM0.Z66 - Sprite for a single bird
MAPDM0.Z66 - Sprites for clouds and birds
MISCGRFX.Z66 - Misc sprites (radar etc.)
OS.Z66 - Ordering info screens (uncompressed)
SBG.Z66 - Background screen for campaign texts
TITLE.Z66 - Title screen
ZIL0/1/2.Z66 - Intro animations
ZONE66T.Z66 - Company intro screens
Also, I had a look at MAP?DAT4/5/6.Z66. While 5 and 6 contain the text before and after a campaign, they, along with DAT4, also contain a little x86 code which is executed. I have no clue what that code exactly does.
Re: Zone 66 compression format
Posted: Sun Nov 28, 2010 7:18 am
by Darkfox
I look forward to the day it is possible to make custom map/ship packs. Would add to the fun of the game to have easily added user content (easy because there are several unused letters so no need to replace maps, and they are automatically added to the list). Looking forward to Camoto, not just for Zone 66 support but music conversion as well.

Re: Zone 66 compression format
Posted: Tue Nov 30, 2010 11:47 am
by john_doe
I actually thought about making a map/sprite editor since we now know enough to create our own maps and ship sprites.
If I decide to do it, I'll probably write it with Lazarus/Free Pascal since I want it to be cross-platform (Win and Linux) and also want a reasonable UI. I would write it in C++ but I'm not familiar with wxWidgets or similar toolkits. Writing it with SDL only would also be possible but it would have a non-standard UI....
Edit: I started with the editor

in Lazarus. Only time will tell when it's in usable state, though.
While working on it I just remembered that I forgot one thing: I don't know yet how animated tiles are handled. The graphics for these are also in the MAP?GRFX file but I can't find (yet) anything about number of frames etc.
Edit 2: It seems the animation info is also stored in MAP?DAT, I only read part of that file so far.
Re: Zone 66 compression format
Posted: Wed Dec 01, 2010 10:45 am
by john_doe
Here's the structure for MAP?DAT.Z66 (in pseudocode again):
Code: Select all
Map {
uint16 tilesCount;
uint16 animatedTilesCount;
// Tiles with an even index are normal, odd index is the destroyed tile
uint16 tiles[tilesCount * 2];
// Score given when this tile is destroyed
uint18 tilesDestroyScore[tilesCount];
// Map with info if the given tile can be destroyed (1) or not (0)
uint18 tilesDestroyable[tilesCount];
{
// Tile index in tiles of the tile to be animated
uint16 tileIndex;
// First/last index into the tile graphics
uint16 firstTileGfxIndex, lastTileGfxIndex;
// 0: tile loops; 1: tile is played forward, then backward (ping-pong)
int8 tileLoop;
// Used only internally by the game
uint8 unused1, unused2;
// Ticks until the next tile graphic is displayed
uint8 tickCount;
} animatedTiles[animatedTilesCount];
}
Re: Zone 66 compression format
Posted: Thu Dec 02, 2010 9:54 pm
by Darkfox
That would be awesome and great find on the animated tiles! Will there eventually be a way to easily customize ships, their weapons, stats, and so forth or is that part of the ship graphic editing? When using ships as bases it is difficult to add guns, for instance, since I have to add positional coordinates per gun which in turn as I recall have to be manually recalculated in the file size.
Re: Zone 66 compression format
Posted: Mon Dec 06, 2010 10:40 am
by john_doe
Yes, I'm planning to make everything customizable where we know the format with a nice GUI.
Here are some very early screenshots:
The map editor:
http://img593.imageshack.us/img593/1822/screen1s.png
The map editor showing all tiles as destroyed:
http://img593.imageshack.us/img593/9493/screen2c.png
The map obect editor (cannons ans enemy/player ships):
http://img411.imageshack.us/img411/117/screen3gz.png
The ship editor:
http://img109.imageshack.us/img109/3482/screen401.png
I'll also make a sprite (ship and cannon) editor where guns etc. can be placed on a grid like the map.
Re: Zone 66 compression format
Posted: Mon Dec 06, 2010 11:30 pm
by Darkfox
That sounds and looks really good, great work!
Re: Zone 66 compression format
Posted: Fri Feb 04, 2011 4:55 am
by Darkfox
Sorry to bump but haven't read or seen any updates on this in around 2 months, any updates or things get really busy? Just curious, since it was looking really far in, most stuff was worked out and all. Noticed Camoto stalled too, guess school/jobs came into play.
Re: Zone 66 compression format
Posted: Sat Feb 05, 2011 3:23 am
by Malvineous
Yeah there's never enough time in the day unfortunately. Especially not when
linux.conf.au is happening, and someone put malware all over my web server and it had to be reinstalled. Oh and
my city flooded
As for Camoto, it's able to decompress the files and edit some of the graphics, but more recently I've gotten sidetracked by the music converter (not Z66 related...yet) as I got annoyed with some very difficult to find bugs in the Blood RFF encryption code. So it may take a while, but we'll get there in the end!
Re: Zone 66 compression format
Posted: Sat Feb 05, 2011 9:02 am
by Darkfox
Ooh, woah, think I heard that on the news, sorry to hear that man, everything alright there? Wasn't much damages was there? And damn kids and their malware...
And oh? You mean the portion of Camoto that will be the successor of DRO2MID and other such tools? I'm looking forward to that as well so I don't mind, really.

.
Re: Zone 66 compression format
Posted: Sun Feb 06, 2011 3:09 am
by Malvineous
Yeah everything's almost back to normal now, just a lot of cleanup going on. My local supermarket is still closed while they clean out the mud, but at least I didn't have to rip out and replace everything in my home (including the walls) like those people whose places went under...
And yes, this is the DRO2MID replacement part of Camoto. Currently it can convert between IMF, WLF, RAW and DRO v1+v2 formats (all Adlib/OPL) so the main bits left are MIDI support and a GUI.