Pyrdacor / Ambermoon

Resources for the incredible Amiga game Ambermoon
91 stars 8 forks source link

/ ! \ data files from v1.08 up to v1.10 are faulty / ! \ #15

Closed dlfrsilver closed 3 years ago

dlfrsilver commented 3 years ago

Pyrdacor, i made different tests, and i have found where the problem comes from.

Basically, v1.07 from Thalion webshrine works fine on A500 512 chip +512 fast.

Version v1.08, v1.09, v1.10 just fail on A500 configuration.

I did a simple test : load the program from disk with disk A v1.07, then use disks B to I from the v1.10 set containing your data files modified.

It crash no matter what. So, there are 2 news, one good and one bad.

The good news is that all the modifications you did to fix the game data files are OK, no problem there.

The bad news is that you changed the data files byte structure (at least text data files like xMap_Texts.amb for instance).

How did i noticed that ? Simple :

I use the automatic Ambermoon data files ressourcer that CFOU, my partner in crime programmed for me in 2013 when i did the translation in french of the game.

The data files are crippled, because the ressourcer once i process the files from files 'xMap_Texts.amb' for example, outputs all the texts with the first character and the last character chopped off.

The problem never happen with v1.07 data files.

The game parser is very unforgiving on that matter. I seem to remember that you shorten some bytes in the text data files, but the parser seems to not like it......

What should we do now ?

Pyrdacor commented 3 years ago

@nicodex Could you provide the additional buffer sizes or the offset in the executables? That would be awesome.

CmpSpace in this table: https://gitlab.com/ambermoon/research/-/wikis/files#file-ids (0 = not compressible)

OK so all savegame related files are not compressable.

Would be interesting to see your approach for finding longest matches. Did you see my implementation yet? Not sure how good it is, but it compresses a bit better than the original. But I guess the word alignment might reduce effectiveness.

dlfrsilver commented 3 years ago

Pyrdacor, what is the command if i want to unpack an archive with with hexa filename instead of numbers ?

example : '016' in hex instead of '022' ?

dlfrsilver commented 3 years ago

Please be patient and let me adjust the packer tomorrow. Then we will see if it works, ok?

Ok, i will then toy with the french version :)

Pyrdacor commented 3 years ago

Pyrdacor, what is the command if i want to unpack an archive with with hexa filename instead of numbers ?

example : '016' in hex instead of '022' ?

Add -x like AmbermoonPack.exe UNPACK 2Map_data.amb 2Map_data -x

dlfrsilver commented 3 years ago

Thanks!

Le mer. 15 sept. 2021 à 20:55, Pyrdacor @.***> a écrit :

Pyrdacor, what is the command if i want to unpack an archive with with hexa filename instead of numbers ?

example : '016' in hex instead of '022' ?

Add -x like AmbermoonPack.exe UNPACK 2Map_data.amb 2Map_data -x

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pyrdacor/Ambermoon/issues/15#issuecomment-920294435, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVPMYYVOJQN3EZXRR6FKLQDUCDT37ANCNFSM5D4LBNNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

dlfrsilver commented 3 years ago

Hello, please try also with this file (i have refactored it with the LOB packer, with the help of the excel file from Pyrdacor data fixes) :

https://we.tl/t-SNPij8OC8Z

Pyrdacor commented 3 years ago

Hi @prophesore. Sounds like some text is referenced which is no longer present. I assume the "nothing" entry. Between 740 and 014 there is the last and first row of world maps. Does it happen at every x location or only in a similar x range (740 to 040)?

There was a reported bug that you can't reach location 0,0 but I could not reproduce it. Maybe it is related?

I will have a look at the snakesign crash as well.

Pyrdacor commented 3 years ago

I had a look about the gemstone coordinates. It might all related to the snakesign map texts.

nicodex commented 3 years ago

[...] but I have one more (less likely) idea: could it be the kickstart version?

Once I found an issue in the v1.04 patch with v39+ Kickstarts. Of course the game checks the version, but on closing the game it passes random data to a lib call. Not related (because it is cleanup code), but might still be there in v1.05.

dlfrsilver commented 3 years ago

Nico, have you found what triggers in the code the eagle bug? :)

Le mer. 15 sept. 2021 à 23:10, Nico Bendlin @.***> a écrit :

[...] but I have one more (less likely) idea: could it be the kickstart version?

Once I found an issue in the v1.04 patch with v39+ Kickstarts. Of course the game checks the version, but on closing the game it passes random data to a lib call. Not related (because it is cleanup code), but might still be there in v1.05.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pyrdacor/Ambermoon/issues/15#issuecomment-920378072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVPMYYVSCHM7VNOZK4TKHLLUCEDTNANCNFSM5D4LBNNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

dlfrsilver commented 3 years ago

By the I have a working game on adf for a500 (disk A, B, C, D, E, F). Disk G will be finished soon.

Le mer. 15 sept. 2021 à 23:20, Denis Lechevalier @.***> a écrit :

Nico, have you found what triggers in the code the eagle bug? :)

Le mer. 15 sept. 2021 à 23:10, Nico Bendlin @.***> a écrit :

[...] but I have one more (less likely) idea: could it be the kickstart version?

