News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Seiken Densetsu 3 text compression / Seiken Densetsu 1 text help  (Read 1281 times)

Tomato

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • Legends of Localization
Hello! I've been thinking of doing another multi-translation comparison project similar to my Final Fantasy VI comparison from last year, comparing the Japanese script, the fan translation, and the official translation.

I first need to extract the Japanese text, but as I recall, it uses Huffman encoding for compression. I did a bunch of binary tree stuff in school loooong ago, so I only remember the basics but not the details on how Huffman works and how the tables are stored. I do already have a full Japanese table and have been tracing the important code for a few days now.

As best as I can tell, a major (whole?) portion of the decompression routine begins at c470ce, but I can't tell for 100% where the source data is coming from in the ROM, or how the decompression works.

Anyway, I'm currently up to my eyeballs in ASM logs and traces, so I was wondering if anyone has experience with this game's text and/or can give any advice. Thanks! (also I dunno if this is the right board for this so feel free to move it if needed)
« Last Edit: June 21, 2019, 02:51:57 pm by Tomato »

tvtoon

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: Seiken Densetsu 3 text compression help
« Reply #1 on: June 16, 2019, 10:54:38 am »
I also have this side project in mind, so while this document is of some use, I also got some tools from abandoned translation project. I think they came from Terminus Est mostly.

If you need the insight, I can upload them here.

Tomato

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • Legends of Localization
Re: Seiken Densetsu 3 text compression help
« Reply #2 on: June 16, 2019, 04:46:56 pm »
Yeah, anything would be helpful!

Pennywise

  • Hero Member
  • *****
  • Posts: 2236
  • I'm curious
    • View Profile
    • Yojimbo's Translations
Re: Seiken Densetsu 3 text compression help
« Reply #3 on: June 16, 2019, 05:18:25 pm »
Have you tried contacting Neill Cortlett? I know he's not active anymore, but I'm sure he still has his stuff from his SD3 project somewhere. Could give you everything you need I suppose.

tvtoon

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: Seiken Densetsu 3 text compression help
« Reply #4 on: June 16, 2019, 07:48:52 pm »
Just submitted them, hopefully somebody will create better stuff to mess with SD3 and ToM in the future.

RedScorpion

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Snes-Projects
Re: Seiken Densetsu 3 text compression help
« Reply #5 on: June 17, 2019, 03:02:19 am »
Hi Guys,

the german sd3 team has already investigate the rom file and found some informations. It seems that the most of all used graphics, location text, intro logo small and bug are uncompressed in the rom.

If you set a break to 389800 pc / F89800 SNES the dialogs used some pointer to MTE/DTE Dictionary, but it seems the text is compressed.

So far one complete dialog used always the DTE/MTE Dictionary. Some chars like .,- are seperated.

3E2F00 / 1x32@4bpp linear there is the font for the dialogs
440EC0 / 4BPPMenusymbols
4710C0 / 4BPP Complete Intro as grapic
45FEC0 / 4BPP TRIAL OF MANA grapics

Thanks

red

Special-Man

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Seiken Densetsu 3 text compression help
« Reply #6 on: June 17, 2019, 03:44:50 am »
I really would love to see such a comparison; especially by Tomato, who has done those perfectly before for other games.

@Tomato:
Take a look at this: https://github.com/rofferom/seiken_densetsu_3
It can extract some Japanese text into picture files. With other language dumps we can help you probably. Magno would be a great support as well.


As Red already mentioned, we are currently investigating the official ROM as well. I am not sure what comes out of it. Text is not decoded yet. At least I would like to offer the official logos (compressed) for the existing fan translations as well. - Jezze might also create a “Trials of Mana” logo in the style he has done it with the “Secret of Mana 2” and “Seiken Densetsu 3” logo: http://www.romhacking.net/hacks/2569/ (*currently looking for the coordinates of "Seiken Densetsu" and "3"*; because different color palettes are used and we might need to tricky place the "3" (-> "of") into the middle of the screen.) Other spontaneous ideas: Including Neill's Music Test into the official ROM (there is way enough space), in a really long term - trying to compress official ROM (text) to 4MB, changing fonts, ...

Besides that, we will release the (final) German fan translation (v3.0) soon, since there is now the official release and I really don't want to see my latest changes go to waste... Too much work went into that. http://www.romhacking.net/translations/2037/

