Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 06/01/07 23:06

Teigaku
Member
From: Budapest, Hungary
Registered: 06/01/07

OUP - Modified RAW no change at DAT

Hi everyone,

I've tried to change some in-game text and I don't know what to do next. I was fiddling with the Oni OUP Binary RAW Editor at the SUBT section, selected the dat-link offset and successfully extracted the proper SUBT file then translated some portion of the text. The only problem was I couldn't managed to reopen and edit the modified section of the RAW file again after importing the modified SUBT file. It seems that the OUP haven't modified the dat file at all and messed up the raw because next time I wanted to click on the file named 04652-subtitles.SUBT I've got a Stream read error.

I'm sure someone has the same problem as I do.
I have an English version of the game and tried all of these stuff with level0_Final.dat.

Last edited by Teigaku (06/02/07 00:06)

Offline

#2 06/02/07 06:06

Alloc
Member
From: Germany -> Darmstadt
Registered: 01/14/07
Website

Re: OUP - Modified RAW no change at DAT

Hi Teigakum

first of all thanks for your bug-report (think you're the first one besides geyser who actually did this smile ).
Could you send me your modified SUBT-file so I can try to reimport it?
I'm sure I know what the prob is and it probly will never be handled by RAWedit but just to make sure smile
But there'll be a editor for such stuff in the near future which will make it much easier.

Regards,
Alloc


ONI2.net, link to just any important resource-pages about ONI.

Offline

#3 06/02/07 13:06

Teigaku
Member
From: Budapest, Hungary
Registered: 06/01/07

Re: OUP - Modified RAW no change at DAT

I made three versions, so let's see 'em in order:

The file that you've requested is here. Screenshoot #1

Just for fun I cut these two words "Give me" from the original text and this is what just happened (I think it is not an OUP-related bug):
Screenshoot #2 SUBT file.

Finally, there is a picture and the file of the original content.

Hope that it helps.
BTW thanks for writing the editor. cool

Last edited by Teigaku (06/03/07 06:06)

Offline

#4 06/02/07 20:06

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: OUP - Modified RAW no change at DAT

You have to modify the DAT consistently with the RAW, especially in the case of the SUBT: http://wiki.oni2.net/index.php/OBD:SUBT
Generally speaking, if you increase the size of a RAW part in-place (i.e. without unpacking/repacking), the new RAW part will be appended, and the old one will be discarded.
The corresponding changes have to be made to the DAT. At the very least, the offset to the new RAW part (updated automatically by OUP in the recent versions... usually smile ).
In the case of the SUBT, the size of the RAW chunk is stored in the DAT as well, and OUP doesn't update it (yet), so you'll have to do that manually.

Then comes the really nasty bit. The DAT part of a SUBT stores offsets to the different strings in the RAW part.
If you change the length of a certain text string there, you'll need to update the offset of all the strings after it.
The only comfortable way right now is to keep the translations shorter than the originals (and delete nothing).

And now a question: although you have an English version of Oni to start with, it seems to display the accentuated characters of your translation.
That's quite unusual. The usual English version refuses to show accentuated characters. Could you mail your Oni.exe to me (see Website link)?

Last edited by geyser (06/02/07 20:06)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#5 06/03/07 06:06

Teigaku
Member
From: Budapest, Hungary
Registered: 06/01/07

Re: OUP - Modified RAW no change at DAT

I'm intended to make a non character limited translation (if possible).
What shall I do if I don't want to update the offsets in a comfortable way?
Have to fire up HexWorkshop (or similar hexeditor) and start hacking the DAT file? But how?

Maybe I'm lucky about accentuated characters. I have two rtp (RealTime Patch) files on the Oni install disc called French.rtp and German.rtp which contains the localization specific content of the game. Recently I ran a search script searching for Oni.exe on these two files and surprisingly no matches were found (thus the exe file could be global for all of the three versions).

You can reach the exe file from here.
I've included a hunchars file too containing all of the Hungarian alphabet specific letters.
Although "Õ õ and Û û" are not part of the alphabet, these letters are similar to the double acute accent ones what are the standard characters of the alphabet. Is there a way to edit Oni's fontfile displaying localized characters?

While I was searching for these characters (it took me almost two hours) I turned out some other special chars what you are might interested in to do some workaround.

Last edited by Teigaku (06/03/07 07:06)

Offline

#6 06/03/07 14:06

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: OUP - Modified RAW no change at DAT

Glad to have you around, man. Hot stuff, that magyar EXE. And your English is top notch, too smile

I suppose the .rtp don't actually patch the files in real-time? I mean, my installation always fully copies the English resources first, and then applies the French/German patches to every file. Is that the way it happens for yours?

The EXE looks very interesting... It indeed displays the French and German characters flawlessly. It's the same size as the "standard" (English) one, but there are a lot of differences here and there.
After a close inspection, it seems that our version was intended to display non-accentuated Latin characters (e.g., English) as well as 16-bit ones (Wide-ASCII or Unicode or whatever). The latter was probably used for Japanese localization and such.
As a result, that version apparently misinterprets an accentuated Latin char and the following char as a 16-bit character (an invalid one, hence the broken display of strings containing accents).

Your version is more recent by one month and does not include the 16-bit character check, so accentuated Latin displays fine. There are a few other differences (maybe bug fixes) which we're looking at right now.

HexWorkshop is shareware. I recommend the following two:
HxD : http://mh-nexus.de/hxd/
XVI32 : http://www.chmaas.handshake.de/delphi/f … /xvi32.htm
Or you can use OUP's DAT-editor, which is plenty enough.

Here's an example of what you need to do. Open your subtitles.SUBT in a DAT-editor, and its RAW-part in a RAW-editor. Then extract the RAW part and open it in HW, HxD, or XVI32.
Let's have a look. The first subtitle goes: 01_01_01°Griffin:  Give me another reading.° (° denotes the null char). The second one goes: 01_01_02°Shinatama:  All systems nominal. She's doing fine.°.
Look at the offsets at which those blocks start in the RAW file. The first one starts at 0x00000000, the second at 0x0000002C = 44. Now look at the DAT, and you'll see 0x00000000 and 0x0000002C listed in the array, at 0x00000020 and 0x00000024, respectively. Note that the offsets, like all the data except for text strings, are byte swapped, so they'll appear as "00 00 00 00" and "2C 00 00 00".

Let's say you want to alter the first two subtitles without affecting the rest. Then you'd want to modify the RAW like this:

OLD:
01_01_01°Griffin:  Give me another reading.°01_01_02°Shinatama:  All systems nominal. She's doing fine.°
NEW:
01_01_01°Griffin:  Yo, give me another reading.°01_01_02°Shinatama:  Systems cool, dawg. She be rollin.°

Note that the overall length of both subtitles is preserved. However, the first one is 4 chars longer, and the second one is 4 chars shorter.
So we need to update the offset to the second one in the DAT. The long integer (4 bytes) at 0x24 used to be 2C 00 00 00, it should now be 30 00 00 00.

All that can be done without an external editor, since we modified the RAW in-place. If you use an external editor and only modify the first subtitle, as follows:

01_01_01°Griffin:  Give me another reading.°
01_01_01°Griffin:  Would you be so kind as to give me another reading, please?°

... you'll obviously have 35 extra characters for that first subtitle.
That means that if you want to reimport that RAW-part and use it in Oni, you'll have to look at the DAT part and:
0) make sure the RAW offset at 0x00000018 is correct (OUP should take care of it for you)
1) increment all the long integers at 0x00000024 and beyond by 0x23=35
(Good news: the value viewer lets you do that with a dialog. Bad news: there are 608 of them.  neutral )

About the Hungarian characters. It is possible to extend Oni's font file and/or the set of special characters, but it involves increasing the size of DAT parts, so I'd stick with Õ õ and Û û for now.

While I was searching for these characters (it took me almost two hours) I turned out some other special chars what you are might interested in to do some workaround.

What do you mean?

Last edited by geyser (06/03/07 17:06)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#7 06/03/07 15:06

Alloc
Member
From: Germany -> Darmstadt
Registered: 01/14/07
Website

Re: OUP - Modified RAW no change at DAT

SUBT-editing will be more comfortable starting with release 0.35a or 0.36a ... don't ask me when it'll be done please wink
@Geyser: nice tut smile


ONI2.net, link to just any important resource-pages about ONI.

Offline

Board footer

Powered by FluxBB