Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Drakon on January 27, 2013, 01:30:45 pm

Title: Lagrange point text tile editing
Post by: Drakon on January 27, 2013, 01:30:45 pm
I've been interested in learning how to hack a rom from japanese to english.  I decided to learn on lagrange point since it's a great game that I'd love to see in english.  I learned how to make tables and find japanese text in the rom and change it into other japanese text.  I'm trying to change the text graphic tiles from hiragana into english but all tile editing programs I tried don't display the tiles from lagrange point properly.  They work with other nes roms but not this one.  Is there something I need to do to make it work?
Title: Re: Lagrange point text tile editing
Post by: Gideon Zhi on January 27, 2013, 02:01:21 pm
Lagrange Point's data, both graphical and text, is compressed. You're not going to be able to get at either without special hand-rolled tools and a hefty amount of assembly-level reverse engineering. It's definitely not a beginner project.
Title: Re: Lagrange point text tile editing
Post by: Drakon on January 27, 2013, 02:34:01 pm
Lagrange Point's data, both graphical and text, is compressed. You're not going to be able to get at either without special hand-rolled tools and a hefty amount of assembly-level reverse engineering. It's definitely not a beginner project.

Yikes.  I found the text and managed to edit that so that's interesting.  I don't suppose you have a version kicking around where you changed the japanese text tiles into english.  I noticed lagrange point hasn't had any progress in a long time, is the compression the reason why?  Also does the game use standard compression or something special?

*edit*

Methinks this's what I need:

