Skip to content
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

AmbermoonTextImport tool on Linux: scrambles AMB text file? #27

Open
iancrossfield opened this issue Feb 18, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working tools Issues related to the tools

Comments

@iancrossfield
Copy link
Contributor

Following up on the thread in #25 , but now this seems more like an 'issue' discussion:

On my Ubuntu 20.04 system, the Linux version of AmbermoonTextImport seems to produce a 'scrambled' version of the referenced text file (see details below). First, the incorrect text file rears its head as shown in the following example:

Example :

Successfully Export the original AMB file:

./AmbermoonTextImport -e /path/to/Amberfiles NPC_texts.amb ~/temp/nt2/

Reading texts from sub-file 1 ... done
Writing texts to '.../temp/nt2/NPC_texts.amb/001' ... done
Reading texts from sub-file 2 ... done
Writing texts to '.../temp/nt2/NPC_texts.amb/002' ... done
... [usw.] ...
Reading texts from sub-file 70 ... done
Writing texts to '.../temp/nt2/NPC_texts.amb/070' ... done

Successfully re-import the exported files:

./AmbermoonTextImport -i path/to/Amberfiles NPC_texts.amb ~/temp/nt2/

Looking for text data in '.../temp/nt2/NPC_texts.amb' ... done
Found 454 texts in 70 filled sub-directories.
Collecting text data ... done
Writing data to '/path/to/Amberfiles/NPC_texts.amb' ... done

But then the second export (to a new directory) fails:

./AmbermoonTextImport -e /path/to/Amberfiles NPC_texts.amb ~/temp/nt3/

Failed to load game data: Index was outside the bounds of the array.

Demonstration that resulting file is 'scrambled':

Opening my new version of NPC_texts.amb and comparing to the original reveals that they contain large bits of the same data , but with these chunks in a different order. Perhaps the two files even have identical contents, but in a different order? They do have the same size, which is curious...

Anyway, this screenshot shows the hex values of the two files side-by-side: portions that should be near the top of the file in the original file (at right) are ~75% of the way down my new version of the file:
Screenshot from 2022-02-17 21-46-14

I've also attached the two NPC_texts.amb files (renamed so GitHub accepts the upload) in case that helps track this down. Unfortunately my C# skills are nonexistent and unlikely to improve - thanks to anyone who has any thoughts on this.
NPC_texts.amb.mine.txt
NPC_texts.amb.original.txt

@Pyrdacor
Copy link
Owner

Interesting observation. I will have a closer look. I still wonder how this can be different on Linux in Windows.

@Pyrdacor Pyrdacor self-assigned this Feb 18, 2022
@Pyrdacor Pyrdacor added the bug Something isn't working label Feb 18, 2022
@Pyrdacor Pyrdacor added the tools Issues related to the tools label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tools Issues related to the tools
Projects
None yet
Development

No branches or pull requests

2 participants