Once I found an issue in the v1.04 patch with v39+ Kickstarts. Of course the game checks the version, but on closing the game it passes random data to a lib call. Not related (because it is cleanup code), but might still be there in v1.05.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pyrdacor/Ambermoon/issues/15#issuecomment-920378072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVPMYYVSCHM7VNOZK4TKHLLUCEDTNANCNFSM5D4LBNNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

dlfrsilver commented 3 years ago

Done : here is the v1.10 in ADF, with all the files that needed rework done :

https://we.tl/t-2OAXPwKhkO

Enjoy !

dlfrsilver commented 3 years ago

it should not happen for very small files like 1Map_texts.amb. Did you really test to only replace this single file?

Are you are asking me? No. I replaced 2Map_texts.amb that contains the data at the very start of a new game. I can try JUST 1Map_texts.amb if you give me an example of where in the game this data is used.

file numbers in 1map_texts.amb

0-nothing (6 bytes) 58-oasis water of life 525/155 87-before Illien 106-in front of the crypt next to Nelvin's Tower 125-Temple of Gala-5 texts 138-Orc Cave-Selena + in front of Old Dwarf Labirynth 140-hut on the Hoimon Desert-3 texts 148-Fire Thistle 154-Orc Cave-Weird Stone-2 texts 155-lizards in the Hoimon Desert 156-signpost in front of the Hoimon Desert-2 texts 181-before the Labirynth of Gnomes with Targor 184-Lebab Tower-4 texts 185-Kalmir Herb-2 texts 197-temple of the winds-2 texts 229-rock against the Donners Old Labirynth-2 texts 232-signpost at Snakesign-2 texts

I play E-UAE on A1200 Blizzard 30/50 v1.09 and v1.10. The first island is easy, but you can't get to the Gemstone after that. After reaching line 740 from the North and 014 from the South, the game shows an error in the map file. You can fly to the Gemstone from the northwest but getting to the wall is a crash. Pass through the teleport to the Snakesign crash. I stole an eagle and landed inside a Snakesign but crash upon entering the gate.

After losing 1map_texts.amb from version 1.07, everything is fixed. Maybe the problem is cooperation with 1map_data.amb?

To Pyrdacor - in the file with errors in Excel, he writes that the attributes of Valdyn and Leonaria have been corrected - not true (maybe in version 1.07e or WHDLOAD?).

@prophesore : from what you say, it looks like you play with an unpatched version. What you point has been fixed.

nicodex commented 3 years ago

Would be interesting to see your approach for finding longest matches.

I'm using a topologically sorted weighted directed acyclic graph. Ultimately, it boils down to generating all possible code variants and finding the shortest path (in coded bits) from the beginning to the end. The temporary memory requirement for the graph is (uncompressed_size + 1) * 4 * sizeof(size_t), which is expected to be available on every build system (the Ambermoon data blocks are not that large).

https://gitlab.com/ambermoon/research/-/blob/master/src/am2crunch.c#L244

I also started to add optimizations for the encoding of the alignment, but the code is neither ready, nor published (not that important, because it might only save a single byte in corner cases, which might be eaten by the alignment requirements).

Did you see my implementation yet?

No spare time for any review yet, sorry :)

a1exh commented 3 years ago

Out of curiosity. Were the changes @Pyrdacor made to the TextWriter necessary? They were not the cause of the crash. Not suggesting reversing the change but I am curious to know if the changes were beneficial or superficial.

Pyrdacor commented 3 years ago

@a1exh Good question. I don't think it was necessary but I can't tell for sure. If you have some minutes you could test yourself by taking 2Map_texts.amb from 1.09 english (unfixed LOB and trimmed texts), depack it and try to use it on a 68000 CPU.

@nicodex Interesting. I used a Patricia Trie but I know it's not the best approach. I think sequences of identical bytes could be compressed much better. I will add this as an optimization later. Especially when thinking about Ambermoon Advanced and much data to add. :)

Thanks again for your insight. I guess you could help us a lot to understand some parts of the executables. Maybe even fix some code-related bugs.

The LOB compression works fine now and I released updates for 1.10 english and 1.09 german. Moreover I added the ADF images.

dlfrsilver commented 3 years ago

Thanks for the fix, It will be very handy to recrunch the French version in batch mode. :) Envoyé depuis mon mobile Huawei-------- Message original --------Objet : Re: [Pyrdacor/Ambermoon] / ! \ data files from v1.08 up to v1.10 are faulty / ! \ (#15)De : Pyrdacor À : Pyrdacor/Ambermoon Cc : dlfrsilver ,Mention @a1exh Good question. I don't think it was necessary but I can't tell for sure. If you have some minutes you could test yourself by taking 2Map_texts.amb from 1.09 english (unfixed LOB and trimmed texts), depack it and try to use it on a 68000 CPU. @nicodex Interesting. I used a Patricia Trie but I know it's not the best approach. I think sequences of identical bytes could be compressed much better. I will add this as an optimization later. Especially when thinking about Ambermoon Advanced and much data to add. :) Thanks again for your insight. I guess you could help us a lot to understand some parts of the executables. Maybe even fix some code-related bugs. The LOB compression works fine now and I released updates for 1.10 english and 1.09 german. Moreover I added the ADF images.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.