(http://www.romhacking.net/utilities/screenshots/554screenshot1.png)

http://www.romhacking.net/utilities/554/ (http://www.romhacking.net/utilities/554/)

I downloaded python but I'm having trouble getting it to work how I want it to.  Yowza.  It runs, it decompresses, but the decompressed file is only 1-2k size and it's not giving me nes tiles yet.  Either I'm doing something wrong or this program uses a different compression format.  Anyway I found this classic post by you:

http://forums.nesdev.com/viewtopic.php?t=3344 (http://forums.nesdev.com/viewtopic.php?t=3344)

So you've broken the compression.  The type of compression isn't posted, I'd love to work on this game for fun, but I guess it's above me, darn.
Title: Re: Lagrange point text tile editing
Post by: Gideon Zhi on January 27, 2013, 04:05:09 pm
I noticed lagrange point hasn't had any progress in a long time, is the compression the reason why?

No. The original compression's been broken, and has been replaced with something slightly more powerful. Part of the problem is that the text still doesn't fit, so there's been a slow and arduous editing process to get it rewritten to a point that is both concise AND highly representative of the original meaning. Another part of the problem is that the game crashes when you level up. *Another* part of the problem is that there are a whole lot of interfaces that still need work, and stuff is broken all over the place as a result of having strings longer than the game's original max length needing places to go on-screen. A bunch of them have been fixed up, but a bunch are still broken.

There are other reasons too. But those are the technical ones.
Title: Re: Lagrange point text tile editing
Post by: Bregalad on January 27, 2013, 04:09:38 pm
Have you tried to process the script with my CompressTools (http://www.romhacking.net/utilities/882/), which has about 10 different compression shemes, all of them being simple enough to be implemented on the NES, while minimizing additional ROM/RAM usage ?
Title: Re: Lagrange point text tile editing
Post by: Drakon on January 27, 2013, 04:20:11 pm
No. The original compression's been broken, and has been replaced with something slightly more powerful. Part of the problem is that the text still doesn't fit, so there's been a slow and arduous editing process to get it rewritten to a point that is both concise AND highly representative of the original meaning. Another part of the problem is that the game crashes when you level up. *Another* part of the problem is that there are a whole lot of interfaces that still need work, and stuff is broken all over the place as a result of having strings longer than the game's original max length needing places to go on-screen. A bunch of them have been fixed up, but a bunch are still broken.

There are other reasons too. But those are the technical ones.

Haha.  I like how you list a bunch of technical stuff and then end it with "there's other reasons but they're technical".  So is it currently crashing only because the file is too big?  I'm really interested in this project but I read on your website that you dislike update questions and whatnot so I didn't want to bug you about it.

Have you tried to process the script with my CompressTools (http://www.romhacking.net/utilities/882/), which has about 10 different compression shemes, all of them being simple enough to be implemented on the NES, while minimizing additional ROM/RAM usage ?

Thanks.  Since gideon says he "broke" the compression I'm thinking maybe it's not a standard type?  I'll try this but I'm not getting my hopes too high haha.

*edit*

Can't even get these to run after installing java, oh well.
Title: Re: Lagrange point text tile editing
Post by: Gideon Zhi on January 27, 2013, 04:46:20 pm
Haha.  I like how you list a bunch of technical stuff and then end it with "there's other reasons but they're technical".  So is it currently crashing only because the file is too big?  I'm really interested in this project but I read on your website that you dislike update questions and whatnot so I didn't want to bug you about it.

Thanks.  Since gideon says he "broke" the compression I'm thinking maybe it's not a standard type?  I'll try this but I'm not getting my hopes too high haha.

Nono, you misunderstand. There are other non-techincal reasons which I can't get into right now, but the ones I listed are the technical ones. And I'm not sure why level-ups are crashing. But yeah, it's also crashing because the file is too big, and some strings (item names and the like) are overflowing their on-screen window space, which looks really nasty even if it doesn't straight-out crash the game.

And there's really no such thing as "standard" compression. Even something simple like lempel ziv can be implemented in dozens of different ways. When I say that I "broke" the compression I mean that I've rewritten the game so it uses a different scheme than it was originally programmed for. In most cases when I "break" compression it means I'm streaming uncompressed text data directly from the ROM. In LP's case there isn't really enough space for that, so it just means that the game is now using a different, more efficient compression scheme.

From a technical standpoint, there are upsides and downsides to working on NES games. The good news is that FCEU X is an extraordinarily powerful debugger, and with it an accomplished hacker can perform complex hacks in a fraction of the time it'd take to do the same hack on the SNES with its comparatively stone-age tools. On the other hand, it's notoriously difficult to expand NES games. This makes finding space for translated text a gigantic headache, as English scripts generally require double the space of their equivalent Japanese counterparts, whereas expansion and text relocation on the SNES is usually trivial. I've gotten to the point where the technical stuff on the SNES is much easier to solve than the text crunch on the NES, and as such I personally generally prefer to work on SNES games. Just saying.
Title: Re: Lagrange point text tile editing
Post by: Pennywise on January 27, 2013, 07:09:43 pm
Quote
On the other hand, it's notoriously difficult to expand NES games.

That's a myth my friend. The problem with the Lagrange Point is that the mapper doesn't support PRG-ROM sizes of anything over 512kb and if we could expand the ROM to 1MB, it would be incredibly easy to make the game access the free space. Now, you could probably still expand the game to 1MB and create a custom mapper, but as far as I know any existing physical board would never be able to support it, including the original game board.
Title: Re: Lagrange point text tile editing
Post by: Gideon Zhi on January 27, 2013, 07:28:20 pm
That's a myth my friend. The problem with the Lagrange Point is that the mapper doesn't support PRG-ROM sizes of anything over 512kb and if we could expand the ROM to 1MB, it would be incredibly easy to make the game access the free space. Now, you could probably still expand the game to 1MB and create a custom mapper, but as far as I know any existing physical board would never be able to support it, including the original game board.

Which is a problem: it'd be incompatible with most emulators as well as the original hardware. What we'd be creating would no longer be an NES game, as it would conform to no existing hardware standard. That's not a step I'm willing to take.
Title: Re: Lagrange point text tile editing
Post by: Pennywise on January 27, 2013, 07:43:00 pm
Right, this kind of problem only exists for ~5% of Famicom games (excluding stuff like CNROM). Pretty much the majority of all games never utilized the maximum ROM sizes a mapper supported and therefore can be expanded pretty easily. I think a good chunk of the non-expandable ones are the Konami VRC games, but I've actually expanded two Konami VRC variants, so some are expandable.

Oh, yeah. The NES could support a 1MB Lagrange Point ROM, but someone would have to make a flashcart/new board that could run the ROM properly. So technically it's within the realm of possibilities. If only there were something like a SD2NES...
Title: Re: Lagrange point text tile editing
Post by: Drakon on January 27, 2013, 08:35:38 pm
Wait...do you have to re-write the rom code to support the new type of compression?

Right, this kind of problem only exists for ~5% of Famicom games (excluding stuff like CNROM). Pretty much the majority of all games never utilized the maximum ROM sizes a mapper supported and therefore can be expanded pretty easily. I think a good chunk of the non-expandable ones are the Konami VRC games, but I've actually expanded two Konami VRC variants, so some are expandable.

Oh, yeah. The NES could support a 1MB Lagrange Point ROM, but someone would have to make a flashcart/new board that could run the ROM properly. So technically it's within the realm of possibilities. If only there were something like a SD2NES...

I'd prefer finding a way to get it to run with the real vrc7.  I find flashcart reproduction of the audio chips in famicom carts are always noticably different than the real thing.  I'd rather make something with a truncated script that'll atleast run on the real thing.  I guess I didn't know what I was getting into with this one, apparently it's quit a difficult game to attempt to fanslate.
Title: Re: Lagrange point text tile editing
Post by: Pennywise on January 27, 2013, 10:07:10 pm
Quote
Wait...do you have to re-write the rom code to support the new type of compression?

If you mean, does the code currently need to be written for the game, I believe that's already been taken care of. Although the current compression could probably be replaced with something even more powerful like Huffman. Potentially Gideon could get RedComet to do the honors...

Drakon, picking an RPG to learn on for a first project is usually not a good idea unless you have a programming background, and even then it's not the best of ideas. RPG's require the most work and effort and can take really long to finish especially when hacking the code is necessary for a good translation. Picking a smaller game with less text is the best way to learn as there is less stuff to deal with and progress can be measured more easily. It's like comparing a mountain to a hill etc.
Title: Re: Lagrange point text tile editing
Post by: Gideon Zhi on January 27, 2013, 11:31:35 pm
If you mean, does the code currently need to be written for the game, I believe that's already been taken care of. Although the current compression could probably be replaced with something even more powerful like Huffman. Potentially Gideon could get RedComet to do the honors...

I still don't think it'd be worth it. We already have a good deal more space than we'd have had if we kept the original encoding, and textual limits allowed Gun Hazard to become one of the most well-written projects I've worked on. It can be nice to work without the limits sometimes, but sometimes they're a good thing.
Title: Re: Lagrange point text tile editing
Post by: Drakon on January 28, 2013, 08:36:08 am
If you mean, does the code currently need to be written for the game, I believe that's already been taken care of. Although the current compression could probably be replaced with something even more powerful like Huffman. Potentially Gideon could get RedComet to do the honors...

Drakon, picking an RPG to learn on for a first project is usually not a good idea unless you have a programming background, and even then it's not the best of ideas. RPG's require the most work and effort and can take really long to finish especially when hacking the code is necessary for a good translation. Picking a smaller game with less text is the best way to learn as there is less stuff to deal with and progress can be measured more easily. It's like comparing a mountain to a hill etc.

Yeah I wasn't planning on doing the whole game I just wanted to change a few sentences haha.  So someone re-wrote the compression / decompression assembly for this rom?  I didn't realize they used compression in these old games.
Title: Re: Lagrange point text tile editing
Post by: RedComet on January 28, 2013, 09:45:30 am
@Gid: What sort of compression are you using now? I'm curious.
Title: Re: Lagrange point text tile editing
Post by: Gideon Zhi on January 28, 2013, 10:04:06 am
DTE+Dictionary. We get an extra 44% space, roughly.
Title: Re: Lagrange point text tile editing
Post by: Bregalad on January 28, 2013, 10:11:56 am
Haha.  I like how you list a bunch of technical stuff and then end it with "there's other reasons but they're technical".  So is it currently crashing only because the file is too big?  I'm really interested in this project but I read on your website that you dislike update questions and whatnot so I didn't want to bug you about it.

Thanks.  Since gideon says he "broke" the compression I'm thinking maybe it's not a standard type?  I'll try this but I'm not getting my hopes too high haha.

*edit*

Can't even get these to run after installing java, oh well.
I was actually addressing to Gideon Zhi, not to you.
Yes you have to run the compress tools from the command line. This is the price to pay for maximum of automation and flexibility.

By the way he's one of the best hackers of RHDN, and if he says this game is a hard one, it is a hard one. I recommend you to use this game to "train yourself for rom hacking", as it seems it was your original goal.
There is literally hundreds of simpler games which does not compress their data, and you should train on those first.

@Gideon Zhi :
Unless you sent me the script so I can test it, what usually works the best for english text is recursive DTE. Usually you can get proficient compression size, with the compressed size less than half of the original text.
Title: Re: Lagrange point text tile editing
Post by: DougRPG on January 28, 2013, 09:16:41 pm
Hi Gideon, do you plan to finish this translation? Seems to be a very good game. Send us some hope.......
Title: Re: Lagrange point text tile editing
Post by: DarknessSavior on January 28, 2013, 09:44:29 pm
I'm sure he does. Pretty sure Tomato wouldn't like it if he quit. And besides, Gid's got like a billion projects he's workin' on at once.

~DS
Title: Re: Lagrange point text tile editing
Post by: RedComet on January 29, 2013, 12:09:40 am
Oh, he'll finish it. If not, I'll hunt him down. >:D
Title: Re: Lagrange point text tile editing
Post by: Drakon on January 29, 2013, 09:13:05 am
Obviously gideon is one of the best.  Darn guess I'll just have to wait, I sorta thought this fanslation had been abandoned.
Title: Re: Lagrange point text tile editing
Post by: Gideon Zhi on January 29, 2013, 09:25:44 am
I sorta thought this fanslation had been abandoned.

Unless I outright state otherwise, it's always safe to assume that nothing on my project list has been abandoned or forgotten about.
Title: Re: Lagrange point text tile editing
Post by: Drakon on January 29, 2013, 12:11:27 pm
Unless I outright state otherwise, it's always safe to assume that nothing on my project list has been abandoned or forgotten about.

Gotcha.  Atleast I now know why it's taken so long.  It's always fun learning how the roms work.  This one seems like a real nightmare to work with.