READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Cultures 2 file formats

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
User avatar
Molt
ultra-n00b
Posts: 4
Joined: Mon Aug 19, 2013 3:57 pm
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Cultures 2 file formats

Post by Molt » Tue Aug 20, 2013 7:27 pm

Hello everyone

A bit more than two years ago I started looking into the resources and file formats used by the Cultures 2 engine (Games like "Northland" and "8th Wonder of the World"). I managed to extract the data0001.lib on my own and found the method to decode .cif file in this thread soon after. Since then I worked on the remaining files every now and then and I think I got somewhere, but I need help now.

So first, if you don't have a game from the Cultures series, you can download a demo of Northland here.
All the resources are stored in datax/libs/data0001.lib which can be opened using game extractor.

There are 4 file formats left:
(Info: numbers are little-endian)

Edit: I managed to decode bmd and fnt by now, below is the original text and an updated file format description.
.bmd - The models. I've tried model editors/viewers for Mario Sunshine and Mu Online which use the same suffix, but it's either a different file format or I'm too dumb to use these editors.
I get results in the right direction:
Image
Sometimes though:
Image
Looking at a single row of pixels, where there are currently single transparent pixels there has to be a gap, but I can't figure out how to determine its length.

.fnt - The fonts. Nothing else than bmd files with an additional 16-byte header.
format.pdf
map.dat - Map core files. Contains the terrain and landscape information. (Inside the lib, look in data/maps, every folder there contains a map.dat)
I figured out every file has 40 sections, each containing an 32-byte header starting with "hoix" and 4 more letters. Sections 28 (I start counting at 0), 31 and 36 are palettes containing the names of terrain patterns, transitions and landscapes.
I didn't find out how to read all the other sections, but almost every one of them contains "kcpX6elr" or "kcpX8elr".
The 12th to 15th bytes in the section header give the length of the section excluding the initial 32 bytes.
The "palettes" look like this:

Code: Select all

palette {
    u4 number_of_entries;
    entries[number_of_entries]{
        u1 length_of_entry;
        char[length_of_entry] string;
        u1 nullbyte; // just a 0x00
    }
}
.sav - The savegame. Seems to have the same format as the map.dat, but different sections as it also has to contain player data, figures, buildings, etc.


If you'd like to see the utilities I built myself, just ask.
Any help would be greatly appreciated.

Kind regards
Molt
You do not have the required permissions to view the files attached to this post.
"I love walking in the rain because no one can see me crying."
— Rowan Atkinson

User avatar
Molt
ultra-n00b
Posts: 4
Joined: Mon Aug 19, 2013 3:57 pm
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Cultures 2 file formats

Post by Molt » Sat Aug 24, 2013 5:18 pm

Ok, I managed to decode the .bmd/.fnt file format(s) and I updated the format.pdf file above.
Left are the map and the save formats.
Here's a bundle containing two maps I created, two saves and the tool I'm currently working with (written in PHP).

[ Download ] (Sorry for doing it this way, file is too big to be attached)

Again, any help on those would be greatly appreciated.

Kind regards
Molt
"I love walking in the rain because no one can see me crying."
— Rowan Atkinson

Post Reply