Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Tomato on July 31, 2014, 12:05:20 pm

Title: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Tomato on July 31, 2014, 12:05:20 pm
I've been dabbling with some neat FF6-related hacking lately (and even been live-translating a Japanese hack here: https://www.youtube.com/watch?v=1JR12t_v8ug&list=PL8fufren85t94MkcXjmHHj7PkKiAaGA12 ) and hit a little snag that I'm hoping someone can help me out with.

Basically, I'd like to know - by checking RAM or the stack or something - if the game is in a battle or not at any given time. I assume there must be at least a few addresses that reliably change depending on if the game is in battle mode, walking-around mode, etc. If anyone has any tips, please let me know!
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: FAST6191 on July 31, 2014, 01:57:09 pm
If someone has a specific response then so be it, however it looks like you have answered your own question. Generally people either try for an edge case (in battle it has to have enemies therefore check for their health or something) or a proper one (in battle there will be a flag in memory to indicate it), the latter is better but can be harder to find than the former.

What I am mainly here to say though is perhaps consider also looking at the battle function. Most of the time it is random numbers or a timer (or a randomly created timer), maybe with a safe zone, maybe also with on map/boss type checks. That way you can also do enemy ward items and more subtle things.
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Lenophis on July 31, 2014, 02:01:57 pm
7E/1500 is the NMI address the game jumps to. So far this is the only way I've been able to reliably detect if you're in battle or not. If #$C10BA7 is held there, you're in battle. :thumbsup:
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Celice on July 31, 2014, 05:31:31 pm
By live translating... are you actually working on a patch? My brother would love to try this out in English  :beer:
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Gideon Zhi on July 31, 2014, 05:47:36 pm
By live translating... are you actually working on a patch? My brother would love to try this out in English  :beer:

I wonder how hard it would be to get it to coexist with the RPGOne translation?
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Tomato on July 31, 2014, 06:27:36 pm
Thanks FAST6191 and Lenophis, I'll look into that later when I get a chance. It's a slightly strange thing I'm working on, but it's pretty neat.

Celice: By live-translating I mean live, out-loud, as stuff happens. Although for this FFVI stuff I usually only live-translate new events and text.
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Grimoire LD on July 31, 2014, 09:41:02 pm
Oh my goodness it's Mato of Legends of Localization! And you're tackling FFVI-T, eh? The videos I've seen of it make it seem quite interesting and to have a professional translator such as yourself on the case fills me with hope that we might actually see some sort of English translation!
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Tomato on August 02, 2014, 03:41:21 am
For reference/enjoyment, here's the thing I was playing with - this is just a rough proof-of-concept but it's pretty neat and could make any Japanese games I play on stream more understandable/interesting  :woot!:

https://www.youtube.com/watch?v=f_T9tit1Bdc&list=PL8fufren85t94MkcXjmHHj7PkKiAaGA12&index=51
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: KingMike on August 02, 2014, 12:02:13 pm
Final Fantasy VI Ted-ition? I thought that was the first version I played! ;D
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Celice on August 02, 2014, 03:23:57 pm
I wonder how hard it would be to get it to coexist with the RPGOne translation?
I'd love to see someone take a look at it. There's lots of interesting and cool hacks for big RPGs from Japan, like for Final Fantasy, Fire Emblem, Romancing Saga, etc. (I think they're commonly called remodelings?), that international fans would really get a kick outta playing, if only for the language barriers...

I was pretty stoked when the FFV 100 floor dungeon hack got some translated attention a year or so back. I still need to play it :)
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: Tomato on August 08, 2014, 12:01:18 pm
Lenophis: Thanks for that RAM tip, that seems to be working like a charm! Before I had to do some wonky checks so this is much nicer :D

----

Anyway, I've been racking my brain trying to figure out how to tell when there's a menu on top of the enemy name box or not - here's an example:

https://www.youtube.com/watch?v=6EGY9uJ_WCs#t=960

Quick pic:

(http://tomato.fobby.net/junk/ff6ennames.png)

As you can see, I still have it print the enemy names even when other menus are on top of the names in the game - I'd like to be able to hide the names when the names are obscured. I've tried messing with the VRAM stuff to check when tiles are covered up, but it doesn't work the way I expected it. Instead, it looks like some sort of literal layering is happening, although not on the normal BG1/BG2/BG3/BG4 type of level. I'm not sure how the battle menu display system works, and I've tried fiddling with the data in $8991 but it seems unrelated to what I'm going for. I would think the relevant data would be nearby though.

If anyone can help, I'd be super grateful! I also need to share some of my own RAM findings sometime.
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Midna on August 09, 2014, 01:57:27 am
I noticed you translated that enemy's name as "Mind Flare". Unless that was intentional, it should probably be "Mind Flayer", which is a monster from D&D.
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Tomato on August 09, 2014, 02:05:28 am
You're right. I flew through the text file super-fast and without too much worry about errors, so I'll fix that even though we probably won't see it again.
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: KingMike on August 10, 2014, 01:56:17 am
As you can see, I still have it print the enemy names even when other menus are on top of the names in the game - I'd like to be able to hide the names when the names are obscured. I've tried messing with the VRAM stuff to check when tiles are covered up, but it doesn't work the way I expected it. Instead, it looks like some sort of literal layering is happening, although not on the normal BG1/BG2/BG3/BG4 type of level. I'm not sure how the battle menu display system works, and I've tried fiddling with the data in $8991 but it seems unrelated to what I'm going for. I would think the relevant data would be nearby though.

If anyone can help, I'd be super grateful! I also need to share some of my own RAM findings sometime.

Kind of a wonky workaround but maybe while the hand cursor sprite is present, assume menu open and names probably hidden.
The only case I think of that it might not be true is the Roulette spell.
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Lenophis on August 10, 2014, 02:23:48 am
Unfortunately, this involves bank C1 which is a complete nightmare to even try to understand. I don't know where to begin to try and figure this one out. :'(
Title: Re: Final Fantasy VI/III RAM and knowing if you're in battle
Post by: STARWIN on August 11, 2014, 10:26:53 am
As you can see, I still have it print the enemy names even when other menus are on top of the names in the game - I'd like to be able to hide the names when the names are obscured.

Sounds like an easy problem. Also very precise. I like this sort of stuff.

2 bytes at RAM 7E0318-9 seem to be set E0 E0 when you want to print the enemy name. Not frame-perfect, but roughly. Try adding that condition. I only checked it in some early magitek armor battle. If it doesn't work, I can take another look.

So you are making the hacking more convenient by only reading the hard stuff and doing output at some simpler level? And the price is that you won't be able to easily remove the existing text/graphics underneath?
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Tomato on August 11, 2014, 12:58:33 pm
Whoa, thanks, that seems to work perfectly! I spent so much time on trying to figure it out that I was even trying to mess with VRAM data to little avail. How did you find it? I'm still pretty new to SNES RAM hacking stuff so I'm not sure what the best tools are to use.

My initial goal was to just play through this Japanese hack on stream and live translate the new event text as I came across it. But then the hacker side of me was like, "You know, I could probably display a bunch of supplemental material live on the stream too (as an overlay) and it wouldn't be as involved as a full ROM hack." So this is more or less a RAM hack/RAM displayer for my stream. I'm hoping to do stuff like this with other games too, especially with games that haven't gotten full ROM translations before.

I actually realized that I could probably partially apply my text to the ROM that's in the emulator's memory and then save that version of the ROM to a file to create a rudimentary menu hack, but it would probably be pretty lackluster. In any case, once I get a few more things squared away I'll probably share my translation text files for anyone who wants to try to do an actual ROM hack of this hack.
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: STARWIN on August 11, 2014, 02:12:04 pm
I'm also new in the sense that I haven't done much hacking. Or lazy.

Just like FCEUX has (or one of its versions at least had) a Hex Editor, Geiger's debugger has a "Show Hex" button. Let it show RAM. Many kinds of useful RAM bytes can be identified just by visually inspecting the game state while the game is running (the hex view changes in realtime). In this case I went to battle to do stuff and noticed that these particular bytes change in the desired way. Practically all game state has to be in RAM, so it has to contain answers to all questions whose answers vary in time.

Sometimes I have also done RAM dumps with a set of dumps in condition1 and the rest in condition2, and used vbindiff to compare them (again, visually). Technically it might make sense to make a program that figures out the desired bytes from such dumps, but I haven't yet had any situations where I couldn't just figure out things manually.

I don't know how you made that RAM read -> overlay output thing, but even if you consider it much cruder than a properly done translation, it might be that in some cases it is the most probable way to translate something. Identifying bytes is definitely much easier than doing rest of the hacking.
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Celice on August 28, 2014, 08:17:11 pm
Did anyone have any potential interest in translating this hack for the community? My brother's condition is worsening, and he's getting severely depressed. He just got a tracheotomy and is unable to speak right now, and is essentially paralyzed. I am willing to donate some money if it will help someone take a look at the hack. I think my brother would really enjoy playing something like this when he gets back from the hospital.

Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Tomato on August 29, 2014, 08:37:48 am
A couple fellow hackers who've been hanging out in the stream lately have started look into it, but I imagine it'd be an incredibly difficult, time-consuming task. If anyone does take up the challenge, though, I can share some of the really rough item/enemy/attack translations I've been using for my stream.
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Celice on August 30, 2014, 06:00:46 pm
I'm really glad to hear that. Thanks for sharing. I haven't been able to catch any of your streams live but I try and watch some of the reups on Youtube when I get a chance.
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: Tomato on September 22, 2014, 02:11:09 pm
The other day I finally finished playing through Final Fantasy VI T-Edition - it was an amazing hack, and it was cool having a lot of fellow ROM hackers from RHDN and elsewhere in the chat over the weeks and months!

If you missed any of it, it's all up on YouTube here - it's well over 100 hours of Final Fantasy VI goodness:

https://www.youtube.com/playlist?list=PL8fufren85t94MkcXjmHHj7PkKiAaGA12

Also, thanks to everyone who helped with the RAM hacking stuff - it made the playthrough a lot more fun and informative!
Title: Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
Post by: dn on September 22, 2014, 03:32:18 pm
I looked into translating it myself. The hack has changed immense amounts of code, moving a lot of things around and doing things no previous hack has done like expanding the inventory and monster list. I was hoping to simply insert ChrisRPG's work, but that isn't happening. It's going to be a job and a half just getting the menu working properly, and I don't have enough knowledge of the game (especially the Japanese version) to pull it off from scratch.