Ogre Battle 64 Help
Users browsing this thread: 1 Guest(s)

Hello from the forum.
I'm new here, I'm Brazilian and I've been trying to make the translation into the game Ogre Battle 64 more apparently the same with the dialogs compressed, I would like to know if anyone here in the forum could help me with this. or at least tells me where I could find help.

Hi, welcome to the forums.

I've never looked at the Ogre Battle 64 ROM before, but I cracked open the (U) version to see where text and dialog might be encoded. The good news is a lot of it looks like ASCII encoded, but the bad news is most of it is compressed. There are about 800 LHa compressed blocks in the ROM and some of them contain ASCII encoded text.  You can manually extract the LHa blocks or use a tool like binwalk to automate the extraction. 7zip can be used to decompress the LHa archives.

along with some additional control characters to indicate the formatting and order of the text.

For example, in serifu_01_0.bin, there is the text for `General Godeslas "Welcome to the Palatinean Army,`

[Image: MfehvoF.png]

[Image: l1TAXje.png]

As you can see in the header of the binary, there are offsets to each block of text. Hopefully that gives you enough to start.

Just to clarify, these are the individual steps I took:
Run binwalk on 'Ogre Battle 64 - Person of Lordly Caliber (U) [!].z64' using extract flag. You made need the lha or lhasa tools installed to automatically extract them.

Code:
​$ binwalk -e "Ogre Battle 64 - Person of Lordly Caliber (U) [!].z64"
DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
255086        0x3E46E         LHa 2.x? archive data [lzs] [NSRL|LHA2]
255094        0x3E476         LHa (2.x) archive data [lh5] [NSRL|LHA2]
255102        0x3E47E         LHa (2.x) archive data [lh4] [NSRL|LHA2]
255110        0x3E486         LHa 2.x? archive data [lh3] [NSRL|LHA2]
255118        0x3E48E         LHa 2.x? archive data [lh2] [NSRL|LHA2]
1050529       0x1007A1        Neighborly text, "neighboring countries@3@l@e@1@2Lord Lodis.@3@l@e"
6514564       0x636784        LHa (2.x) archive data [lh5] [NSRL|LHA2]
6594636       0x64A04C        LHa (2.x) archive data [lh5] [NSRL|LHA2]
...


From there, you'll have a bunch of *.lha files in a subdirectory. Most of them will be the wrong size since the tool does not correctly determine the end of the LHa stream, so you'll probably end up with 6GB of files. If it doesn't automatically decompress them, you'll manually have to do it. This can be done with 7zip or the command line 7za or lha tools. In particular, the '1FD0958.lha' file contains the 'serifu_01_0.bin' file from my example above:
[Image: WITmiqg.png]

Extract that binary and then you can open and view it in a hex editor (I was using HxD in that screenshot).

In order to make changes to these files, you will probably want to write a tool or use an assembler to correctly update the offsets in the binary files. If you have any questions about how to do this, feel free to ask.  I can also probably set up an example for you, similar to what I setup for the SM64 Spanish translation work.

There are two more issues that you will probably need to resolve. One is finding where the table of LHa files is in the ROM. You may need to relocate some of these files if the translation produces larger LHa files than in the original and this table will then need to be updated. Second, if you need the accented characters, they may not exist in the font in-game and you may need to modify the text display code to support them.

Good morning, friend!

I'm helping the Samuray in this project. Is there any way to reinsert an edited file into the Lha file?

(05-12-2017, 12:35 PM)Kamppello Wrote: Is there any way to reinsert an edited file into the Lha file?


I haven't tried them yet, but I'd think the LHa for Unix or lhasa utilities would work. When I find some time, I'll give them a try and report back here.

I managed to find some time to try out the tools. Looks like lha is the only one that can compress the data (lhasa can only decompress). Unfortunately, there are multiple versions floating around, so I can't say which one is best. The documentation is mostly in Japanese.
LHa for Unix: http://www2m.biglobe.ne.jp/~dolphin/lha/lha-unix.htm
LHa for Unix (updated): https://osdn.net/projects/lha/
gnuwin32: http://gnuwin32.sourceforge.net/packages/lha.htm

I created a tool to dump all the LHA blocks and run the lha tool to extract them. I have no idea where the tables or references to this data are in the code.  I'm attaching a Windows build of it here (including the gnuwin32 build of lha), but the source for it is on GitHub:
https://github.com/queueRAM/ogre_battle_tools

I only did one quick test on replacing the dialog in the intro scene. I used lha to re-compress the text and armips to reinsert the ROM, although you can just use a hex editor for the latter. Here is the result:
[Image: hKQpc0p.png]

The armips source and build script are included in the attached archive.
Code:
​// Ogre Battle 64 (U) update dialog example
.n64
.open "Ogre Battle 64 - Person of Lordly Caliber (U) [!].z64", "ob64_test.z64", 0

// 01FD0216: intro dialog "You're leaving tomorrow?" ...
.orga 0x01FD0216
.area 347, 0
.incbin "01FD0216_new.lha"
.endarea

.close


Attached Files
Size: 72.08 KB / Downloads: 69 .zip   ogre_tools_v1.zip


I have completed a tool practically, but I am not able to use the LHA tool on my computer ... it opens and closes automatically, please help me.

(05-01-2018, 11:34 AM)Kamppello Wrote: I have completed a tool practically, but I am not able to use the LHA tool on my computer ... it opens and closes automatically, please help me.


LHA is command line tool that you can run from the command prompt. There is no graphical interface. I think the command I used to recompress the dialog was:
​lha c 01FD0216_new.lha serifu_00_0.bin

[Image: y7JUypZ.png]

See --help for more options.
[Image: asmNudi.png]

Thank you very much, queueRAM!

It still is not working as I wanted, but I can already translate the game.




(11-01-2018, 01:49 PM)Kamppello Wrote: It still is not working as I wanted, but I can already translate the game.


Excellent! Glad to see you are making good progress and are making a tool to help.

Regarding the accented characters, you might have to adjust the font texture tables to support them and work on the character encoding. I'm not sure where that information is stored, but if I find it, I'll update this thread. Please update this thread with any progress or questions you have.

Ogre Battle 64 Help
Users browsing this thread: 1 Guest(s)