-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import/export Anno 1800 stamps #448
Comments
DecompressionStamps are zlib compressed RDA files (use the attached interpreter file: stamp.zip).
import zlib with open("path/to/stamp", "rb") as f: content = zlib.decompress(f.read()) with open("stamp.bin", 'wb') as f: f.write(content)
Trivia
Dev notes
My plans
CaveatsExporting AD files to stamps requires a lot of investigation:
|
Open questions about the stamp format
|
|
Its worth mentioning as well - we already have some logic to map an object in a layout to the Anno building it probably represents in the statistics calculation code. I'm not 100% sure if we can use it to map to a GUID, but would be worth a look. |
Complete process of turning a stamp into an AD file: https://github.com/NiHoel/Anno1800SavegameVisualizer/blob/main/stamp_converter.py |
I cobbled together a quick data model for serialization of stamps, maybe that can help you guys with the export: https://github.com/taubenangriff/StampDataModel/blob/master/StampDataModel/Stamp.cs |
I haven't have success with recompressing decompressed stamp so far. Would you have some insight how Anno uses zlib to compress files? I decompressed/recompressed with python implementation of zlib (compression done with all 9 compression levels and all valid wbit values) but no luck so far. The results looked the most similar (about 80% binary equal with long streaks of same bytes) with either 8 or 9 level of compression |
Also @taubenangriff since your FileDbReader is needed to convert stamps to XML: how would you propose we use your FileDbReader in AD to read stamps?
|
I recommend just using the filedb library (FileDBSerializer.dll) for this usecase, create the stamp data model from annodesigner data, and then serialize the data model to the file. You can see https://github.com/taubenangriff/StampDataModel/blob/master/StampSerializingTest/Program.cs for how creating and loading a stamp is done. |
also, the game uses zlib compression level 8, BUT with 12 bytes added at the end of the compressed result:
|
You can not simply use "0" for the Pos, some need 0.5. So the combinations you have to try for a single centered building are: buildingsize ist zb: [6,6] für ein 6 mla 6 Gebäude.
buildingsize can be calculated like this (code base from Dux Vitae):
|
@Serpens66 You can find all your exceptions (and more) here: https://github.com/NiHoel/Anno1800SavegameVisualizer/blob/bcd4b26983c8a8f9946d957a623dcc62afa7453f/tools/params.py#L3536-L3863 Coordinates are corners of the blocked area. |
Anno developers added "Stamps" in last game update. Stamp is a collections of buildings and roads (maybe other things). It would be super helpful to be able to import them from to AD and also export them to Anno 1800 compatible stamp.
The text was updated successfully, but these errors were encountered: