News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions  (Read 5837 times)

Tomato

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Legends of Localization
Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« 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!
« Last Edit: August 08, 2014, 12:02:01 pm by Tomato »

FAST6191

  • Hero Member
  • *****
  • Posts: 2554
    • View Profile
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #1 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.

Lenophis

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 959
  • The return of the sombrero!
    • View Profile
    • Slick Productions
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #2 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:


https://ff6randomizer.codeplex.com/ - Randomize your FF6 experience!

Celice

  • Hero Member
  • *****
  • Posts: 622
    • View Profile
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #3 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:

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3502
    • View Profile
    • Aeon Genesis
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #4 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?

Tomato

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Legends of Localization
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #5 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.

Grimoire LD

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #6 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!

Tomato

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Legends of Localization
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #7 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

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6882
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #8 on: August 02, 2014, 12:02:13 pm »
Final Fantasy VI Ted-ition? I thought that was the first version I played! ;D
"My watch says 30 chickens" Google, 2018

Celice

  • Hero Member
  • *****
  • Posts: 622
    • View Profile
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #9 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 :)

Tomato

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Legends of Localization
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #10 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:



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.

Midna

  • Hero Member
  • *****
  • Posts: 703
  • Resident Panel de Pon Nut
    • View Profile
Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« Reply #11 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.

Tomato

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Legends of Localization
Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« Reply #12 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.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6882
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #13 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.
"My watch says 30 chickens" Google, 2018

Lenophis

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 959
  • The return of the sombrero!
    • View Profile
    • Slick Productions
Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« Reply #14 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. :'(


https://ff6randomizer.codeplex.com/ - Randomize your FF6 experience!

STARWIN

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: Final Fantasy VI/III RAM and knowing if you're in battle
« Reply #15 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?

Tomato

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Legends of Localization
Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« Reply #16 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.

STARWIN

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« Reply #17 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.

Celice

  • Hero Member
  • *****
  • Posts: 622
    • View Profile
Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« Reply #18 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.


Tomato

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Legends of Localization
Re: Final Fantasy VI/III RAM Hackery Voodoo Magic Questions
« Reply #19 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.