View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,995

Violet CLM has disabled reputation

Aug 6, 2011, 01:53 PM
Violet CLM is offline
Reply With Quote
.lev file format research thread

This thread is to be used to coordinate research into the structure of the LEV files used by Jazz 2 versions 1.00g and 1.00h. You can find and download them easily enough on your own if you don't have them already. Helpful links:
Start of the file:
Code:
char Signature[4] = "DDCF";
long FileLength; // actually length minus eight
char Section1[4] = "EDIT";
long Unknown; // always 196?
char LengthOfTilesetFilename;
char TilesetFilename[LengthOfTilesetFilename];
char Unknown;
long Unknown; // always 2?
Then follow names for all eight layers, each preceded by single chars specifying their string lengths, then a series of null bytes padding until the size reaches 212. Next is the "EDI2" label, signalling the start of another section containing... what?

The "EVNT" section near the end contains the event map, and seems by all indications to have the same structure as Data2 in J2L files. (As far as I was able to discover some years back, Springcord is the only event that works in 1.00 but not 1.23.) The "CMAP" section is the tileset palette, and does not include alpha values.

The "HSTR" (Hint String) section near the top is pretty simple, although different from the .j2l equivalent. First is a long that gives the length of the whole section, minus four. Then a short that looks always to be 256, which I'm guessing is the maximum length of a hint string. Finally (at least) sixteen sets of length char + string, just like for the layer names. Unused hint strings are simply a single null byte, indicating that the length of the string is 0. It looks like there's a little padding going on, since the number of null bytes at the end is not always 16-number of other hint strings.

The "TILE" section appears to begin the tileset section of the file (minus the palette). It consists of two longs, and the first is the distance to the LAYR section.

The first "INFO" section is the "tile types," which in 1.00 basically just means translucent or not. There's a long encoding the remaining length of the section (minus that long), and then ANOTHER long encoding the remaining length of the section (so, minus both longs), and then one byte per tile. Interestingly, while Castle1 uses the full 660-tile version of the tileset, Race1, Trainer, and Battle1 all contain the original 540-tile version.
__________________

Last edited by Violet CLM; Aug 14, 2011 at 07:24 PM.