Quantcast

Page 1 of 4 1234 LastLast
Results 1 to 15 of 46

Thread: Translating Saturn Grandia

  1. #1
    Hero of Algol TrekkiesUnite118's Avatar
    Join Date
    May 2010
    Age
    30
    Posts
    8,011
    Rep Power
    115

    Default Translating Saturn Grandia

    This is a repost from what I posted on SegaXtreme. But over the weekend I thought I'd snoop around in Grandia's files and do some comparing and contrasting with the US and JP PS1 releases to see how different they are. The thought process was to see if it would be possible to extract the English script out of the PS1 version, and possibly use that as a base to translate the Saturn version. So far this is what I found:

    • The File Structure between the two games is actually rather similar, unlike that of Lunar Silver Star Story.
    • That said there are still some differences. Some files don't exist on the Saturn version and some don't exist on the PS1 version. However this seems to be more aimed at bin files and system specific formatted stuff like audio files, video files, fonts, etc.
    • I believe I've found the script for the English version. In both versions there's a Field directory. In this directory there are numerous files with hex values for their file names. In the Saturn data these are .MDT files, in the PS1 version these are .MDP files. I'm pretty sure these contain the games script.
    • The English PS1 script is completely uncompressed in the .MDP files. You can bring them up in a Hex Editor and read the ASCII encoded script.
    • The font for the Saturn version is in the FDATA.BIN directory as mentioned before by CyberWarriorX on SegaXtreme, and his compression and decompression tools that he wrote appear to work just fine. If you run them on FDATA.BIN you can get the 4BPP font and can load it up in a tile editor of your choice.
    • The FONT does have an all Caps English font in it, but from the looks of things I'd bet this one isn't a variable width font.
    • I've not been able to really find where the menu text lives. In the PS1 version I've found a couple pieces here and there. For example in the Battle directory there's some pieces in it's DAT files, but these files appear to be one of the few areas where the Saturn and PS1 versions are structured differently. Basically some files the PS1 has don't exist on the Saturn and vice versa.


    The Saturn version also recently had a Korean Translation released. So I took al peak at the Korean translated version and this is what I've found:

    • File sizes appear to be identical to the Japanese version.
    • The font has definitely been changed as I'd expect it to be.
    • The MDT files have been modified, which would seem to confirm that those contain the script.
    • ITGET.BIN has been modified. Looks like they changed character names from Japanese to somewhat English versions. Which looking at the changes and gameplay footage, I'm guessing this is where the menu text lives. This is probably the equivalent of the ITEM.BIN file in the PS1 version.
    • CMDMN.BIN has been changed. Again this looks like either Menu text, guessing command related based on what's in it and the name.
    • CNFIG.BIN has also been changed. This again looks to be like menu text, guessing Config menu based on the name.
    • SHOP.BIN has been changed. This is most likely Shop Menu text by the looks of things.
    • SVLD.BIN has been changed. Again looks to be Menu text, I'm guessing this is for the Save/Load screen based on whats in it and the name.
    • All the AMAP#.ADD files have been modified. My guess is this is text in the map screens or dungeons?
    • WDATA.DAT has been altered, my guess is this is Weapons info maybe?
    • SWN6M.DAT has been altered, no idea what this one is.


    I then dug into the English PS1 version a bit more. I was able to get the PS1 English font. After looking at it I'm starting to wonder if the English version actually supports VWF. Reason being the English font is 8x16 in size, but every letter is scaled to that size and is perfectly centered. And when watching it in action you can actually see some spots where the spacing looks a bit odd, specifically around thin letters like Lower case L's and I's:



    And here are the fonts for each version of interest.

    Original Japanese Saturn:


    Hacked Korean Saturn Font:


    English PS1 Font:


    There were some 8x16 Japanese characters in the English PS1 font as well, but I didn't see a reason to include them.

    More findings continued in the next post...
    Last edited by TrekkiesUnite118; 09-10-2018 at 01:01 AM.

  2. #2
    Hero of Algol TrekkiesUnite118's Avatar
    Join Date
    May 2010
    Age
    30
    Posts
    8,011
    Rep Power
    115

    Default

    In comparing the script files between the Korean version and the Japanese version I think I've figured out some of the encoding. I still need to figure out the control codes for the text boxes, but the text itself is actually pretty simple. Basically the hex values for the text correspond to the sequence number of the font character in the font table. However the values are the decimal value of the font sequence number + 31, and then turned into Hex.

    So for example looking at the font charts above, the character A is 11th in the font table. If you want to have A displayed, you need to put the value 2A in the MDT file. This is because 11 + 31 = 42, and 42 in Hex is 2A.

    I was able to test this theory by replacing the text in the intro scene so in the first two text boxes Baal should now say:

    ??
    WOOT
    And low and behold:





    As I said, I still need to figure out the control codes, but if someone wants to take a look at it, the file for this area is BA38.MDT in the FIELD directory. The offset for this cutscene and where I started making changes is x5AA.

    Now the odd thing here is there's over 1000 characters in the font if I'm counting correctly. But this encoding can at most go up to 255 if I'm understanding it correctly. So I'm not sure how it's dealing with characters beyond that limit. However for an English hack we might not even need to care about that as we wouldn't need over 1000 characters to begin with.

    So honestly, once the control codes are figured out I think this might actually be a pretty straight forward hack. The biggest issue to do first would be to change the game to operate on an 8x16 font instead of a 16x16 font so the English PS1 font can be used. After that it would just be injecting the new font and then editing the script files.

    This is probably what they did for the Korean translation, but without the font size change, as Korean is still a Fixed Width Font so they could stick with the 16x16 font size easily.

    So this is what I've found over the weekend. I figured I'd post it here as well since we seem to get more traffic than SegaXtreme gets these days.

  3. #3
    Road Rasher
    Join Date
    Jun 2011
    Posts
    472
    Rep Power
    14

    Default

    Great news! Would love to finally play the Saturn version of Grandia. Good luck with the project.

  4. #4
    WCPO Agent
    Join Date
    Sep 2012
    Posts
    797
    Rep Power
    23

    Default

    That PS1 font looks like the Saturn BIOS font.

  5. #5
    Raging in the Streets Team Andromeda's Avatar
    Join Date
    Jul 2010
    Posts
    4,177
    Rep Power
    46

    Default

    Keep up the good work, Would love to play the Saturn Grandia in English, The PS version is an insult. Love to play the Saturn lunars in English too. I'll happy contribute funding to the project too if needed
    Panzer Dragoon Zwei is
    one of the best 3D shooting games available
    Presented for your pleasure

  6. #6
    The Gentleman Thief Baloo's Avatar
    Join Date
    Mar 2009
    Posts
    5,413
    Rep Power
    81

    Default

    Nice research! I've heard good things about the Saturn port of Grandia.
    Quote Originally Posted by j_factor View Post
    The Sega Saturn was God's gift to humanity. This is inarguable fact!
    Quote Originally Posted by llj View Post
    Count me as someone who never liked the Turbo/Hyper Fighting iterations of Street Fighter 2. The speed ups always struck me as too "Benny Hill".


    Feedback Thread: http://www.sega-16.com/forum/showthr...ack&highlight=

  7. #7
    Hero of Algol TrekkiesUnite118's Avatar
    Join Date
    May 2010
    Age
    30
    Posts
    8,011
    Rep Power
    115

    Default

    So doing some more digging I've found a couple more nuggets of info:

    • The Japanese PS1 and Japanese Saturn version use the same encoding for their text.
    • The English PS1, Japanese PS1, and Saturn versions seem to use the same control codes with some catches
    • The PS1 versions seem to add additional values in the codes between text lines/new boxes.
    • Some codes are also used differently.


    So with the control codes, I've figured this out looking at the file BA38.MDP/BA38.MDT in the different versions. This is the file that contains the intro scene I edited earlier among other things. When the scene starts, we can see this code before the text across all 4 versions:

    Code:
    0901 090B 8020 0F03 0A0C 0030
    It would seem that this indicates the following:
    • Start a new text box for a new character.
    • Text Box is on Top
    • Character Portrait is on the Left
    • The character is Baal.
    • Face palming.

    When he speaks again however, we now see this:

    Code:
    0901 0F03 0A0C 0030
    This seems to indicate the following:
    • Start a new text box,
    • Same Position
    • Same Portrait Position
    • Character is Baal.
    • Face Palming.

    The next big code we see is this:

    Code:
    0901 0F03 0A0C 002E
    This seems to indicate the following:
    • Start a new text box
    • Same Position
    • Same Portrait Position
    • Character is Baal.
    • Relaxed face.

    Next in this scene the character Mullen is the one speaking so we now see this:

    Code:
    0901 090B 8021 0F21 0A0C 0022
    This seems to indicate the following:
    • Start a new text box for a new character.
    • Text Box is on the Bottom
    • Character Portrait is on the Right
    • The character is Mullen.
    • Serious? Face.

    Next, Baal speaks again, only now with this code and it's slightly different in the English PS1 version. In the Japanese and Korean versions it's:

    Code:
    0108 0F03 0A0C 002F
    In the English version it's this:

    Code:
    DC08 0F03 0A0C 002F
    This would seem to reflect the following:
    • Use the previous text box settings (Position, Portrait Position, etc.).
    • Character is Baal again.
    • Mild Chuckle Face?

    Next Mullen speaks again and we see a code that differs between the English version and the other versions.

    In the Japanese and Korean versions it's:

    Code:
    0108 0F21 0A0C 0021
    In the English version it's this:

    Code:
    AA08 0F21 0A0C 0021
    This seems to reflect the following:
    • Use the previous text box settings (Position, Portrait Position, etc.).
    • Character is Mullen again.
    • Relaxed face.

    So this would seem that the value 0108 does mean use the previous text box settings.
    Next we see this code come up quickly:

    Code:
    01 0F21 0A0C 0026
    This seems to indicate that in the same text box mid sentence we need to change the face portrait to a different one. This is used in the cutscene to change Mullen's expression. It would seem that the value 01 is an interrupt to tell the game to change portraits.

    Now I can keep going but I think the patterns should start to become obvious. I've also noticed the following values coming up to signify the end of a line in the text box or the end of a textbox:

    Code:
    0E00
    
    090F
    The problem however is I can't seem to find consistency for which is used where. The PS1 sometimes uses 0E00 where the Saturn version uses 090F, but then there's instances where both are using the same values.

    After the end code however, there seems to be varying bytes of data. The size of bytes seems to be the same in the Japanese and Korean Saturn versions, and in many cases the same values. However when we compare to the Japanese PS1 version, the size of bytes between these gaps is different. There's additional data added in. However there is still some data that matches, however bytes are flipped which is consistent with endian differences. This would seem to indicate these are perhaps pointers? I have no idea what the additional data that's added into the PS1 version is though.

    Obviously more research is needed here as well as some experimentation, but this seems to be consistent when stepping through the script file in sync with the cutscenes so far.

  8. #8
    HNNNNNNNNNNNNNNNNNNNNNNNG Raging in the Streets Moirai's Avatar
    Join Date
    Jun 2011
    Posts
    3,916
    Rep Power
    51

    Default

    Id definitely like to try this in english, especially since i dont even own a PlayStation

    Porting the english from the PlayStation Version directly to the saturn is an awesome idea, so we can play it as the developers intended!

  9. #9
    Hero of Algol TrekkiesUnite118's Avatar
    Join Date
    May 2010
    Age
    30
    Posts
    8,011
    Rep Power
    115

    Default

    So I decided to play around with the font tonight. I did a simple test where I took the English PS1 font and stretched it to now be 16x16 in size. I then copy pasted it into the Japanese Font file in ASCII order. This way in theory the script files could be edited into English with ASCII encoding to make things easy. And other than a few letters being off, it proved to be successful:





    I'm attributing the few incorrect characters here to two things:
    1) I was probably off in my count for the ... character.
    2) I probably missed a control code that I haven't figured out yet that controls Kanji characters.

    Obviously I didn't edit much beyond this point but the game still prints the font out ok. It's just now everything is truly gibberish as expected:

  10. #10
    Road Rasher
    Join Date
    Apr 2011
    Posts
    310
    Rep Power
    11

    Default

    That's great progress. Can't wait to finally play the original version of this game

  11. #11
    Hero of Algol TrekkiesUnite118's Avatar
    Join Date
    May 2010
    Age
    30
    Posts
    8,011
    Rep Power
    115

    Default

    So I've started putting together a font table for the game as I'm figuring out the encoding more. I have it done for the English portions of the Font, the Hiragana, and the Katakana as well as the special characters. I think I have an idea of how the Kanji encoding works, but it's going to be some trial and error to get it right. I figure if I can get this made it should make it at the very least easier to identify the Japanese text in a hex editor, as well as possibly make it easier to dump the script. It could also make it easier to spot the control codes.

    I've also been thinking about the issue of getting the font size changed from 16x16 to 8x16. CyberWarriorX has some good notes in this old thread about how the font and it's compression system works:

    https://segaxtreme.net/threads/satur...ng-notes.4934/

    Basically I think this is going to require some ASM hacking of the text decompression routine and possibly the text drawing routine. The Decompression routine works by decoding the first 8x16 portion of the character, followed by the next 8x16 portion. I'd imagine this would need to be changed so only the first half is decoded and treated as one character. I'd also imagine that this would impact the pointer table of the FDATA.BIN file. Finally depending on if the game is spacing the text based on font width or if it's spacing it in 16x16 increments regardless of it's size, would determine if the text drawing routine would need to be modified.

    This is something that is way above my skill level so I'm probably going to need some help on this one. I was planning on reaching out to CyberWarriorX and seeing if he had any thoughts on it or if he wanted to jump in and help. If anyone here wants to give it a shot feel free to jump in. I was also thinking about reaching out for help on ROMHacking.net.

    I have however had some success figuring out a bit more about the control codes.

    The code 090F that I before thought was end of text I believe is actually 1 code plus the start of another. The first code is 09. This seems to indicate a pause in text drawing. It seems to be used to pause the text to keep it in sync with pauses in the voices. The next code is actually 0FXX. The XX I've seen be any value from 01 up to 0A so far. This seems to be used for various different things. What I've found so far though is the following:

    0F03 seems to be related to controlling the Left Portrait.
    0F21 seems to be related to controlling the Right Portrait.

    The next code I was able to figure out is this one:

    Code:
    0A 0C 00 XX
    This code tells the game to switch to a different portrait, where XX is the value for the portrait you want displayed.

    So for example if you see the following:

    Code:
    0F 03 0A 0C 00 XX
    It would appear to mean "change the left portrait to portrait XX".

    I was able to confirm this in testing by changing the portraits in the intro cutscene to arbitrary values:







    There's still quite a few different values for 0F XX however, and I haven't quite been able to nail down what they all do yet.

  12. #12
    WCPO Agent
    Join Date
    Sep 2012
    Posts
    797
    Rep Power
    23

    Default

    See if you can get the game running on yabause, with savestates and its memory editor you could test those values rather quickly. It's what I did when working on Madou Monogatari and SOTN.

  13. #13
    Hero of Algol TrekkiesUnite118's Avatar
    Join Date
    May 2010
    Age
    30
    Posts
    8,011
    Rep Power
    115

    Default

    So after making a topic on RomHacking.net it was revealed that the 8x16 English font is actually in the Saturn version, and it's in ASCII format. To use it you just need to start your text line with the code 03 and then you can write ASCII encoded text. I tested this and got these results:





    So basically this makes things a lot easier I'd imagine. Now it's just figure out the control codes, any pointers in the files for text size and location. With that information it probably wouldn't be too difficult to write a tool to dump the JP script, and then another to inject an English script with pointer values adjusted for expanded text.

    Though it would still probably be beneficial to make some kind of hack to make the 8x16 font the default font so you don't have to waste a byte with the 03 control code. I'm guessing this is what the English PS1 version did as I'm not seeing any evidence of a control code like that being used in it's files.

    Quote Originally Posted by zyrobs View Post
    See if you can get the game running on yabause, with savestates and its memory editor you could test those values rather quickly. It's what I did when working on Madou Monogatari and SOTN.
    I'll probably give that a try at some point, though I've never had good luck with Yabause. On top of that I really would have no idea what I'm doing with the debugger anyways.

  14. #14
    WCPO Agent
    Join Date
    Sep 2012
    Posts
    797
    Rep Power
    23

    Default

    Yeah, at that point you just have to copy over the script from the PSX version, convert the control codes, and hope you don't run out of the file bounds.

    Man, if I knew it was this easy, I would've converted it myself ages ago. I looked into doing SOTN and Madou Monogatari before and both got significant roadblocks, but this looks like a copy paste job.
    Last edited by zyrobs; 09-15-2018 at 11:11 PM.

  15. #15
    Hero of Algol TrekkiesUnite118's Avatar
    Join Date
    May 2010
    Age
    30
    Posts
    8,011
    Rep Power
    115

    Default

    Quote Originally Posted by zyrobs View Post
    Yeah, at that point you just have to copy over the script from the PSX version, convert the control codes, and hope you don't run out of the file bounds.

    Man, if I knew it was this easy, I would've converted it myself ages ago. I looked into doing SOTN and Madou Monogatari before and both got significant roadblocks, but this looks like a copy paste job.
    Yeah, kind of funny how those things turn out. It seems in this case a bunch of different people had a piece of the puzzle, but no one ever put them all together.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •