Zophar's Message Domain

Zophar's Message Domain (http://www.zophar.net/forums/index.php)
-   Rom Hack (http://www.zophar.net/forums/forumdisplay.php?f=8)
-   -   Sorcerer's Kingdom: Where to find "dictionary"? (http://www.zophar.net/forums/showthread.php?t=11053)

Kilyle 05-26-2009 10:30 PM

Sorcerer's Kingdom: Where to find "dictionary"?
 
Okay, so the Sega Genesis game Sorcerer's Kingdom turns out to be a great first project. It doesn't appear to have been translated before; it's an enjoyable game with some odd mechanics I haven't found elsewhere; and the text was easy to find, even the digraph-compression stuff.

So now I've figured out my table, most of it. And it includes a few longer entries: monster, King, have (with a space after it), you, the, and, ing, ill, etc.

My question is: How do I figure out where these words are defined, so that I could change them into something else?

I haven't been able to locate the font using Tile Layer; that's still a little confusing for me, especially where this game is concerned. So I'm hoping that it's defined in the code (that is, "King" works out to "K, i, n, g" instead of "graphic 1, graphic 2"). But I really have no idea how to locate this part.

In case it matters: I'm using WindHex.

I appreciate any help you can give me!

Reaper man 05-26-2009 10:38 PM

ok, so you have an MTE table, great. did you try relative search for "king" and see what comes up?

InVerse 05-26-2009 11:26 PM

It sounds like what you're dealing with is dictionary compression. If this is the case, do a search for one of the words in the "dictionary" and you should encounter a list of all of those words that include multiple values. It will most likely appear shortly after the rest of the game's text, though it could appear before the main text, as well. (For that matter, it *could* appear right in the middle of the text, but that would be rather unusual.)

As for not being able to find the font... Are you able to see the rest of the graphics in the game? If not, it may be that the graphics are compressed, an extremely common occurrence in Genesis games. There are a few utilities that may be able to locate common compression schemes and decompress the graphics (Nemesis Searcher is one such utility) but there's no guarantee that a particular game is compatible with these tools.

If you *can* see the other graphics, it's possible that your font is stored in a different bit plane than the rest of the graphics. Try switching to 1BPP which is a common format for fonts to be stored in almost every platform. (Fonts often consist of only 2 colors (usually white on black, but that's irrelevant) so they are often stored as 1BPP graphics so as to save space.)

Kilyle 05-27-2009 01:19 AM

I'll give it a try
 
I will definitely fine-tooth-comb the text area now, looking to see if I can find that dictionary nearby. I expect that'll be the answer there, although if not, I'll be back :)

As far as the graphics: It's like looking at the Matrix screen. I'm sure there's a pattern there I'm supposed to be able to clue into, but so far I'm failing to spot even a single recognizable square. But since graphics aren't my focus, I was just toying with it anyway. I figured I'd spot a sprite (or part of a sprite), but so far, no dice.

Genesis games, though, have finer graphics than NES and SNES games - speaking from the scant experience I have ripping graphics for use in fangames. Genesis uses way more pixels than the 24x32 base I'm used to. It makes it look nicer, but I expect that it also makes it harder to recognize graphics when they're split into chunks (since an 8x8 square would be a fairly large chunk of an NES sprite but a fairly small chunk of a Genesis sprite).

That's why I expect it will be difficult for me to recognize the graphics even if they're uncompressed... and why I'm not going into graphics at present. I was just expressing a hope that the text compression was code instead of graphics (since I've seen graphical text compression in Ultima: Quest of the Avatar, with the names of the virtues etc.).

So I guess it's back to work I go :)

InVerse 05-27-2009 01:54 AM

If you're just seeing green pixels on a black background, it's because you're in 1BPP mode. Genesis ROMs use .bin for their extension, but .bin is a generic format, so Tile Layer Pro doesn't recognize it as a Genesis ROM. Under Format in the View menu, select Genesis and then scroll down 25% or so and you'll see things that are obviously graphics. I didn't, however, see a font. I quickly glanced through it in 1BPP mode and a few others but still didn't locate a font, though I wasn't looking too terribly closely, so it's possible that I missed it. Hell, I haven't even played the game, so I don't even know if the font is 8x8, 8x16, 16x16 or some other strange format.

Just for the hell of it, I ran the ROM through Nemesis Search and it didn't detect any common compression algorithms.

Also, just for information's sake: I have 2 different versions of the ROM. One is specified as 1992 and the other is specified as 1993 [!]. (The [!] signifies that a ROM is a verified good dump (meaning somebody redumped it and compared it to the existing ROM and they were identical.)) So I would recommend using the 1993 [!] version. It probably won't make a difference as far as hacking goes, but the 1993 version most likely has some bug fixes and the like that may not be present in the 1992 version, and it's possibly that a patch made for one version may not work on the other version, so whichever version you use, if you complete your hack, make sure to specify the correct version in your documentation.

