Page 3 of 4

Re: Okami HD PC - Texts files

Posted: Mon Jan 08, 2018 1:02 pm
by ffgriever
Here is an updated msd tool that handles both u16 values properly. Now it also takes care of utf8 bom/signature.

http://ff12.pl/down/okami-tools-20180108.zip

Remember, though, the tool writes proper utf8 and expect utf8 but in fact is unaware of the encoding whatsoever. It's lazy but it works.

@innocentius92
You shouldn't need to modify MSA file for Spanish font. AFAIK all the characters used in Spanish are already there. Unless you mean the ñ character, that has some weird space on the right.

Photoshop needs a plugin to support DDS. I'm using paint.NET, though (it's free) with a "DDS Plus" plugin:
https://github.com/0xC0000054/pdn-ddsfi ... s/releases

Re: Okami HD PC - Texts files

Posted: Tue Jan 09, 2018 12:41 pm
by star19990
ffgriever wrote:Here is an updated msd tool that handles both u16 values properly. Now it also takes care of utf8 bom/signature.

http://ff12.pl/down/okami-tools-20180108.zip

Remember, though, the tool writes proper utf8 and expect utf8 but in fact is unaware of the encoding whatsoever. It's lazy but it works.

@innocentius92
You shouldn't need to modify MSA file for Spanish font. AFAIK all the characters used in Spanish are already there. Unless you mean the ñ character, that has some weird space on the right.

Photoshop needs a plugin to support DDS. I'm using paint.NET, though (it's free) with a "DDS Plus" plugin:
https://github.com/0xC0000054/pdn-ddsfi ... s/releases
this tool support 2-byte? (ex : korean)

Re: Okami HD PC - Texts files

Posted: Tue Jan 09, 2018 1:39 pm
by ffgriever
It doesn't support any language in particular. It supports the glyphs supported by the game and present in character replacement table (hardcoded in executable for now). It so happens I encoded the table as utf8. The tool should work (provided you'll use proper replacement table) on any encoding that doesn't use 0x00 values anywhere (it's read in text mode).

I'll add support for external table at some point. I don't need it (I have another version with hardcoded Polish diacritic characters), but it might make things easier for some people.

But... The game itself doesn't support combining jamos into full syllables, so it means you'd have to create a font with ~12k glyphs (containing all combinations) and create a table for these as well. Main font can't accommodate that much, but there is a system for Japanese version, that uses font pages (separate images) for each stage file. There can be many of such pages in each stage, but you have to add pages with all used glyphs to each stage.

For Japanese it was solved by adding kanas, romaji and some most common kanji to the main font and then adding font pages to each stage (so the font was basically different in each stage and the values of characters in one MSD file meant different glyphs than in another MSD file, in other words, the values are pointing at a particular glyph in a particualr font page, not at a particular character). But with Japanese it was easy, as there was only ~3k characters used in total, with only a small subset per stage. For Korean it actually gets more complicated. This writing system is simple and works great on paper, but becomes nightmare when there is no combining support available. Good riddance hanja are scarcely used in Korean nowadays, as that would complicate things even further :D.

Re: Okami HD PC - Texts files

Posted: Tue Jan 09, 2018 3:03 pm
by prime
innocentius92 wrote:
makcar wrote:
Zolodei wrote:makcar, dismantled the MSA archive or rebuilt the image?
I used Photoshop to edit dds.
How did you do it? Photoshop does not recognize the DDS file extension.

¿Can you help me, please?
innocentius92, As I said before, You have to install DDS plug-in file to photoshop.

Please refer to this site: http://gametechdev.github.io/Intel-Text ... ks-Plugin/
(intel texture works plugin)

And if you want to edit MessCore.dds file, you have to edit both RGB and alpha channel.

Re: Okami HD PC - Texts files

Posted: Thu Jan 11, 2018 1:57 pm
by ffgriever
An updated version of tools:

http://ff12.pl/down/okami-tools-20180111v2.zip

I've added support for PS2 binaries in okami-pack (via -ups2 and -pps2 switches).

I've added support for external character replacement table to okami-msd (via -t=table_file). I've included default table (it's not necessary as it contains exactly the hardcoded table) and Polish table I use for translation. Each line holds one entry in format

Code: Select all

u16_hex_value=replacement
The table supports utf8 (including bom). Malformed lines will be skipped (eg. value greater than u16, no 0x prefix, empty string, etc.). If a particular character is not found, tool will fall back to the hardcoded table. So only entries that have changed (or completely new entries) are required. The "replacement" part doesn't have to be one character. For example:

Code: Select all

0xb902={button}
is a valid entry and will be properly handled by both unpacker and packer. Newline at the end of file is optional.

The normal steps would probably be to export English (or other language) with default table (not specifying it at all is always a bit faster). Then translate in your native language and import with table containing all the glyphs you've used. You don't need to change parts of control/special values, because even if you've replaced it in table, it will still fallback to default table and be resolved properly.

Finally, I've fixed a stupid bug that could cause the tool to end export early or read past the end of file in very specific situations :/. Thanks to @makcar for the heads up.

Re: Okami HD PC - Texts files

Posted: Wed Jan 17, 2018 8:34 pm
by faqy
ffgriever wrote:An updated version of tools:

http://ff12.pl/down/okami-tools-20180111v2.zip

I've added support for PS2 binaries in okami-pack (via -ups2 and -pps2 switches).
I found some files has messed in this version.
Like "data_pc\st0\r011.bin" will cause msd tool crash.

Re: Okami HD PC - Texts files

Posted: Thu Jan 18, 2018 8:59 am
by ffgriever
These files are not used. On PS2 these directories (AFAIR st0, std and one or two more) were empty.

Re: Okami HD PC - Texts files

Posted: Sat Feb 03, 2018 3:11 pm
by MJay
Hi, can you update the tool to insert .pac files?

Thanks.

Re: Okami HD PC - Texts files

Posted: Sun Feb 04, 2018 1:33 pm
by ffgriever
These files (like EmFileMes.pac or EmFileIcon.dat) have no structure at all. It's just one file appended to another and padded to the length of the largest file rounded up to the nearest 0x800. The padding is not stored within a file (probably in the executable itself), so you need to keep the offsets.

I'm attaching a quick app that works with pac files containing MSD (it won't work for dat files as you would have to check the sizes with dds headers instead of msd headers). You'll need the libraries from my previous tool pack (or mingw64 installed).

