+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Need some help with translating [Ragnarok DS]
Pages: [1]
Author Topic: Need some help with translating [Ragnarok DS]  (Read 1 times)
Soniyx
Guest
« on: April 10, 2010, 04:39:51 pm »

I am translating with some other people the game Ragnarok DS from english to german.
We got stuck by using the special characters Ä,ä,Ö,ö,Ü,ü,ß. Ingame there is just a rectangle what might be a missing character in the font.
The font the game uses is named msgcmn.fnt. What can we do to use these characters?

Some letters can be replaced, but only with others inside this file, and also these letters can be readressed, but foreign characters just produce errors in the game (texts won't be displayed correct anymore).

I uploaded our file, link is below.
Hope you can help us.

URL to msgcmn.fnt: http://www.mediafire.com/?2mdqqtwximr
Tauwasser
Guest
« Reply #1 on: April 10, 2010, 05:51:20 pm »

Format seems pretty straightforward for the most part:

File layout:

OffsetLengthDescription
0x00000x0008Magic ID 'TNOF\\00\\00\\00\\00'
0x00080x0001Probably regular data chunk size
0x00090x0001Maybe bit depth, maybe part of chunk size
0x000A0x0002Number of entries in main table
0x000C0x09F8Main table

Main table layout:

OffsetLengthDescription
0x0000 + entryNo*0x00080x0004Absolute file offset of gfx data
0x0004 + entryNo*0x00080x0004Unicode code point

Gfx data layout:

[Width][Data format/size] {(data format/size) * (regular data chunk size) data bytes}

Width is probably the advance width for every character. The data format specifies how many times 0x0C bytes should be used for representing the glyph; maybe it does other stuff, too. For entries with small data sizes, the bytes are probably doubled prior to writing to VRAM or something, go figure that out. Hence, most Latin glyphs will use data format/size specifier 0x01, since they can usually be doubled and look just as good.
For the graphic format itself, you probably already know the layout. If not, I figured that out with a simple test case, U+25CB, which is a circle â—‹. Basically, it will read 16 bits consecutively for every line of pixels, going from lsb to msb. Then it wraps into the next line of pixels and so on.

I want to mention that this took me longer to explain than to actually figure out. Maybe whoever is the hacker on your team should have taken a look first?

cYa,

Tauwasser
Soniyx
Guest
« Reply #2 on: April 10, 2010, 06:14:26 pm »

I just found two other files that are named font*. What about these, font8x8.fnt looks at first look similar to the msgcmn.fnt.

http://www.mediafire.com/?dmmnymeyymz
Tauwasser
Guest
« Reply #3 on: April 10, 2010, 06:26:32 pm »

The font file has the same layout. The other file could literally be anything. Since it identifies itself as a TEXT file, I would assume it chooses an arrangement of glyphs or something.

cYa,

Tauwasser
Soniyx
Guest
« Reply #4 on: April 11, 2010, 06:38:12 am »

We can display the graphical part of the file in Tile Molester.
Is it possible to add some other characters to this oder these fonts? Or do we have to create a new font file?
As far as I understand your explanation, it would be possible to add some other characters to this file, right?
Tauwasser
Guest
« Reply #5 on: April 11, 2010, 08:04:35 am »

It is possible to add characters, yes. However, you will have to keep in mind the file size. I don't know how the NDS handles this, but if your file is much bigger than the original -- however unlikely -- it may screw up the game, because it might overwrite RAM areas.

You can edit the font probably best with FEIDIAN, once you get it working, of course.

cYa,

Tauwasser
KingMike
Guest
« Reply #6 on: April 11, 2010, 09:35:41 am »

feidian isn't an editor, but an extractor/inserter.
Soniyx
Guest
« Reply #7 on: April 11, 2010, 09:59:08 am »

We got Feidian to work, the first result of a dump with the part of the important characters of the files msgcmn.fnt with tile_sizes of 8x8 and 8x25 and of font8x8.fnt 8x8 and 8x20 is uploaded: http://www.mediafire.com/?mmqoz0dmqoy

Btw, somebody has also some problems with these umlauts, the game was chrono trigger. He solved his problem by using a right table and writing a translator with support of these special characters. Currently, we use an Editor for a japanese version of Ragnarok (named RagnarokTrans 0.5), but it works also for latin letters and with the game.
We write a txt file with changes (it looks a bit like html) and the whole script.
Part of one txt file:
Quote
Commander <br>Hm? And you are...?
<ares><br>We came to ask about your<br>monster extermination efforts.

So this looks in the final file format *.msg like this:
Quote
€...C.o.m.m.a.n.d.e.r..0ýÿH.m.?. .A.n.d. .y.o.u. .a.r.e.......?...ûÿýÿW.e. .c.a.m.e. .t.o. .a.s.k. .a.b.o.u.t. .y.o.u.r.ýÿm.o.n.s.t.e.r. .e.x.t.e.r.m.i.n.a.t.i.o.n. .e.f.f.o.r.t.s.....

I think, this little tool works correct. Only our missing umlauts are the only problem.

Update: Now, all our umlauts are in the font and they are shown correct in the game. But this with only a trick: I replaced the grafics info and readressed to the new pictures. By using the original japanese character all graphics to this are shown. I tried to change them with the right characters (eg あ to ö), but neither あ nor ö are shown. Instead of that there is only the rectangle.
I think, that the game doesn't know how to work with these umlauts and couldn't allocate them to the right graphics.
Do you have any suggestions to solve that?

I uploaded a new version of the msgcmn.fnt with some informations about the changes: http://www.mediafire.com/?o2glw2gdmmt
« Last Edit: April 14, 2010, 01:25:11 pm by Soniyx »
Tauwasser
Guest
« Reply #8 on: April 15, 2010, 06:10:38 pm »

You reordered ABCDE without actually chaning the offsets for the gfx. That's bound to stir up problems. Also, you didn't edit the unicode values for the gfx you edited to the right ones, though you list them in your text file...

If editing them doesn't work, there might be script somewhere to make sure valid character ranges are used, though it seems not useful to me, since a lookup in the font would yield no match and you wouldn't have to skim input first.

cYa,

Tauwasser
Soniyx
Guest
« Reply #9 on: April 17, 2010, 09:36:39 am »

I just looked over the font and replaced the old unicode entries with the final ones. The old were japanese, the new are the umlauts. To solve the errors that came by changing the unicode entries I added to the entries in the file 5. But the characters aren't shown yet in the game.
I orientated myself by your file layout, where could the mistake be?

I uploaded my updated font file together with 2 Screenshots from the game showing the behaviour of the font file.
http://www.mediafire.com/?wylmgwnwgjg
Tauwasser
Guest
« Reply #10 on: April 18, 2010, 06:03:46 pm »

Try ordering the table according to the Unicode code point. Maybe the lookup-mechanism tries to save time by simply ignoring the rest of the file when it hits values greater than the one that is sought.
If that doesn't work, the game probably does use some other code to determine what ranges are valid and what are not. Also, you shouldn't change the table size indicator without actually providing enough entries.

cYa,

Tauwasser
Soniyx
Guest
« Reply #11 on: April 19, 2010, 01:51:04 pm »

I reordered all characters with an unicode table in their correct position and readressed them to the gfx data.
The result: It works, all Letters and also the umlauts are displayed.
Thanks for your help and your patience, you was a great help.
Until now I didn't know that the font has to have an appointed order.
Pages: [1]  


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