+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Reversing Grandia II Compression
Pages: [1]
Author Topic: Reversing Grandia II Compression  (Read 2 times)
Xzyx987X
Guest
« on: November 11, 2008, 02:26:07 am »

I have wanted to do an undub of Grandia II for a very long time now. In fact, that game is single handedly responsible for my hatred of english dubbed RPGs, and I would like nothing better than to create a world where no one ever had to play through the dubbed version of that game again. Unfortunately Grandia II is not an "easy" undub like so many others. Although you can replace the audio and movie files in the english version with the japanese files without breaking anything, the script needs to be re-timed in order to get the skits to sync up to the voice acting. Otherwise the voices either won't have enough time to play and will get skipped, or will have too much time to play and will cause the next voice to start playing while the text from the last voice is still displayed.

This is in and of itself, not an insurmountable problem, as script hacking is pretty trivial. But in order to be able to even get at the script to hack it, you have to get past Grandia II's compression scheme, and this is where I ran into a bit of trouble. In Grandia II the script is actually contained in the map files, along with all the other data for the map layout. All the map data is compressed, and packed into AFS files (for reasons I cannot begin to fathom, as AFS files are supposed to be used to store ADX compressed audio streams). Using tools obtained from the usual places, I was at least able to get the map data out of the AFS containers, but I am left with the problem of how to decompress it.

Originally my plan was to use IDA to reverse to PC version of the game, since it's map files are identical to the Dreamcast's version, and the PC is a much easier target platform for debugging. Unfortunately since I switched to Vista before I stated looking at this project, I have no had any luck getting the PC version of Grandia II to run on my computer, and so this project has been sitting on the back-burner for a year. And so I was thinking recently, that maybe I should just throw a request for help out there and see if anyone bites. I'm sure that there are people here who could get the compression reversed in days, whereas it could take me weeks even under ideal circumstances. I think the compression should be relatively simple, because it's designed to work in real time as the data stream is read from the disk, and there are tons of obvious plain text blocks visible. Although technically I only need to know how to change the files without screwing them up, it would be prohibitive to do this project without being able to decode the text completely due to the mountains of compressed text I would have to sift through to find the specific text I needed to fix a given scene.

Here is a sample of a compressed map file with script in it: http://www.megaupload.com/?d=UK00GOU1 If you have anything you think you can contribute to the prospect of decompressing this file, feel free to post. Wink
FallenAngel2387
Guest
« Reply #1 on: November 12, 2008, 09:23:20 am »

christ, i'll never understand this with dub haters. i mean, show me proof that you actually understand that the japanese voice acting is superior in every way. that they stress the correct syllables/words, show the proper emotion, etc. grandia 2 is actually one of the better dub jobs out of there, and that is by no stretch a jab at dubbing, because it's actually good.

i'm not trying to start an argument, but you picked a game that actually has good dubbing as you're source for hatred of dubbing in general.
tc
Guest
« Reply #2 on: November 12, 2008, 11:17:04 am »

Differences in language structure and voice acting industry, might be part of why bad Japanese voice actors are virtually unheard of.

I don't know of anything that's considered in Japan by native Japanese people to have bad Japanese voice acting. :huh:
Xzyx987X
Guest
« Reply #3 on: November 12, 2008, 12:47:31 pm »

I could go into details regarding how they butchered the translation (frankly the game could use a complete re-translation, but that seems a little impractical at the moment), turned the most emotional scene in the game into a corny mess, and just generally overacted the whole script. But I won't, because that would take paragraphs of off-topic discussion, and would accomplish nothing in terms of actual results. And you know, it's not like I have never played a dubbed game that I was able to tolerate. It's just that since playing Grandia II I've always harbored a latent bias against games that are dubbed, and I always make it a point to play games undubbed whenever it's possible.

