Saturday, May 30, 2020

No more size limits with our script files!

The last few weeks i have been working a lot on inserting the Growlanser 6 Realm script into the games script files.
Sadly the script only has the english translation without the japanese original, so i have been playing through the game side by side translating the strings.
It's a bit tedious, but i have been making a lot of progress and i am about half-way through the script.
But, after working on a lot of different script files i always came across the issue that our script is a lot bigger than the original.

The translated script gets put back into the games .FLK file using the tool called "abcde".
Whenever the filesize, because of the re-import, got bigger than the original, i wasn't able to use quickBMS to re-insert the .FLK file into the games GL6_SCEN.DAT file.
I had to manually "trim" the script files and delete various things, for example the debug text or squish some dublicate text into one text pointer.
Doing that takes a lot of time, so i have been looking for ways to be able to expand the script files without having any space issues.
And lo and behold, quickBMS actually implemented such a feature last year!:


From version 0.10.0 QuickBMS has an additional mode called REIMPORT3,
it's identical to REIMPORT2 with the only difference that the archive
is shrinked or enlarged if there is no offset field used in the archive
and the size of the input file differs than the original.
This method "may" be useful with some language files and some archives
with sequential data.
 
I immediatly gave it a try and put all of the original GL6_SCEN.DAT files into one folder, inserted all of the scripts into the original .FLK files using abcde and reimported it with quickbms reimport3.
All of the files are properly imported and are in the right place, just the GL6_SCEN.DAT file is a little bit bigger now!
Doing a little test ingame also didn't show any problems with the translated text. Everything seems to be in the right place.

With that, we now can:


- Download the repository files
- insert the script files into the .FLK files using abcde bulk import
- reimport all the modified + unmodified GL6_SCEN.DAT files into the .DAT
- Dump the ISO with Xpert and switch out the files, rebuild it with Xpert
In a matter of minutes! No more tedious trimming of the script files because of size issues!
Sadly, we are not able to use the cool tool called "Apache2" anymore, since the original size of  GL6_SCEN.DAT increased as a result. Which also means right now we cannot create an xDelta patch.
But not having a size limit in the script files is a really big help in being able to create a proper translation.


Update:
Meh, all the files that are not increasing in size work without a problem, but the ones that do pretty much break the game:


Update 2:

So, after consulting with the super hacker Ethanol Pwned he found out that

I figured it out! After blankly staring at hex for too long I figured this thing out.
Remember all those silly spaces at the end of every file? They are CRITICAL, all of them pad out the files for them to snuggly fit inside an LBA (0x800 chunks that divide the game disc logically) the game will simply refuse to read in-between LBA's for speed (and because they have ~4GB to work with anyways :P) as such, if the file doesn't start at a disc location where 0xLocation % 0x800 == 0 the game will just discard the part that isn't and will do direct copy starting from a location that is multiple of 0x800.

THAT'S why it breaks when the changes are big enough, but leaves a little wiggle room where if small enough it can work by pure luck, and that's also why the defined .DAT size isn't really honoured.

Every .DAT file is like this and that explains why the .flk's inside were multiples of 2, now I haven't tested this yet, but a comparison of two instances of the game running confirms this suspicion (and also confirms that the game can handle relocating bigger files, assuming enough memory is available) so we only need to automate this.

And lastly some funny observation, I actually pointed at something like this in a previous email, past me basically had it resolved xd

And it seems like another scripting God on the quickBMS forums was able to create a quickBMS script that does exacly that and the game so far runs perfectly:

https://zenhax.com/viewtopic.php?f=13&t=13696

So, heres hoping i'm not coming across any more crashes, and if that is the case we finally have a way to increase the script size without a worry in the world!

Thursday, May 21, 2020

This is what happens when the game doesn't like you.

It trolls you into writing and deleting random letters...


Thursday, May 7, 2020

Equipment Window now properly translated and GL5 VWF table found!

Dear readers,

i already made a post in the Romhacking thread (https://www.romhacking.net/forum/index.php?topic=30284.0), but i also want to make a new post here since its been  some time.

Thanks to the big help of "Ethanol Pwned" we are now able to modify the Y position of various text windows!
He made a really cool tutorial on how the text window is build up:

https://gist.github.com/Mc-muffin/5d121fa01d3be9199e6f66f853b6ff4b

Thanks to that, i was able to make sense of the Assembly code and change the values for those windows:

Before and after:




There are a few more windows that need to be worked on, for example the selling window:



and the spell casting message:



Those seem to have slight variantions in regards to their Y position code, but i believe i can figure out how the code is build up and change those too.

And, the even bigger news is that Ethanol Pwned took a closer look at the Text Routine of Growlanser 5 and managed to find the VWF table!
He too believes that the english publishers made a VWF for the game and because both Growlanser 5 and 6 are 90% identical in terms of game code and its engine, it should be possible to port it over to Growlanser 6.

The location of the VWF Table is 0x314C68 inside the GL5s ELF:



I stumbled upon this spot in the past already, but i didn't believe that it would have anything to do with the text.
The width values are 1 byte each, and to get to the letter that you want to modify you just have to add the hex value of the letter to 0x314C68.
As a little test i ported the GL6 font back into GL5 and changed all the values to see what happens:







Porting the GL5 font over to GL6 is now one step closer.
Big, big thanks to Ethanol Pwned for taking the time to help with this and being able to figure out so much in such a short time!

We are still looking for Japanese > English translators. If you would like to help us translate Growlanser 6 to english, please let us know!
You can check out our current progress on our repository:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/