Unofficialcrusaderpatch: .sav/.map file format documentation

Created on 1 Jul 2019  路  10Comments  路  Source: Sh0wdown/UnofficialCrusaderPatch

Do you have more information about how the savegame file is structured? It seems to be compressed, but I don't know how.

The program Stronghold PNGer can extract the map preview image from .map files (renamed from .sav). Unfortunately, I can't reach its author.

Most helpful comment

Here are some information and maybe someone can help him. https://github.com/metalvoidzz/Sourcehold/wiki/Stronghold-asset-formats

All 10 comments

Here are some information and maybe someone can help him. https://github.com/metalvoidzz/Sourcehold/wiki/Stronghold-asset-formats

It seems that , this entropy image

Screenshot from 2019-07-01 19-03-01
(made here) suggests that it may be compressed, possibly even with a custom algorithm (wouldn't suprise me, given .tgx and the other custom formats). I'm not sure though, a live debugging analysis of the executable may be required.

Is there some discord or something where we can collaborate on this in realtime?

I created https://discord.gg/736X9H a while back for Sourcehold, but I mainly use it for notifications ;-)

@void4 map's image is stored inside map file so it is pretty easy to get it. Tool your mentioned doesn't create it from scratch. I have some knowledge about map file so if you don't need whole file structure but only some specific fields maybe I can help you.

About that compression, I think I have some info that could help determine the algorithm. First of all, the Stronghold.exe actually contains the copyright text for the PKWARE compression library, which could have been used for the map files. Secondly, the tool http://aluigi.altervista.org/mytoolz.htm#signsrch reports a lzari signature at offset 0x36c8 for the map Calanais. Both formats seem to be known.

Btw, maybe we should talk somewhere else, since this has nothing to do with the patch itself.

Whole issue has nothing to do with the patch but it is still open so I don't think project author has something against it.
Yes, some map fields are compressed with pkware compression (btw map preview image is among them). And this is the only compression used. But that is not the problem. Uncompressed fields still aren't human readable text data (who would doubt that). They are same binary blobs. And until you find which blob is responsible for what game data, they are as useless as compressed.

Cool, if there is an easy way to uncompress those fields, it's probably not too hard to figure out the structure by comparing to a changed version. How did you actually uncompress them?

I inject my code and use game's decompression method.

To give an update after one year, the map-file format (including the decompression and the preview image) is documented here and here.

I think this can be closed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Truetobi91 picture Truetobi91  路  3Comments

felicedanieli picture felicedanieli  路  3Comments

ByBurton picture ByBurton  路  3Comments

Mozarz picture Mozarz  路  3Comments

Krarilotus picture Krarilotus  路  3Comments