@tvtoon
Better ask Terminus first, before making any tools public. Or share them privately with Tomato. Don't get me wrong, but asking doesn't hurt. Maybe they do not agree with this.

@all
Please support Square Enix, buy this game – independently whatever you prefer to play (fan translation or Collection of Mana version).
« Last Edit: June 18, 2019, 03:43:13 pm by Special-Man »

tvtoon

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: Seiken Densetsu 3 text compression help
« Reply #7 on: June 17, 2019, 10:39:27 am »
I really should, but since the distribution has been public since 2006 I think it is not a big deal. It just wasn't uploaded here. We are not really into playing here, you know. ;)

About the graphics, except for the font, everything else is using the same format as SD3 but they are at the same addresses, before the expansion point (small font etc).
*************
I was reading ancient source of knowledge from the translation topic, according to the posts the compression used is called "Repair" with a Huffman over the rainbow.
« Last Edit: June 17, 2019, 11:10:01 am by tvtoon »

WeebeeGeebee

  • Full Member
  • ***
  • Posts: 184
    • View Profile
Re: Seiken Densetsu 3 text compression help
« Reply #8 on: June 17, 2019, 12:40:55 pm »
Jezze might also create a “Trials of Mana” logo in the style he has done it with the “Secret of Mana 2” and “Seiken Densetsu 3” logo.

That would be cool. Jezze was always very nice. I'm sure he could create such a patch. But I would also like to see more. Since the Trials of Mana rom reportedly uses a Variable Width Font.

Tomato

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • Legends of Localization
Re: Seiken Densetsu 3 text compression help
« Reply #9 on: June 17, 2019, 05:58:07 pm »
Whoooa that's an amazing resource, Special-Man, thanks!

I looked around at the code and I'm like "oh man, this looks tough but maybe it's doable".

But then I saw this and my head exploded: https://github.com/rofferom/seiken_densetsu_3/blob/master/doc/text_decode.txt

I've already figured out some of the things listed there, but there's just so much, yikes. I'm thinking I'll either just try to re-create the whole text decompression code in C++ or maybe modify an emulator to dump a line's decompressed data to an external text file and then just have it iterate over all the possible line #s. Otherwise I'll probably just move on to another game entirely, hah.

Special-Man

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Seiken Densetsu 3 text compression help
« Reply #10 on: June 18, 2019, 03:04:59 am »
Whoooa that's an amazing resource, Special-Man, thanks!

This might be useful as well: https://web.archive.org/web/20150831030024/http://kumiho.aerdan.org/translations/sd3.html
It helped us, because the English version had some small inconsistencies here and there, and we optimized the German translation.
Didn't you work on Bahamut Lagoon together will Neill? By any chance you can contact him? He has the full Japanese dump obviously.

Somehow out of topic: By the way, did anyone notice that some music tracks are interchanged in the English Music Test menu?
I checked this several times with my original soundtrack CDs and I am quite sure. http://www.som2.de/ausblick/musictest.png This can easily be corrected with a patch.
« Last Edit: June 18, 2019, 03:52:11 pm by Special-Man »

Tomato

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • Legends of Localization
Re: Seiken Densetsu 3 text compression / Seiken Densetsu 1 text help
« Reply #11 on: June 21, 2019, 03:04:48 pm »
While looking into this SD3 stuff, I suddenly felt a pang of nostalgia for SD1, which I haven't played in about 20 years. Fortunately, it sounds like someone more experienced is figuring out SD3's text right now, so I decided to take a peek at SD1's Japanese text to see if there was anything I could do with it too.

I've gotten a lot of the way in dump SD1's Japanese text, but just like SD2 and SD3, the text is surrounded by scripting code. I've figured out some of the basic control codes, but there still seem to be many complicated control codes. I noticed that there are no tools or docs for FFA on RHDN, so I'll probably need to figure all this out from scratch.

Here, Line 448 is nicely dumped, but then Line 449 is a mess of nonsense scripting :(



I'm also not sure why some lines have a weird byte before them (like the ノ here) while others don't:



Anyway, has anyone out there documented SD1/FFA's text system at all?

PowerPanda

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: Seiken Densetsu 3 text compression / Seiken Densetsu 1 text help
« Reply #12 on: June 22, 2019, 12:28:54 pm »
Crazy idea, but FFA doesn't have a whole lot of scripted events that move characters and NPCs around. Most interactions involve people talking in place. Is it possible that the event script is saved in line with the text?