Putting that aside, I was actually able to get the PC version of Grandia II working (not sure why I couldn't do it the last time, other than the fact Vista was new when I tried it and possibly something they patched increased the compatibility), and so I'm going to attempt to take a crack at this myself. The only thing is, I was examining the text from the "compressed" file I posted earlier, and after taking a closer look at it, it really strikes me as odd. I had assumed that the reason for the compression having so much visible plain text was the speed vs efficiency trade-off it took to make it work in real time. But after closer examination, relatively large words being repeated in very close proximity with no obvious compression applied, and certain inconsistencies in the way the data stream is obscured, lead me to believe that this is not compression, but intentional obfuscation instead. This rather confuses me, because I would have assumed the data would be a good candidate for compression, and with the whole game being so tightly packed onto a single GD-ROM, space would be at a premium. Not to mention the fact that compression would in and of itself be an effective means of obfuscation, so there would be little reason not to use it. But no matter which way I look at it, the data stream just doesn't look compressed, even by a relatively inefficient means. I'm going to attack this thing full force with IDA this evening, and it'll be very interesting to see what I find.

EDIT:
Quote from: tc on November 12, 2008, 11:17:04 am
Differences in language structure and voice acting industry, might be part of why bad Japanese voice actors are virtually unheard of.

I don't know of anything that's considered in Japan by native Japanese people to have bad Japanese voice acting. :huh:

You know, I think it has a lot to do with the fact that the tonality in the way Japanese people speak is a lot more consistent that in english, but in general I do think it is harder for japanese people to screw up voice acting than english speaking people. Another issue that makes it difficult for the english voice actors to compete, is that the scripts translated from japanese often sound stiff and unnatural, and often the only way to get around this is to stray so far away from the original dialogue that you may as well be reading a rewrite. You don't get nearly as many complaints about the voice acting for stuff originally written in english, such as american cartoons, even though in a lot of cases it is easily as cheesy and over the top as the acting in dubs.
« Last Edit: November 12, 2008, 12:56:40 pm by Xzyx987X »
GenoBlast
Guest
« Reply #4 on: November 12, 2008, 05:07:12 pm »

Quote from: tc on November 12, 2008, 11:17:04 am
Differences in language structure and voice acting industry, might be part of why bad Japanese voice actors are virtually unheard of.

I don't know of anything that's considered in Japan by native Japanese people to have bad Japanese voice acting. :huh:
I forget where, but I read a post where someone said Japanese people don't care about bad dubs because everything there (that they didn't make) is dubbed anyway. So I guess that's why you don't see any fan groups subbing Aladdin in Japanese. Smiley
BRPXQZME
Guest
« Reply #5 on: November 12, 2008, 05:14:03 pm »

I was under the impression that a lot of foreign stuff in Japan is sub-only (especially U.S. TV shows... sorry weeaboos, you want a Japanese dub of House, you’ll have to settle for Black Jack). Disney movies are a notable exception.
Kitsune Sniper
Guest
« Reply #6 on: November 12, 2008, 05:14:18 pm »

... But I liked Grandia II's dub. ;_;

I really did! It was cheesy but it was fun! ;_;
FlashPV
Guest
« Reply #7 on: November 12, 2008, 05:29:43 pm »

There's a french translation on the way. Maybe they can help you.
Take a look here: http://dark.magus.free.fr/phpBB2/
Gemini
Guest
« Reply #8 on: November 12, 2008, 05:43:27 pm »

Reversed the compression algorithm myself years ago. Mat used my note to make a full compressor. Here you can find the compressor with sources, along with other programs to deal with Grandia 2.
andwhyisit
Guest
« Reply #9 on: November 12, 2008, 06:56:09 pm »

But I liked the dubbing in Grandia II... Sad
Xzyx987X
Guest
« Reply #10 on: November 13, 2008, 12:38:14 am »

Quote from: Gemini on November 12, 2008, 05:43:27 pm
Reversed the compression algorithm myself years ago. Mat used my note to make a full compressor. Here you can find the compressor with sources, along with other programs to deal with Grandia 2.
Holy shit, you just saved me at least a week's worth of work. :thumbsup: I owe you big time. Wink

Edit: By the way, the code for extL62C has a rather stupid bug in it that I had to fix... *cough*err = 1;*cough*
« Last Edit: November 13, 2008, 03:45:48 am by Xzyx987X »
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC