Sunday, November 15, 2020

Bytecode Adventures: Cartographers Wrath

Dear Monopolis employees,

thanks to our Super Hacker Ethanol we managed to figure out something new about the script files from both Growlanser 5 and 6 (and possibly 1).
At the very beginning of our translation project people might remember that i created a blog post which explained how the pointer table for script files is made:

https://growlanser6english.blogspot.com/2019/03/another-little-test.html

At that point in time, i only knew what the second SDF section was used for (mainly the game's script).
But, thanks to Ethanol, we now know the purpose of the first SDF section!
All those bytes that seem like they make no sense at all are something called "Bytecode".
The developers probably used some kind of proprietary scripting language to tell the game what kind of character should appear when X script line is being triggered.
And, just like the game script, the bytecode section has a pointer table on top of it.
The header (the place where the pointers start counting bytes) always starts at the first byte of the first pointer, which is always "DC 00 00 00" in a .SCEN file. 
Every pointer, just like in the second SDF, is 4 bytes long and little endian.
The 40th & 41th pointer are important, they indicate the start and the end of the bytecode that tells the game what character image, character expression and textbox should be drawn on the screen when X scriptline is triggered. Before and after that also lies more bytecode, but we didn't figure those out yet.
Heres a quick look at the pointer table:


There is a short (2 bytes) that tells the bytecode how many local actors exist in the script.
This is important, because in order to find the scriptline that the bytecode points to you need to add the local actor bytes to the code.
Heres a quick example of what i mean:
 
Inside our script we use abcde's Cartographer to dump and Atlas to reinsert the script of the game.
Each scriptline has a pointer assigned to it, which looks like this:
 
//POINTER #60 @ $10010 - STRING #60 @ $11BB6
 
Inside the bytecode the scriptline would not be 60 (0x3C), it would be 57 (0x39):
 
[SCRIPTLINE-0039+X] = Real scriptline location is +3 (both hexademical)
 
Once we go into the bytecode section we will find another pointertable, this time with 2 bytes/pointer.
The header is the same as before, starts at the very top of "DC 00 00 00".
Below the pointer table you will see that there is just a bunch of bytes, but this is the bytecode that controls the script.



Ethanol was able to figure out some of the codes that reside in there and create a program that takes the original + translated SCEN file and adds textbox names to each string.
This is super useful, because we can now automaticly add names to each string with the click of a button.
But i thought that we might be able to further utilize the bytecode to create an better script.
Since i have some experience with abcde's Cartographer already, i checked if it might supports these kinds of Bytecodes - Maybe even allow a simple "IF" function.
And after taking a look at abcde so called "multitable" files, i managed to create a simple IF logic that is usable for our bytecode:




You can group up different tables inside on big table file and assign conditions to them.
For example:
 
!42000018=<\n[42000018-Portrait Textbox ??? ]>,<@NPCID>:1,<@IMAGEID>:1,<@FACEID>:1,<@TEXTBOXID>:1,<@SCENNAMEID>:1,<@LINEID>:1
 
 <@NPCID>:1
 
  <@NPCID> = Name of the table file

1 = Amount of matches it needs to find before it moves to the next entry
 
And, after some trial and error, we are able to dump a lot of the bytecode and make it somewhat human readable!:


abcde is truly an awesome tool to work with.
We can now add things like the starting character image, character's face expressions and more to our dumped script.
This should help our translator tremendously in being able to follow the flow of the script and make an even more accurate translation.
Of course, there is still a lot of work to do here (actually combining the game script with the bytecode), but most of the unknown bytes that are important for the script have been figured out.
And, in the far future, we might be able to develope a program that is able to utilize the script + the bytecode and combine those information for an easily accessible translation tool (taking the Fate Extra CCC translation program as an example):



And for anybody interested, you are also able to break the characters and their textboxes:






Tuesday, October 27, 2020

Growlanser 1 Fan Translation is currently being worked on!

The last few weeks my team and i have been helping out HOPE_MAN on the technical aspects of a possible Growlanser 1 (PS1/PSP) fan translation.
We made quite a lot of progress and even received the work of a kind soul which already managed to implement 1 byte character, a new font and a working VWF!
So, to summarize what is possible right now:

PSP
- Dump and rebuild the game's .ISO using "UMDGen"
- Unpack some of the games archive (.DAT) files using "quickBMS" with custom file scripts
- Read the script files that have a custom encoding with WindHex32 (HEX Editor that supports custom table files)
- Extract, translate and reinsert the games script using abcde's "Atlas" and "Cartographer"


PS1
- Dump and rebuild the game's .BIN using "psximager"
- Unpack some of the games archive (.DAT) files using "quickBMS" with custom file scripts
- Read the script files that have a custom encoding with WindHex32 (Supports custom table files as a HEX Editor)
- Extract, translate and reinsert the games script using abcde's "Atlas" and "Cartographer"
- Rex, which kindly provided us with his files, was able to implement 1 Byte Characters and a working VWF in the PS1 version

All of the files and most of the documentation can be found here on the GL1 repository:
https://bitbucket.org/Risae/growlanser-1-english-translation/src/master/

If anybody is interested in how to patch the PS1 GL1 image, i made a quick guide here:
https://bitbucket.org/Risae/growlanser-1-english-translation/src/master/GL1%20PS1%20build/How%20to.txt

If anybody would like to help translate or hack Growlanser 1 come visit us at our Discord server:
https://discord.gg/59Nw2U2

Here are some notes on what we could figure out about Growlanser 1:

Both the PS1 and PSP version only support 2 byte characters and no ASCII support at all.
Compared to Growlanser 6 that means that you only have ugly full width characters, which makes it looks like this:

https://cdn.discordapp.com/attachments/761551400098070534/762591160660131870/1.PNG

Rex, who worked on a PS1 Growlanser 1 translation, managed to implement 1 byte characters and a working VWF.
This is what it looks like ingame:

https://cdn.discordapp.com/attachments/761551400098070534/768322996649197638/4.PNG

In the PS1 and PSP ELF there are textblocks which contains text like spell, weapon and character names.
In the PSP ELF, the pointer table is right below the text and it counts 2 bytes as 1.
It's almost the same in the PS1 version, but this time the pointer table is on top of the text block.

Space restrictions in the script files do not seem to be an issue, each script seems to have enough space for an english translation.
Most of the control codes have been figured out, a table file can be found here:

https://bitbucket.org/Risae/growlanser-1-english-translation/src/master/GL1/01-abcde%20scripts/UTF-8%20GL1%20Table.tbl

Rex's PS1 version also reduced most of the control codes from 2 Bytes to 1 Byte, for example FCFF=[NLINE] to FC=[NLINE].
A custom table file for Rex's version can be found here:

https://bitbucket.org/Risae/growlanser-1-english-translation/src/master/GL1/97-Rex's%20files/Rex%20UTF-8%20GL1%20Table.tbl

Rex's VWF sadly doesn't support text speed, it will display text instantly.
But here's hoping in the future that can be fixed somehow.

Friday, October 23, 2020

Game Patching, now actually user friendly-er Vol. 3

Dear Readers,
 
the last few days i took some time to try myself on automating some of the more tedious tasks of patching the game files.
And, with the combines power of Batch files and trial n error we are now able to one-click-patch patch all files in a matter of minutes!
I'm sure this is not a difficult task for other people, but since i'm pretty new to this here's how i accomplished it:




I put all of the programs (armips, quickbms, abcde and strawberry portable) and files that are needed to create translated .DAT files onto our repository.
One of the more difficult things was to create a PATH variable that automaticly takes the folder path above the script file.
But thanks to Stackoverflow and other websites there seems to be an easy way to accomplish that:

for %%i in ("%~dp0..") do set "GITHUBPATH=%%~fi"

Same goes for the automatic PATH for Strawberry Portable.

SET "PATH=%PATH%;%GITHUBPATH%\GL6 build\03-Strawberry Perl Portable\perl\site\bin"
SET "PATH=%PATH%;%GITHUBPATH%\GL6 build\03-Strawberry Perl Portable\perl\bin"
SET "PATH=%PATH%;%GITHUBPATH%\GL6 build\03-Strawberry Perl Portable\c\bin"


Having solved those issues, creating the batch was not that difficult.
The batch file pretty much just grabs the translated files, puts them into a folder together and does all the stuff that i explained in a few blog posts earlier.
For anybody who's interested, heres the batch file:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL6%20build/build.bat

I commented on everything to make it more clear on what the batch file is currently doing.

For anybody interested: If you download the repository you can build your own translated .DAT and ELF now.
The repository includes everything you need in order for the script to work.
I apologize for the big size of the repository though, the game manuals for GL1, 5 and 6 kinda take up a lot of space.

Wednesday, September 9, 2020

GL6 Translation Discord server

Since all the cool kids nowadays use Discord servers, we decided to make one too: https://discord.gg/59Nw2U2

Growlanser 5 and 6 debug rooms have been found!

Dear readers,

Ethanol Pwned, our super MIPS hacker, managed to find a way to access the debug rooms for GL5 (JPN + ENG) and 6!




Edit: Ethanol Pwned made some cheats for PCSX2, so you can automaticly jump into the debug map selection upon starting the game:
 
 https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL%205%20and%206%20debug%20and%20cheats/


Heres how you can access the debug map and menues:
 
GL5 JPN:

1. Set a breakpoint on 0x00200900
2. Select new game
3. change register a0 from 2 to 0



GL5 ENG:

1. Set a breakpoint on 0x0021CA70
2. Select new game
3. change register a0 from 2 to 0



GL6:

1. Set breakpoint at 0x00230938
2. Select "New Game"
3. The breakpoint will fire, then ctrl+g to v0-15C8 and change the 05 to a 00

Press "SELECT" to access the debug menu.
Disable the breakpoint after going to the debug map.


Thursday, August 6, 2020

Updated guide on how to patch the game using the GL6 repository files Part 5 (patching the ISO)

After doing all of this we have 3 modified game files:

- SLPM_667.16 which contains the VWF code and some translated text
- GL6_FILE.DAT which contains the translated menues, some translated text and the GL5 ENG font
- GL6_SCEN.DAT which contains the translated script

Now all that needs to be done is to build a new ISO using Xpert2:

1. Dump the ISO using Xpert2

2. switch out the original files inside the folder where the game files have been dumped

3. rebuild the ISO

And with that the game is patched:




I will occasionally upload the latest compiled version to the repository, one that is a few weeks old can be found here:

GL6_VWF_0.8.rar
https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/

Updated guide on how to patch the game using the GL6 repository files Part 4 (Adding the VWF to the ELF and translate image files)

Combining the repository scripts with the game files is not the only thing that has to be done.
Inside GL6_FILE.DAT there are the following files that need to be modified:

- the .tm2 image files
- the GL5 font file
- some files that contain text

A full list of the files can be found here:

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

On the repository the translated .tm2 GL6_FILE.DAT are can be downloaded here:

GL6_FILE.DAT.rar
https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/

1. Extract all of the files and put them in 1 folder like this:



2. use the script "quickbms reimport2 - FILE.bat" from the repository to quickly insert the modified files into the original GL6_FILE.DAT. The paths have to be modified again:


Now the VWF code needs to be added to the ELF.
The latest translated, non-VWF ELF can be downloaded here:

XX.XX.XXXX_NO_VWF_SLPM_667.16
https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/

We are using "armips" to quickly add the VWF code to the ELF file.
armips can be downloaded here:

https://github.com/Kingcom/armips/releases

1. Download all of the .asm files from the repository and put them into the folder where you extracted armips:

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

2. put the ELF file into the folder and rename it to "SLPM_667.16". It should look like this:


3. create a .BAT file and put the following code into it:

armips.exe GL6.asm

pause


The batch file will now automaticly add the current VWF code to the ELF. With this, the font has been patched to the GL6_FILE.DAT and the VWF code has been patched to the ELF file.

Tuesday, August 4, 2020

Updated guide on how to patch the game using the GL6 repository files Part 3 (Patching the games script files)

Combining the repository files with the original game files:

1.1 abcde uses Perl, so i recommend using Strawberry Perl (for Windows) in order for abcde to work:

http://strawberryperl.com/releases.html


1.2 Add following paths to the PATH windows settings (replace <PATH> with the path to those files on your harddrive):

<PATH>\Strawberry Perl Portable\perl\site\bin
<PATH>\Strawberry Perl Portable\perl\bin
<PATH>\Strawberry Perl Portable\c\bin

https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/


1.3 Download abcde and extract it:

https://www.romhacking.net/utilities/1392/


1.4 Copy all the abcde .BAT files (and also abcde.tbl) from the repository to the abcde folder:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL%205%20and%206%20abcde%20scripts/


1.5 Now create a new folder somewhere where you will merge the repositor script with the games .SCEN/SCEC/STXT files.
I'm personally using it like this:



Inside the folder are the contents of the dumped GL6_SCEN.DAT file.


1.6 inside the abcde folder is a file called "abcde Atlas bulk import.bat".
Open it up and replace "PATH1" with the path of the original .SCEN files.
Replace "PATH2" with the path to the repository files.



1.7 Execute "abcde Atlas bulk import.bat" and it should automaticly insert all the repository files into the game files.


2.1 Download the latest version of quickBMS

https://aluigi.altervista.org/quickbms.htm


2.2 Copy all the files of the quickBMS repository folder into the quickBMS folder:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL%205%20and%206%20quickBMS%20scripts/


2.3 Now the modified .SCEN/.SCEC/.STXT files need to be imported into the original .DAT file, "quickbms reimport2 - SCEN.bat" can be used to do that, but just as with the abcde scripts the path needs to be updated in order to work:



Updated guide on how to patch the game using the GL6 repository files Part 2 (Dumping the ISO)

I actually took a look at the Growlanser 1 PS1 and PSP game contents, to see what kind of issue other people might have had to translate the game and i came across the problem of file compression. As far as i can tell, both the PS1 and PSP version use some kind of compression algorithm to reduce the filesize of the games ISO.
Because the games (Growlanser 5 and 6) .DAT files do not use any kind of compression we were able to dump the scripts of the game rather easily.

Heres a quick overview on how to compile all of the repository scripts into the game files.

1. Dump the ISO using "Xpert2"
2. extract the contents of the .DAT files with "quickBMS" using the Growlanser script
3. use "abcde" to re-insert the modified script files into the games .SCEN/.SCEC/.STXT files
4. use "quickBMS" to reinsert the modified files into the games .DAT files
5. use "Xpert2" to create a new ISO with the modified files

After dumping the ISO using Xpert2 or some other program you will have the following (on both Growlanser 5 and 6):

SLPM_667.16 is the ELF of the game
SYSTEM.CNF some game config file
DUMMY.DAT dummy file containing dummy data
GL6_BTL.DAT no clue about that one
GL6_CHAR.DAT seems to store the character model files
GL6_FACE.DAT probably contains all of the games face image files
GL6_FILE.DAT contains all of the image files (for example, the games character menu) and some other stuff
GL6_MAP.DAT Seems to contain the map data, also has a file that has all of the different map information stored in it
GL6_MOV.DAT contains alls of the movies without sound
GL6_SCEN.DAT contains all of the games script files
GL6_SND.DAT contains the sound files
GL6_VOI.DAT contains all of the voice data


1. First you have to download Xpert2 and use it to dump the ISO file (a little bit out of date guide but its still pretty much the same):

https://growlanser6english.blogspot.com/2019/03/growlanser-6-unpack-iso.html


2 Download quickBMS and extract the it in a folder, put the Growlanser quickBMS script into the same folder.
The quickBMS Growlanser 5/6 script can be found here:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL%205%20and%206%20quickBMS%20scripts/


3. Use quickBMS to dump the contents of "GL6_SCEN.DAT":

https://growlanser6english.blogspot.com/2019/03/growlanser-6-unpack-iso.html

All of the contents of SCEN.DAT will be extracted from the .DAT file.
Now you can pretty much do the following

- We have the repository folder that contains the abcde script files (/GL6_SCEN.DAT/)
- We have a folder that contain the extracted GL6_SCEN.DAT (game) files
- We have the original GL6_SCEN.DAT file

We use abcde to import the repository script files into the original .SCEN files.
And after that we use quickbms to import the modified .SCEN files to the original .DAT files.
(And after that you just have to use armips to import the variable width code into the ELF file)

Repository script (abcde) > original .SCEN/SCEC/STXT (quickBMS) > original GL6_SCEN.DAT (Xpert 2) > dump the iso and switch out the files, rebuild the ISO

Updated guide on how to patch the game using the GL6 repository files Part 1 (Overview)

Over the last year the way we compile our repository scripts changed a little bit, so heres an updated How-To guide on how to compile the repository scripts into the games .DAT files.
But first, a quick overview on the different tools we use for our project:


- PCSX2
https://pcsx2.net/
I personally use the PS2 emulator to test the game


- PCSX2 debugger
a useful debugger for checking the MIPS code that is being processed in the background while the game is running.


- PCSX2dis (ps2dis)
https://forums.pcsx2.net/Thread-PCSX2dis-v1-1-A-ps2dis-inspired-PCSX2-enabled-Game-Hacking-Tool-W-I-P-13-02-2015
Another useful tool:
"PCSX2dis is an ambitious new hacking tool based on old hackers' favourite ps2dis. Created for advanced hackers and beginner/intermediate hackers who wish to learn ASM hacking, this is an all-purpose tool fixed to a modded version of PCSX2, designed to make PS2 game hacking easier than ever, all in realtime!"
Afaik, only works with PCSX2 1.2.1.


- bitbucket
https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/
We are using the repository tool "Bitbucket" to share and store our project.
It contains all the games script files and also files for various software that we are using.
We are using GitHub Desktop to sync our repository files to our local hard drive:

https://medium.com/@rvrajavijay/how-to-use-bitbucket-repository-in-the-github-desktop-fae2ef61135d

With this you can download the repository to your local computer and work on the files in there.
Any changes you make you can "commit" to the repository for all of the team to access.
The changes will be documented and everybody can see what changed.
A lot easier than working on the scripts files inside the bitbucket web view.


- abcde (Cartographer and Atlas)
https://www.romhacking.net/utilities/1392/
abcde is a tool to dump (Cartographer) and re-import (Atlas) the Growlanser 6 script file text.
I already dumped all of the script files that exist in Growlanser 6, so currently we only use its Atlas function to reinsert it into the games files.
The control codes for abcde are stored inside "/GL 5 and 6 abcde scripts/abcde.tbl" and so far i think i have all of the ones that are used inside the table file.


- quickBMS
https://aluigi.altervista.org/quickbms.htm
quickBMS is a tool to dump and reinsert game specific files.
For example, Growlanser 6 uses ".DAT" archives that stores the game files.
We are using quickBMS to dump all of the files that are inside the .DATs using a custom script which is saved in "/GL 5 and 6 quickBMS scripts/growlanser.bms"


- Xpert 2
http://xpert2.blogspot.com/
Xpert 2 is a tool to dump the contents of the games ISO and rebuild it.
Since the filesizes of the modified .DAT files are going to be bigger than the original, Xpert lets us create a new ISO with the bigger files.


- Apache2.0
https://www.psx-place.com/resources/apache.697/
Apache was another ISO tool to dump and hotswap files inside the games ISO.
Because of the fact that most of the game files are going to be bigger in size we sadly can't use it anymore.


- deltapatcher
Deltapatcher is a useful tools to create patched for the ISO, but this only works if the modified ISO is not bigger in size than the original.
Because of the new quickBMS script we don't have any script size limitation anymore, but this also means that we can't use deltapatcher because the filesize of the original ISO will increase.


- rainbow
https://github.com/marco-calautti/Rainbow
Rainbow is a tool to view the TIM2 (.tm2) image files


- Ghidra with the Emotion Engine processor
https://github.com/NationalSecurityAgency/ghidra
https://github.com/beardypig/ghidra-emotionengine
Ghidra lets us decompile the "ELF" file (SLPM_667.16).
The ELF file contains various text that only can be translated in there, but its almost all been translated.


- armips
https://github.com/Kingcom/armips
We are using armips to quickly modify the ELF file, mainly for the Variable Width Font code.


- TileShop
https://www.romhacking.net/forum/index.php?topic=30404.0
A tool to view the Growlanser 5/6 font files.
Uses XML files to tell the program how the font file is build up.


- wxMEdit
https://wxmedit.github.io/
A bit outdated Hex editor which supports Shift-JIS.

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/

Tuesday, April 7, 2020

Tile Shopping, now with 200% more pixels!

A few days ago i saw that a new Tile Editor is currently in developement, named "Tile Shop":

https://www.romhacking.net/forum/index.php?topic=30404.0

I was able to see my broken font files using some different settings:

The developer asked in his thread for files that are unusual, and so i asked him if he wants to take a look at the font files of Growlanser.
He said sure, and so i send him the files and lo and behold, this madman actually managed to display our beautiful font in the Tile Editor!:





Look at it and be in awe of the beautiful GL5 font!
Here is what he wrote me while checking out the font files:


Hi Risae,

So I've looked at the GL5 files (GL6 looks the same) and the verdict is: "No, but kind of" regarding what I think is accurate viewing. I'm not sure how I would test accurate editing.

Here's the result so far: https://i.imgur.com/VTrS8OJ.png

I'll go through the steps necessary to get to the result for "GL5 ENG 0000002e.fnt".

The offset at 0x8 of each font file contains the location of the palette (0x220). Scroll here and see that the palette is split between two sections. TileShop cannot support scattered palettes at the moment, so I copy/pasted the second half directly after the first half. The color format is RGBA32 and not BGR15 as I would have assumed. I also changed the alpha channel values from 0x80 to 0xFF. 0x80 is probably a game/format-specific transparency value that maps onto an alpha blend mode that is not 50% transparent.

I mostly setup the included project through hand-editing the XML project files. Copy/pasting from single layout images is currently far from ideal and I've found some bugs in the process.

If you try the project, make sure the project file (and included modified font) is in the root of the TileShop folder. I introduced a bug with directory-dependency of the schema validation in the current version.

 He is using an XML file to tell the program how to properly display the font files, but after a first attempt at doing it myself i couldn't really get anything to show, so he helped me out once more:


Hi Risae,

For the GL6 font provided, please know that getting the width correct is critically important. You cannot reuse the same width (and height) from other files. Luckily, the FNT file contains the width, height, palette offset, image data offset, etc as follows:

0x8 - Palette offset (probably 4-byte)
0xC - Image offset (probably 4-byte)
0x1A - Image width (2-bytes)
0x1C - Image height (2-bytes)

I have included a revision to the GL6 project which includes one arranger at an incorrect height (768) and the other at a correct height (192). Without header information, you would need to open the font file directly in TileShop, change codecs, adjust width/height/file offset until you figure out the correct settings.

For editing via TileShop:
Importing is currently not supported, but will be supported soon. Importing has worked for quite some time in ImageMagitekConsole, but I would like to have a nicer solution for merging multi-palette images before rolling it into TileShop. I may not hold back for that though.

There is a save button in the pixel editor's toolbar that saves changes directly to the file.

I would suggest holding your editing for now, at least if you plan on using TileShop. I have an undo/redo feature for the pixel editor locally, but probably won't release a new version for another 2-3 days. You may also want to wait for importing as hand-editing a font with transparency aliasing using a very basic pixel editor is not a fun task.

- Klarth


I really should have known better... looking at his information it now all makes sense.
Thanks to him we have a really good understanding of how the font files are build up.

Since the program supports exporting but not importing of files we can't really change the GL6 font right now.
If i can somehow find the variable width font code in GL5 we might be able to just copy and paste the GL5 font into GL6 and it will magically work without doing any tile editing.
I will create another thread on the Romhacking forum about finding "Text Routines" in the games assembly code.
Lately the Romhacking Forum has been such a great help in figuring out how this game and its files work, really cool community.

But now i know why in 2019 i could just copy and paste the GL5 font into GL6 without any artifacts or broken letters (aside from the width issue).
GL5 and 6 really are a carbon copy of each other. Makes things a lot easier!

Here are the GL 5 and 6 fonts in all its high resolution glory:

GL5 ENG 0000002a.fnt

GL5 ENG 0000002e.fnt




GL6 JPN 0000002a.fnt



GL6 JPN 0000002e.fnt


Those are not all the .fnt files, but we mainly have to focus on 2e.fnt, because that is the one that affects the font ingame.