Grandia English Patch

Translating Grandia 1.1.1

Hello. I just registered to deliver a huge Thank You to you TrekkiesUnite118 and every one else that made this possible. Grandia has always been one of my dearest experiences and its theme has accompanied me for decades. I am really grateful to all the work you all have put through and I know it is not an easy walk.

Sincerely, Thank You for this. I will be happy to donate, if that is a thing that exists in this project.

Might I also ask for codes on the game ? I am mostly interested in Magic Skill Exp accumulation or multiplier and Mana Egg acquisition codes in order to *finally* complete this game fully. The ones provided by [GameHacking.org | Grandia (Jpn)] do not include such codes...
 
Last edited:
The codec on Github is now usable. I included an example to show how to use it. To run the example script you have to use a test video. The video I used is not included in the repository because of copyright reasons. If you want to use the same video I did, you can download the intro of the enhanced edition from Youtube in 1080p.

Keep in mind though that this is WIP. There are still problems. Specifically, some blocks decompress notably worse than others and there are still color overflows. The overflows can be reduced with the right scaling and/or clipping settings though.

 
Here's a quick test using the PS1 intro video combined with the Muxer I wrote:



Overall I think it's looking ok, I just need to play with the colors a bit. The only limit I've hit is that 1 second of Frames has to be under 120 sectors in size, as that seems to be the size of the buffer.

How do you handle the compression level? The compression level can be adjusted per frame and channel. I suspect the original encoder used the compression level to ensure that the size requirements are met.
However, the compression level is not fully implemented in the codec yet. At the moment you can only chose a global compression level and not per channel. Also levels higher than 15 are not properly implemented, because the level information is encoded in only 4 bits. I'm not sure how the game handles higher levels yet, but it's probably related to the first 4 bits of the header. These are the only bits of the header which purpose I haven't identified.
 
I just had it at 10 across the board for that. Though playing with colors I've gotten it to look better.

EDIT:

I made a change to the demuxer to have it spit out the compression level of each frame as an array. That way you can just drop it in the python script to use for re-encoding the replacement video.

Attached is a sample of what I have now for the intro.
 

Attachments

  • MOV20.MOV
    18.7 MB
Last edited:
I fixed the issue that caused some blocks to look worse than others. I also realized the game prevents integer underflows when it does the colorspace conversion. This means RGB values close to zero are not a problem, only values close to 255 are.
I tried to find out the purpose of the first 4 bits of the header and as far as I can tell it has nothing to do with the quantization. This leaves the question open why the quantization table has 18 entries when you can effective only use 16 due to the 4 bit encoding. The first 4 bits actually determine if the last horizontal line of blocks, and only the last line, uses differential coding for the macroblock elements or not. Why you would ever want that is currently beyond me. I don't see any advantage of not having differential encoding on the last line of macroblocks.

Edit: I've attached a screenshot of how it looks if I set the flag in the first 4 bits without adjusting the encoder.
 

Attachments

@nanash1 I figured I'd post some examples of how subtitles look:

GRANDIA-0062.png

GRANDIA-0064.png

GRANDIA-0065.png

GRANDIA-0060.png


Overall I think it's looking ok. It's definitely legible. The few errors you do see are only there for a frame or two and in motion they're not noticeable. That said I am forced to use the PS1 FMVs. The HD Remasters seem to have the colors and contrast boosted to such a degree that the compressed frames are just too large if I match the compression of the originals. And honestly color wise the Saturn and PS1 versions look better anyways as they're not full of crushed blacks.
 
@nanash1 I figured I'd post some examples of how subtitles look:

Overall I think it's looking ok. It's definitely legible. The few errors you do see are only there for a frame or two and in motion they're not noticeable. That said I am forced to use the PS1 FMVs. The HD Remasters seem to have the colors and contrast boosted to such a degree that the compressed frames are just too large if I match the compression of the originals. And honestly color wise the Saturn and PS1 versions look better anyways as they're not full of crushed blacks.

I also think it looks ok. It would be technically possible to only re-encode the part of the video that has subtitles. This would leave most of the video untouched. At least lossy compression wise.
 
The issue I'd see with re-encoding only the part with subtitles is that the colors might not perfectly match.

Basically what I've found seems to work is this:
  1. Take PS1 Video and resize it to the Saturn resolution.
  2. Apply a 0.25-0.5 Guassian Blur to try and smooth out the M-JPEG Artifacts.
  3. Lower Brightness by about 10%
But that's with the version you had a few days ago. Are your new changes committed?
 
The issue I'd see with re-encoding only the part with subtitles is that the colors might not perfectly match.

Basically what I've found seems to work is this:
  1. Take PS1 Video and resize it to the Saturn resolution.
  2. Apply a 0.25-0.5 Guassian Blur to try and smooth out the M-JPEG Artifacts.
  3. Lower Brightness by about 10%
But that's with the version you had a few days ago. Are your new changes committed?
Yeah, the changes are on github. There were some blocks that didn't decode correctly due to a bug in the lossless encoding. It's actually noticable in the your example video if you look for it. This is fixed. I also changed the color offset. Before I offset the y channel by -124 because that's what the game adds to the channel when it decodes it. But I also realized before that the original encoder has to subtract a different value, because the original Video has solid black blocks at -128. Since I realized that there is no problem with underflowing, I changed the offset to -128 to be closer to the original encoder.
 
@nanash1 I figured I'd post some examples of how subtitles look:

View attachment 5774
View attachment 5775
View attachment 5776
View attachment 5777

Overall I think it's looking ok. It's definitely legible. The few errors you do see are only there for a frame or two and in motion they're not noticeable. That said I am forced to use the PS1 FMVs. The HD Remasters seem to have the colors and contrast boosted to such a degree that the compressed frames are just too large if I match the compression of the originals. And honestly color wise the Saturn and PS1 versions look better anyways as they're not full of crushed blacks.
The subs are looking good. I think if you remove the shadows and use a thinner outline, they may look better. Bellow are the Megaman X4 jp videos I've subtitled for example, I think the image quality are similar. They look good on my tv with scanlines.

mmx401.png

MMX402.png
 
So I have all but one FMV encoded with Subs. MOV15 seems to be odd. Basically no matter what I try I end up with messed up colors, almost like the Red and Green channels have been swapped. I've attached the original and the re-encoded one if you want to look at it @nanash1.
 

Attachments

  • MOV15-Subbed.MOV
    4.9 MB
  • MOV15-Original.MOV
    4.9 MB
I was able to figure it out. I had to write some code in the python script to split the Red, Green, and Blue channels and manually swap the Red and Green ones. I'm not sure why but no matter what source I used I always ended up with this problem no matter how I prepped the video. Maybe this FMV is hardcoded to have the red and green channels swapped for some odd reason?

But anyways, I have all the FMVs subbed now. There's just one or two minor things I want to take a look at and then I should have a release candidate patch ready.
 
I was able to figure it out. I had to write some code in the python script to split the Red, Green, and Blue channels and manually swap the Red and Green ones. I'm not sure why but no matter what source I used I always ended up with this problem no matter how I prepped the video. Maybe this FMV is hardcoded to have the red and green channels swapped for some odd reason?

But anyways, I have all the FMVs subbed now. There's just one or two minor things I want to take a look at and then I should have a release candidate patch ready.
I'm not really sure why you'd want to swap red and green either, but I have a theory. The green channel is somewhat special. It has a higher weight when the luminance y is calculated, because the human eye is more sensitive to green. I haven't looked at video yet, but maybe it doesn't have as much green color as usual. This could be reason why you may want to swap the channels.
 
Back
Top