Also, I should have mentioned earlier, if you're using a .smd instead of a .bin ROM, you need to convert it to .bin, though I'm pretty sure if you were using a .smd (interleaved) ROM, you wouldn't have made as much progress as you already have.

Kilyle 05-27-2009 02:49 AM

Hmmm...
 
1 Attachment(s)
The .bin vs. .smd thing strikes a chord. I checked and the ROM itself, in the .zip backup I have, is .bin - Sorcerers Kingdom (U) (REV 01) [!].bin, to be precise.

But the file I have in my Tile Layer Pro folder is SorKtest.smd, and I don't recall if I simply renamed it or what. I think, if I did rename it, it was because Tile Layer wouldn't load it as a .bin file, and for some reason I experimented (I don't usually go around renaming file extentions all willy-nilly). I don't believe I downloaded a separate file.

Now, as for what I can actually make out at a cursory scan:

http://www.zophar.net/forums/attachm...1&d=1243437859

First, there's the text (copied from a screenshot); I haven't seen anything like it in Tile Layer's load of the file.

Secondly (in the red), I managed to find some sort of unfamiliar logo. It clearly says "The E--" and it might be a company logo; I didn't see something like that in the loading of the game.

Thirdly, the big stuff: Some sort of... hut? and a giant mountain. I think maybe if I had played the game more recently, these would look familiar, but they really don't. Maybe they're part of the map screen? Who knows. In the dark green circle I've highlighted a... cake-shaped thing that might be a building of some sort. Similarly, there's some little building to the south.

Again, haven't played the game recently, but to the extent of my recollection, this is a game very like Zelda. There is a map, but there's no external map mode (as with Final Fantasy IV) where you walk around. The houses are big and detailed. Maybe these tiny buildings are on the map itself, but it just kinda seems odd.

Fourthly, in the blue, we have a section from a large collection of pieces that probably would make a picture if you moved them around enough. Kind of like a jigsaw puzzle where you don't have the lid.

And lastly, in the yellow, there's stuff I'm pretty sure is just fuzz. Static. Lack of graphical information.

I guess it's a little less hopeless than staring at the Matrix screen. At least I'm getting actually pictures here and there. But still, no sprites.

InVerse 05-27-2009 11:35 AM

I found the font, but you won't be able to get to it in Tile Layer Pro, as it is stored in 1bpp Linear, which TLP doesn't support. (TLP uses 1bpp Planar, which is different. I don't know enough about the technicalities of graphics formats to actually know what that difference is, however.)

In Tile Molester (written by the same author as TLP) open up the ROM and under the View menu, select the '1bpp Linear' codec. Now hit Ctrl-G, enter 3307C as the offset and click OK. You'll see a 16x8 font and some icons. Hit Page Down and you'll see the 8x8 font.

The bit in red says "The End". Futzing around with it in Tile Molester, I can almost get the graphic completely in order. By setting Tile Molester to a Block Size of 16x3, you can clearly see that that particular graphic says The End.

I would guess that your assumptions about what you have circled in blue & yellow are correct. As for the other graphics.... It is possible that the graphical data for the maps is uncompressed while the rest of the graphics are compressed. Since you're only looking to do a translation hack (I think) then that hopefully won't be a problem. (The only time it would is if there are some signs or other graphics with text on them.)

Also, just a random note... Keep in mind that the font really is nothing more than graphics. Unlike on a web page, where text and graphics are completely separate things, in a ROM, they're identical. We just treat the text differently because that's how we're used to doing things. But a hex editor displaying the text from a ROM utilizing a table is really no different than a level editor displaying the map of a ROM.

Kilyle 05-27-2009 05:36 PM

That worked
 
1 Attachment(s)
Okay, so now I've got the font available. I'm guessing, since I don't see any digraphs, that they're definitely in the code, and thus much easier for me to mess around with once I find them.

As far as text versus graphics... are you indicating that, once I find a graphics (level) editor capable of letting me switch the graphics displayed in a given area, the task itself is no more complex than switching which letters are displayed, which I am already doing pretty easily?

As far as my table: Turns out several codes just make blocks (the block present in the font table), while a few seem to be control codes (close the window immediately, without letting me read it). But I'm finishing it up. Once I'm done, is there a place I could submit it here, in case it would be useful for others (obscure as the game may be)?

Oh, and apparently there are two distinct tables at work in this game. One for the chat text, for when you talk to people; the other for some other readable sections I've found in the code. The chat text has smalls starting at 61, caps at 81; the other had 41 (caps only... I think). Trying to put the 41-area letters into the chat codes makes blocks, punctuation, anything but letters. So I redid that area of my table.

I think I've hit on part of the table for the copyright announcement at the beginning of the game, using the 8x8 font. Not sure yet. But it's interesting.

Okay, just tried to attach a picture here... not sure how that works yet. But anyway, it's a pic of the font. And there's significant space here between the caps and the smalls, and between the 16x8 and the 8x8. Is it possible to add extra letters or symbols to this area without messing things up? How do I tell the distinction between "place I can draw" and "place I shouldn't draw" - the boundaries of the font-definition area? (I assume that once I have drawn things, I should just use the codes I've identified as "space" to see which one creates which space.)

InVerse 05-28-2009 12:28 AM

Quote:

Originally Posted by Kilyle (Post 89360)
As far as text versus graphics... are you indicating that, once I find a graphics (level) editor capable of letting me switch the graphics displayed in a given area, the task itself is no more complex than switching which letters are displayed, which I am already doing pretty easily?

Basically, what I meant was that for a game to display, say, a doorway and a game to display the letter 'A' is the exact same process. If you knew where level data was stored and what the various values were, changing that door to, say, a chair, would be pretty much identical to change the letter 'A' to the letter 'Z'. It is a bit more complex in the sense that there's generally a hell of a lot more level data than there is text data, but the process itself is identical.

Quote:

As far as my table: Turns out several codes just make blocks (the block present in the font table), while a few seem to be control codes (close the window immediately, without letting me read it). But I'm finishing it up. Once I'm done, is there a place I could submit it here, in case it would be useful for others (obscure as the game may be)?
Data Crystal has a section for posting table files. There's no listing for Sorcerer's Kingdom at the moment, but it's a wiki, so you can add a listing for any game you want. Along with the table file, I would also add the location of the text and the font.

Quote:

Oh, and apparently there are two distinct tables at work in this game. One for the chat text, for when you talk to people; the other for some other readable sections I've found in the code. The chat text has smalls starting at 61, caps at 81; the other had 41 (caps only... I think). Trying to put the 41-area letters into the chat codes makes blocks, punctuation, anything but letters. So I redid that area of my table.
It's relatively common for a game to use more than one table, especially for different sections of text. Quite often, there will be separate fonts for menus and dialogue. I've also seen many a game use a separate font for the credits of a game, even though the actual appearance of the credits font is identical to the font used in the rest of the game. As you get deeper into ROM hacking, you'll find things like this that make absolutely no sense. Experienced ROM hackers generally chalk this up to game programmers smoking a lot of crack.


Quote:

Okay, just tried to attach a picture here... not sure how that works yet. But anyway, it's a pic of the font. And there's significant space here between the caps and the smalls, and between the 16x8 and the 8x8. Is it possible to add extra letters or symbols to this area without messing things up? How do I tell the distinction between "place I can draw" and "place I shouldn't draw" - the boundaries of the font-definition area? (I assume that once I have drawn things, I should just use the codes I've identified as "space" to see which one creates which space.)
If the "significant space" you're referring to is the 5 blank spaces after the Z and z, then you should be able to use them with no problem. If you're referring to the space between the lines of letters, then probably not. (I'm pretty sure you're referring to those blank spaces after the Zs, though.) The value of the 8x16 space after the Z should be one larger than the value of Z and so forth.

As for how to tell where it's safe to draw and where it's not, you figure that out in the way you figure a lot of things out. Make a backup, try it out and if it breaks the ROM, then you know you can't use that area. :)

Without trying it, I can't say for sure, but I would venture a guess that you'll even be able to use the blank line underneath the various symbols at the bottom of your screen shot. Also, I'm going to assume (but you'll have to experiment to see) that the space in front of the capital A is the one actually used as a blank space in the game.

You seem to be making some good progress. It's nice to see someone who simultaneously asks questions while trying to figure things out on there own. That's a rarity. A lot of people want babied through the process step by step which is almost as bad, or maybe even worse, than just asking someone to all the work for them.

Maximum Potion 05-28-2009 01:36 AM

Quote:

Originally Posted by InVerse (Post 89381)
You seem to be making some good progress. It's nice to see someone who simultaneously asks questions while trying to figure things out on there own. That's a rarity. A lot of people want babied through the process step by step which is almost as bad, or maybe even worse, than just asking someone to all the work for them.

It would be cool if this thread were made into some sort of tutorial or something, or stickied as some kind of FAQ... There's alot of cool stuff that is adressed here that alot of people ask frequently on the forum.

I don't know, I was just thinking that as I read through it.

InVerse 05-28-2009 02:35 AM

Quote:

Originally Posted by Maximum Potion (Post 89383)
It would be cool if this thread were made into some sort of tutorial or something, or stickied as some kind of FAQ... There's alot of cool stuff that is adressed here that alot of people ask frequently on the forum.

I was thinking the same thing about a thread from a few months ago on a different board that's gone similarly to this one.

Quite some time ago (like, around 5 years ago) I started working on a tutorial that followed every step of a translation project I was working on. Unfortunately, it never got beyond the initial stages. I really should pick it up again.

I've also been toying with the idea of making a few YouTube videos that demonstrate the most basic of hacking skills, such as hex editing, because I'm sure several people would get a much better grasp on exactly what certain things were if they could see them, rather than just reading about them.

Kilyle 05-28-2009 06:32 AM

Next step...
 
That would definitely be useful. Sometimes it's very hard to catch a little mistake in what you're trying to do, a little way in which you misunderstood the directions. I encountered similar stuff when I tutored VB, and ended up writing a "Common Errors in Visual Basic" to pass out (in part because it seems that the teachers never approached troubleshooting until it was past the point you really needed it).

At any rate, thanks for the compliment! I'm trying hard to do this mostly on my own, because it's fun to stretch my limits a little, but it's also nice to be able to get as much personal help as I've been getting here. I have to tell you, I wasn't at all expecting this level of response.

So, what I've uncovered so far:

1. The entire table, at least for chat windows.

Interesting thing here: 02, 03, and 04 are the names of the other characters you encounter; 01, 05, and 06 are all codes for NAME (whatever name you put in for the character). Why there are three separate codes for this kind of mystifies me.

Then, code 08 says "Squire," but given the way this is used in the text, I'm assuming it gets overwritten with later titles. Otherwise "You're only a Squire, whereas I'm a Knight" and later "You really are a Squire now? How did you manage to get that high?" kind of comments don't make any sense.

I've found three codes (17, 18, 19) to pause the text for a short time before printing the next part. Again, the three-codes part mystifies me, but it's useful to have this code available. I even confirmed this usage by finding it in spots that I recall to have this kind of pausing.

Other than that:

1. A giant block that appears to contain all the text in the game, character by character.

2. A spot, roughly from 000EECD0 to 000EF140, which looks interesting because it seems a little more organized, like there's part of an alphabet there. I plan to look at this a little closer soon.

Aside from that specific section, I haven't found anything that looks like the dictionary I'm expecting to find. So I wanted to run my expectations by you to see if I'm even close.

I was expecting something like this:

Astina A st in a
Elrad E l r a d
Midi M i d i
Squire S q u i re
King K in g
monster m on st er

...that is, having the code for the full word, and then the code for the individual parts, in close proximity, and in order.

Am I barking up the wrong tree?

InVerse 05-29-2009 12:15 AM

If you want to send me a copy of your table file, I'd be willing to take a look at it and see if I can figure anything out in relation to the dictionary entries.

As for the multiple codes that appear to do the same thing... It's possible that there are minor differences that you haven't encountered yet. Maybe each one triggers something different in regards to music or portraits or any number of things that might not be present at the beginning of the game. (For instance, one RPG that I've done some preliminary hacking on contains like a dozen portraits of each character, each depicting a different mood, and there are a dozen different control codes that cause their name and one of the 12 portraits to appear.) Then again, it may not mean anything at all. (See previous reference to game programmers and crack cocaine.) At any rate, I would recommend staying with the lowest value byte until you determine what the differences (if any) are, since the lowest numbered byte is the one most likely to be "normal" if the other values do trigger some sort of change.

Not entirely sure what you're referring to about the bit that looks "a little more organized" but keep in mind that just because (for example) A=41, not all bytes with the value of 41 are going to be printing out the letter A. It's entirely common to see a spot in a ROM that says ABCDEFGHIJKLMNOPQRSTUVWXYZ in the text area, simply because some bit of data happens to have all of the values in a row. This may or may not mean anything at all. (Think about it this way... if there was a graphic that happened to take up the exact same dimensions as your alphabet, and said graphic happened to be in the same area of memory when loaded, the location where the layout of that graphic is stored in the ROM would look like ABCDEFGHIJKLMNOPQRSTUVWXYZ in the text area.)

And as for the level of response... I have a tendency towards teaching, so when someone has intelligent questions and shows initiative learning, I'm more than happy to offer as much help as possible. (Plus, if you become a master ROM hacker and decide to venture into the realm of Japanese-to-English translation, maybe you'll pick up one of the games I'm too lazy to do and then I can just play the thing instead. :D)

Kilyle 05-29-2009 12:44 AM

SorKing Table
 
1 Attachment(s)
Okay, I attached the table file. (I had to change it to a .txt file for the attachment window to accept it.)

Let's see, the "code" I used there: Mostly, if it's not an actual character that I can type, it's in parentheses. There's a list of icons with names like (swrd) and (glv) etc.; should be easy enough to figure out. For the quotes, I used _ to indicate which way they're pointing (because they're backwards from what I'd expect, and going 9B9C or 9D9E doesn't make a matching pair). The (up) and (dn) are arrows, as is (>). The tilde (~) indicates a code that produces a block; two tildes is the second type of block. There's a tiny check mark, a tiny E; I put the slash in parentheses because I read somewhere that a plain / symbol indicates a newline or something to some hex editors. The (nl) code is a newline.

There are control codes (or errors of some sort) that close the window immediately; I used ~---~ for these so they'd be obvious in the code. And if there's two question marks after anything, it's because I didn't go back and confirm it (generally because I was testing more than one code at the time).

There's a set of spaces with the code (_) to indicate that they're not the normal space used everywhere, and they're the spot I was thinking might be related to the extra spots in the font area.

Anyway, there you go.

InVerse 05-29-2009 03:10 AM

Okay... where exactly are you seeing these "dictionary" entries used? I tried using D0 (which, according to your table is the value of 'King') at a random point in the introduction but all I got were a couple of boxes.

I thought maybe they only worked in the dialogue. So I started the game up and named my character and got to the king and the first bit of dialogue, but searching in the ROM using your table, I can't seem to locate any of that dialogue. (And for a further test, I exited the castle and spoke to someone in the town, but wasn't able to find their dialogue, either.)

But then I realized that you'd clearly made too much progress on your table file to be on the wrong track, and based on the things you'd said you'd found, either I was missing something or you were hallucinating, and it seemed unlikely that you would be having completely logical hallucinations. So I scrolled through the ROM until I found the text.

And... I'd say that Reaper man's initial instincts were right and what you have is MTE, not dictionary compression. Still pretty easy to deal with. Unfortunately, I've only hacked MTE on a couple of occasions, so it's not something I can spout off instructions for from memory. And.... I can't seem to find whatever document it was that I originally learned how to hack DTE on myself. (DTE is Dual Tile Encoding, whereas MTE is Multi Tile Encoding. The difference is.... nothing, it was just originally called DTE because the first ROM anyone encountered it in (Final Fantasy II, I believe) only used 2 characters per byte. Once people started discovering ROMs that utilized more than two characters, the name was switched to MTE, but you'll still encounter old timers that use the term DTE.) Searching Google for DTE/MTE yields a bunch of documents on how to add MTE to a ROM, but nothing on how to hack existing MTE.

And then something that I saw in the ROM when I was first poking around it it comes to mind.... something that I thought I recognized but then thought I was wrong... because I was poking around in that something before finding the dialogue, and since the MTE doesn't actually work in the intro, my poking around in the other thing obviously had no affect... (Can you tell that I'm extremely tired at this point? It's not *actually* past my bedtime yet, I have another 30 minutes before I need to go to bed and still get a full night's sleep before I have to go to work in the morning, but for some reason I'm more exhausted than usual, so forgive the rambling (I realize that a good 90% of this post is going to be completely useless, but since I've now solved the problem (even though I haven't actually *revealed* the solution yet), I'm sure you'll live with it.)) (Note: Even when I'm exhausted, my grammar is still near perfect and I can properly close triple nested parentheses! Also, when I get tired, I tend to amuse myself by talking to myself in msgboard posts that are actually directed at someone else. Also, I think it's been over an hour since I started typing this reply.)

Anywayz... What we have is MTE. So... somewhere in the ROM is a table of those MTE values. What you want to do is take a fairly unique entry from your list of MTE variables (in your case, I'd recommend going with your first entry, 'King') and do a search for it in the ROM. Just do a basic text search (with your table loaded) for the word King. Nothing fancy about it at all, just the word King. In the case of your chosen game, I'm pretty sure you're going to recognize something familiar about the very first result.

Now, I can already envision certain questions you're immediately going to have. Unfortunately, I'm almost positive that there's no way my sleep starved brain is going to be able to remember the answers to them tonight. So, I'll leave you to play around with it in hopes that you'll uncover most of those answers yourself. If not, I'll try to find that aforementioned document tomorrow. Though now that I think about it, I don't think I actually was able to find that document whenever it came time for me to hack the MTE in Ultraman Ball, I think I just pestered someone (Gideon Zhi, possibly) until they explained it to me on AIM. (And, now that I think of it, maybe the document I'm thinking of never actually existed, maybe that was just an IRC conversation or messageboard post I read 10 years ago and just retconned it into being an actual tutorial.)

Wow. 7 (I suppose 8, now) paragraphs all just to state one fact. And I haven't even had a drink in several weeks. *Wanders off in the direction of his Jagermeister*

Kilyle 05-29-2009 06:42 AM

Quote:

Originally Posted by InVerse (Post 89441)
(Can you tell that I'm extremely tired at this point? ...for some reason I'm more exhausted than usual, so forgive the rambling (I realize that a good 90% of this post is going to be completely useless.... (Note: Even when I'm exhausted, my grammar is still near perfect and I can properly close triple nested parentheses! Also, when I get tired, I tend to amuse myself by talking to myself in msgboard posts that are actually directed at someone else.

Also, I think it's been over an hour since I started typing this reply.)

I sense a kindred spirit XD

Quote:

Okay... where exactly are you seeing these "dictionary" entries used? I tried using D0 (which, according to your table is the value of 'King') at a random point in the introduction but all I got were a couple of boxes.

I thought maybe they only worked in the dialogue. So I started the game up and named my character and got to the king and the first bit of dialogue, but searching in the ROM using your table, I can't seem to locate any of that dialogue. (And for a further test, I exited the castle and spoke to someone in the town, but wasn't able to find their dialogue, either.)
000F 4800, which starts with "You do not have a conquest marker" - what the guards say if you talk with them right after exiting the King's throne room (the moment you first get control of your character).

The guys I've been using to test my table are: the little girl running around (000F 67F0; she says they can't play on the hill anymore since monsters moved in), the kids' mother (000F 6420; she says pretty much the same thing), and the guards (000F 4800). They're right next to where you start.

Note: I've located things said in the throne room, and IIRC that included the intro of the King going "Yeah, okay, you can be an adventurer, get to it" (not in those words, of course), but I don't think I've located the game's intro, where it says stuff about your father Kanan and how you want to follow in his footsteps and whatnot. Since that's put in the middle of the screen instead of in a dialogue box, it might be a different font or table (etc.), so I haven't been too worried about finding it (yet).

Quote:

What we have is MTE. So... somewhere in the ROM is a table of those MTE values. What you want to do is take a fairly unique entry from your list of MTE variables (in your case, I'd recommend going with your first entry, 'King') and do a search for it in the ROM. Just do a basic text search (with your table loaded) for the word King. Nothing fancy about it at all, just the word King. In the case of your chosen game, I'm pretty sure you're going to recognize something familiar about the very first result.
I got this, at 0000 EFD0:

King monster the and you have a to ing ill an in on is er re ou st th he me en ed be e t s d y I the

Oddly enough, that looks like all the multi-character values I have on my chart. So I think we found the right spot.

Question is, what to do with it? Hmm hmm hmm.

Pattern-wise, I see that they've put the letters up, together with any spaces, between 00's. That... doesn't tell me much.

Should I be scanning through it with Tile Molester now, or is there more code stuff to be done first?

Quote:

(And, now that I think of it, maybe the document I'm thinking of never actually existed, maybe that was just an IRC conversation or messageboard post I read 10 years ago and just retconned it into being an actual tutorial.)
Did I tell you I sensed a kindred spirit? :D

EDIT: I just found this, seconds after I made my last reply:

The intro: 0001 A030, starting "For ages, the crown has been held". Done entirely in single-letter text, without any of the MTE's, apparently. Followed shortly by "Astina joined" then "Elrad" and "Midi" and then the names of several enemies (Bugbear, Goblin, etc.). A quick search also turns up "Elrad joined" and "Midi joined" in different spots.

Oh, also found 0001 F4A0, where the tables of character titles and spells are stored.

Also, Reaper man, I have to apologize. I made the same mistake with you that I just almost made with InVerse here:

You say "do a search for King" and I think "okay, King means D0, so... that's like everywhere in the entire game, and you're asking me to hunt through every single entry - it's like asking me to look for the word "the" in War and Peace!" But in fact you both meant "find the string K-i-n-g, which has four hex values totally different from D0" and it took me a while to realize that.

But once I got past that mental block: Instant results! So thank you both for being patient with me :)

InVerse 05-29-2009 12:02 PM

Quote:

Originally Posted by Kilyle (Post 89447)
I got this, at 0000 EFD0:

King monster the and you have a to ing ill an in on is er re ou st th he me en ed be e t s d y I the

Oddly enough, that looks like all the multi-character values I have on my chart. So I think we found the right spot.

Question is, what to do with it? Hmm hmm hmm.

Pattern-wise, I see that they've put the letters up, together with any spaces, between 00's. That... doesn't tell me much.

Should I be scanning through it with Tile Molester now, or is there more code stuff to be done first?

Edit one of those and then insert the value into an easily accessible text block and you'll see that editing that table you found (in this case, by table, I'm referring to the table that lists all of the words assigned to individual byte values) will change the text in the game. (For instance, I randomly changed one byte in the girl's text to D0, which printed out the word 'King' in place of one letter of her original text. Then I edited the word 'King' in the aforementioned table and changed it to 'Ring', loaded up the game again and lo-and-behold, the girl was now saying Ring instead of King.

Depending on how the game is coded, you may simply be able to short/lengthen the words used, as long as you don't use more total space than already allotted to the entire table and place a 00 between each word. If that doesn't work, then there is likely a pointer table that specifies the length of each word.

To learn about pointers, your best bet is probably The Mad Hacker's Guide to Pointers which is horribly formatted and really old yet still contains valid, useful information. I've been meaning to write an updated pointer guide, but haven't gotten around to doing so yet. But, basically, play around with that MTE table and see what happens.

Kilyle 05-29-2009 02:55 PM

Update
 
Well, that was an interesting experiment.

I changed "King" to "Butler" and "monster" to "alien", stuck 00's between them to separate them, and made sure the girl was talking about monsters/aliens.

I then played the game.

The King is now the Butler, and does things in the name of the Butler, and asks me to save the Butlerdom (a bit I knew was coming).

The girl says her line, then the second line of her text starts shifting through all the code of the game from "aliens" onward, interpreting it as text code. All the extra words in the dictionary, then various symbols and those funny blocks. One line displayed, then overwritten with another line, infinite loop until something I'm sure would go horribly wrong, so I stopped it.

I take it the pointers is something I must now embrace (unless I decide to limit myself to words only as long as those already there).

Next thing I'm thinking of trying, though, is the use of dictionary elements within dictionary elements. I mean, if I can define "ut" and "er" before I go defining "King" as "Butler" then I might still be able to make a four-letter definition....

ETA: I made a switch that left "aliens" fine yet left "King" one letter bigger than normal. It stopped the "overwriting text" error but I don't know if this will have other errors.

The thing is, the dictionary used to be this: King 00 00 monster

I had changed it to this: Butler 00 alien

Now I've changed it to this: Butle 00 alien 00

So... I guess the game has problems if it meant to point to a string but ends up pointing at a 00. I'm assuming from that Pointers guide that this means "Sequential Pointers" (the kind you say to run away from) but that's just a hunch from the behavior of the game.

Anyway, as regards the Pointers guide: What to change if it's not NES? Do I still account for a header, and if so, of the same size? Do the pointer addresses work in the same fashion as the NES ones? Or are we back to "experiment until you stop messing things up"? (I'm not against that, but information is usually a plus.)

ETA: Wow. This has got to be the coolest first choice in hacking projects EVAR.

'Cuz apparently the pointers are the hex values, no tinkering needed.

And they're like five lines above the dictionary anyway.

I am so hyped.

InVerse 05-29-2009 11:51 PM

Quote:

Originally Posted by Kilyle (Post 89456)
Anyway, as regards the Pointers guide: What to change if it's not NES? Do I still account for a header, and if so, of the same size? Do the pointer addresses work in the same fashion as the NES ones? Or are we back to "experiment until you stop messing things up"? (I'm not against that, but information is usually a plus.)

ETA: Wow. This has got to be the coolest first choice in hacking projects EVAR.

'Cuz apparently the pointers are the hex values, no tinkering needed.

And they're like five lines above the dictionary anyway.

I am so hyped.

In regards to Genesis pointers, I don't believe Genesis ROMs have headers (or, perhaps, all Genesis ROMs have headers) so you shouldn't have to do any calculations, as evidenced by the fact that you've already found the pointers. I think it's routine for the pointers to a MTE table to appear shortly before the table itself (at least, the two times I've hacked MTE, that's how it appeared) but for standard text pointers, they could be shortly before the main text block, shortly after the main text block or scrambled all to hell and back. (The original Dragon Ball game for NES has pointers that are about as organized as an earthquake. Oftentimes, pointers for two lines of text that are on the same screen may 50 lines apart.)

Congrats on finding the pointers so easily, a lot of people have trouble with pointers when they first start trying to hack them.

If you need any additional suggestions over the weekend, I may be a bit slow in replying. I have an 8 hour drive to a wrestling show tomorrow and an 8 hour drive home on Sunday, so my access to the Internet may be a bit erratic. (But I'll be bringing my laptop and it seems like even McDonalds offers free wireless Internet these days.)

One question, though... You're making a lot of progress in figuring out how the game works, but do you have any particular goal in mind for once you've got the system under your control? (Not that it's really necessary, hacking for the sake of hacking is a very honorable undertaking, and fully documenting a ROM can payoff handily when someone else uses your information to create their own ROM hack that you can enjoy.)

Kilyle 05-30-2009 01:18 AM

Quite the question, that....
 
Actually, although I tested some of the NES-style techniques for pointers, I ended up finding the Genesis key ("don't mess with it, just look for it" advice) on a forum in a quick search. So no extra points there (except perhaps for search-fu).

As to goals... well, after I finally got all this power in my hands, I totally blanked on what to do with it. I was thinking of doing an English-only hack of some sort before moving in to the translations I was thinking of (since Spanish, Esperanto, and Norwegian all require me to craft new letters, thus spending more time figuring out how to use those extra spaces). Whether I actually complete any hack... who knows?

I think it'd be cool to see someone else take up this project thanks to the info I provide. I don't think this game has gotten the press it ought to have gotten (possibly because of the name trouble, possibly because the translation to English is a bit flawed... who knows). It's got fun mechanics as far as combat.

Anyhoo... yeah, the basic idea was to figure out how to hack. I lucked out to get an easy game and competent and willing help right off the bat. I think the knowledge I gleaned from this little journey will help me program in the future, but as yet I'm not sure how.

If I end up continuing to hack ROMs (which seems likely), I'll be moving toward some translations of Dragon Warriors III and IV and Ultima: Quest of the Avatar (NES version), and perhaps some other games that I think get a little overlooked in the retro-gaming world.

Anyway, yeah, have a great weekend and thank you greatly for the help! I'll try to remember to come back and tell you how far I get :D

InVerse 05-30-2009 01:45 AM

Once you figure most everything out, I would suggest dumping the script, making some major edits (they don't have to be *meaningful*, just fairly extensive in scope), and then reinserting the script. This will give you good practice with two of the most fundamental skills in ROM translation. (One of which I have absolutely no experience in myself. I tend to dump the script, send it to the translator, and then manually type the entire thing back into the ROM. Of course, I've never done anything with more than a moderate amount of text, either.)

Something else you could consider, figuring out how the maps are laid out. With this information, you could not only modify the text, but also the entire layout of the game, which would pretty much allow you to make an entirely new story from the original.

Or if you don't think the translation is up to snuff, try dumping the script from the Japanese version, having someone retranslate it and then re-insert it. Or you could just do a rewrite of the script without actually retranslating it and just call it an enhanced version. I've contemplated doing this for a few games.

Incidentally, someone recently released a text editor specifically for Dragon Warrior IV, so if you were interested in translating that, it would be extremely easy to do. Not sure what there is for DWIII and I think we already established that U:QotA has at least a compressed font. You know, I really need to play DWIII and IV some day... I've literally beaten Dragon Warrior over a dozen times, once without using my hands or feet (I was sick one day and just kind of laid in bed and worked the controller with my face and decided to beat the entire game that way) and once without using any weapons whatsoever. (Yes, you have to find Erdrick's Sword in order to defeat the Dragon Lord, but you don't actually have to KEEP it. I found it, sold it for 1GP and was able to damage the Dragon Lord with my bare hands (and copious amounts of Fireball.)

I got to the final boss on Dragon Warrior II, died and never bothered to go through the dungeon again (this was on a real cart, no save states) but since then, I haven't really played any DW games. I think I beat the first 2 chapters of IV, not sure if I've ever even played III and I started a game of V but never got very far in it.

I *do* have a hack of Dragon Warrior in which the main character is wearing a Ku Klux Klan robe. I had an idea to make a racism-based hack (which is not the same as a racist hack) but never got around to fleshing it out. Also, someone should do some sort of hack of Brain Lord which is an Enix adventure/action-rpg which isn't actually related to Dragon Warrior/Quest but does feature Dragon Warriors (and that's what they're called.) Awesome little obscure game that I never would have encountered were it not for emulation.

Kilyle 05-31-2009 12:01 AM

Impressive
 
Quote:

Originally Posted by InVerse (Post 89487)
Once you figure most everything out, I would suggest dumping the script, making some major edits (they don't have to be *meaningful*, just fairly extensive in scope), and then reinserting the script. This will give you good practice with two of the most fundamental skills in ROM translation. (One of which I have absolutely no experience in myself. I tend to dump the script, send it to the translator, and then manually type the entire thing back into the ROM. Of course, I've never done anything with more than a moderate amount of text, either.)

I think this is a good idea. I have been manually editing each letter, which is starting to make me a bit faster when it comes typing in certain letters, but still is inefficient. So... what's the first step on script dumping? (I'll be hunting down info on this subject when I get a chance, but right now it's the weekend and I'll be heading out soon for a picnic with my nephew, so no time to get my own info right now.)

ETA: I should say, regarding script re-insertion: How do I account for digraphs? I mean, the vague idea I have about how this might work is a program that makes a 1-to-1 transfer. So if I had the word "greener" in the text, and it happened to be in the ROM using only 4 values (g re en er), wouldn't the insertion routine try to put it back in using 7?

Quote:

Something else you could consider, figuring out how the maps are laid out. With this information, you could not only modify the text, but also the entire layout of the game, which would pretty much allow you to make an entirely new story from the original.
I would definitely like to do this. I have considered making a version based on Prince Camaralzaman and Princess Badoura, one of my favorite Arabian Nights, but with the character of Marzavan as the lead (hunting for the other two). But I'd have to change and/or rearrange the graphics significantly to do this.

I haven't actually found the Japanese version of the game. My "bad translation" line comes from such things as poor punctuation (extra commas, lines that end in comma and period, etc.) and odd phrasings. Maybe I should look for the original.

Quote:

Incidentally, someone recently released a text editor specifically for Dragon Warrior IV, so if you were interested in translating that, it would be extremely easy to do.
Thanks for the info! That'll be a big help.

Quote:

You know, I really need to play DWIII and IV some day...
Yes. I consider them very good, fairly replayable games. I definitely prefer the "retro" versions to the "updated" versions... I think the old graphics look far better than the bigger, more detailed graphics, when each is judged by the possibilities of their medium. If you haven't played DWIV to at least the end of Taloon's chapter, I think you've missed one of the coolest sequences in that style of game ever.

Quote:

I had an idea to make a racism-based hack (which is not the same as a racist hack) but never got around to fleshing it out.
I think that would be very cool. I would love to play it. I think that racism in a fantasy medium offers excellent possibilities for exploring the subject apart from the defenses that get raised when you directly deal with it in a real-world setting.

I have considered doing something within some interactive medium, in which you first encounter goblins who are trying to kill or rob you, and kill them - and then, later, get the choice of whether or not to kill these other goblins, and it turns into a discussion of whether the actions of a few are enough to condemn the rest. (You wouldn't kill all humans just because a couple mugged you.)

If that scenario appeals to you at all, go ahead and use it. I probably won't be using it for ages anyway.


All times are GMT. The time now is 01:31 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.