BTW. I'm done with the Polish translation and the project has been released.

Re: Okami HD PC - Texts files

Posted: Mon Feb 05, 2018 3:24 pm
by MJay
Thanks. Did you edited the IDDs files?

Re: Okami HD PC - Texts files

Posted: Mon Feb 05, 2018 6:25 pm
by ffgriever
IDD files are handled by okami-pack tool just fine. Just as tbl, pac and many others. It's the structure that matters not the extension. The four applications in my toolset are all that's needed to do a full translation. I didn't have to use anything else.

Re: Okami HD PC - Texts files

Posted: Fri Feb 01, 2019 5:32 pm
by SuHeAndZl
ffgriever wrote:IDD files are handled by okami-pack tool just fine. Just as tbl, pac and many others. It's the structure that matters not the extension. The four applications in my toolset are all that's needed to do a full translation. I didn't have to use anything else.
hello sorry my English is bad

i want your okami GUI tools please

Re: Okami HD PC - Texts files

Posted: Sun Jun 30, 2019 2:33 pm
by weirdalsuperfan
ffgriever wrote: Thu Jan 11, 2018 1:57 pm An updated version of tools:

http://ff12.pl/down/okami-tools-20180111v2.zip

I've added support for PS2 binaries in okami-pack (via -ups2 and -pps2 switches).
I have the Japanese PS2 version of the game, and I want to get at the Japanese script. Do you happen to have that? It sounds like you don't yet support custom tables...I also don't know what encoding Okami uses.
Unzipping the iso gives me files like r10b, r120, etc. (with no file extension), a bunch of .DAT files, .SES files, .AFD/.AFS files, some .tm2 files, etc., but nothing explicitly labeled as .MSD, etc.

I'm also not sure how to run your program in bulk easily.

Details:
I tried running it on the r120 file of mine (and on the corresponding MessR120.MSD file I got from this thread), and while the latter worked well (and gave me English), the former gave me stuff like this, which I guess is because the encoding or this "table" is wrong and so it just spat out a bunch of bytes (I found a couple shift JIS tables, but it seems custom tables aren't supported soooo):
{DialogStart}
{0x0110} {0x0105} {0x0118} {0x0106} {0x011c} {0x0204} {0x012c} {0x0304} {0x013c} {0x0404} {0x0180}

Could you help me with a CLI command, or pointers to how to work with the files from the Japanese game?

I tried using okami-pack.exe but it gave me this
okami-pack.exe -u r120.bin
Number of files: 7
File 001 type MSD offset 00000040 size 10560
File 002 type MSA offset 000029a0 size 592
Error in main: Cannot create output file DATA0\r120.bin_dir\K.

and it only gave me a EFF.MST file because of this crash.

Re: Okami HD PC - Texts files

Posted: Tue Jul 09, 2019 7:31 am
by ffgriever
The problem with Japanese version is that there is one common font with kana and most commonly used kanji, but each msd file has its own supplementary font (or multiple of these). This means you'd need a separate character table for each location. Each supplementary font has from zero (mostly for menu files) up to over a thousand of characters. I needed Japanese files only for reading, so I didn't bother with that. Instead I just dumped the supplementary fonts into images and used in html. The interesting thing is that the game had furigana embedded. Here are the files I dumped from PS2 version in 2008/2009.

https://okami.ffgriever.pl/down/jap_furi.7z

Re: Okami HD PC - Texts files

Posted: Mon Jun 15, 2020 11:46 am
by Snake128
ffgriever wrote: Tue Jul 09, 2019 7:31 am The problem with Japanese version is that there is one common font with kana and most commonly used kanji, but each msd file has its own supplementary font (or multiple of these). This means you'd need a separate character table for each location. Each supplementary font has from zero (mostly for menu files) up to over a thousand of characters. I needed Japanese files only for reading, so I didn't bother with that. Instead I just dumped the supplementary fonts into images and used in html. The interesting thing is that the game had furigana embedded. Here are the files I dumped from PS2 version in 2008/2009.

https://okami.ffgriever.pl/down/jap_furi.7z
Hi ffgriever, I have some problems when I try to pack some folders, I lost file "runofs.ROF" when this has more than 1kb, and the switch version crash.

Have you any solution with this problem.

If we pack with ps2 version we doesn't lose runofs file but doesn't work with pc version pack.

Thanks