Author Topic: Developing FF4kster: a comprehensive editor for FF4  (Read 245911 times)

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #555 on: December 02, 2013, 04:36:06 PM »
Thanks! Glad you're enjoying it! And yeah, the NPC sets of some of the maps are messed up; that's not an issue with the editor, that's actually how they're stored in the ROM. There are a lot of things about this game that are coded/stored strangely, some of which are easier to hide from the user than others.

Well of course I'm enjoying it. I too come from the old gang of Game Genie dreamers. I remember years ago thinking I'd have to do things just with a hex editor before I found all this information out there. It was then that I took my "first step into a larger world."  This editor, the site and all the other tools I've found are a dream come true for me. :happy:

I'm also glad that I bet right. (With myself at least) I had my money on you and FF4kster; as I said your editor is right way-way too often for it to be an accident so I blamed the ROM - it had to be some kind of exception.  :finger:

I don't have much in the way of overworld triggers to add but I did mess around with the call for the Damcyan bombing. What I found was first the call checking if the flag for the bombing (Flag 20) is set:

4A/C504:   AD8212             LDA $1282
4A/C507:   2910                 AND #$10

& the code that stores the status of that flag (& others):

40/6F42:   A63D                LDX $3D
40/6F44:   1D8012             ORA $1280,X
40/6F47:   9D8012             STA $1280,X

Where the above are from a 1.0 ROM with DisPel's Offsetting - Geiger's Output for the last line being:

$00/F147 9D 80 12    STA $1280,x[$00:1282]   A:0010 X:0002 Y:0000

This is also applicable for storing the flag for Mist (Flag 14 @ $1281). Curiously the Mist flag is set to check against #$40 whereas the Damcyan flag is matched against #$10 - but I'll say (for now at least) that there is a method to their madness. The punch line is that like the Mist flag the Damcyan flag seems to be referenced at every loading - but I still don't know how it knows that at X:119 Y:62 to call the event code for Damcyan if Flag 20 is not set. I'm still investigating this but I didn't think it would hurt to share what I have so far. Good luck!
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #556 on: December 02, 2013, 10:59:30 PM »
Very good finds LordGarmonde! I believe Chillyfeez actually located that missing piece a while back. The Trigger events for the Overworld are not in the editor yet, but Chillyfeez figured them out quite some time ago.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #557 on: December 02, 2013, 11:57:37 PM »
Very good finds LordGarmonde! I believe Chillyfeez actually located that missing piece a while back. The Trigger events for the Overworld are not in the editor yet, but Chillyfeez figured them out quite some time ago.

Good deal; thanks Grimoire! I think I found the post here: http://slickproductions.org/forum/index.php?topic=1769.0 (Nice work Chillyfeez!)

I'll definitely make use of this. I had been thinking about reworking the ship at Fabul; or more specifically hijacking the event call for my own twisted means.  :laugh:

I was thinking instead of of physically boarding the ship instead setting things up so you go talk to Sheila and she gives you the Yes/No about leaving - and then from there having it load the ship/good bye scene - leaving the actual world map trigger free and clear. (Thoughts?) Of course I'll just need to remember to not have it removed by the event flag; I'm writing in the post now so I won't forget later!  :finger:

I was going through some of the older posts (and how I missed that one from Chillyfeez: "the world may never know") and I've come to the conclusion that you & Chillyfeez are both black belts in Assembly. I was wondering if either of you (or anyone of course!) have any suggestions as to blank spots in the code that are good or bad for writing in a subroutine? The one I wrote for Mist (my first Assembly routine ever!) is as follows:

0000:FAD9 22 04 80 1D  jsl 1D8004   (Originally jsl 15C6FA - replaced with my call)

-- My Code --

001D:8004 22 FA C6 15  jsl 15C6FA   (First execute the original modification routine)
001D:8008 AD 81 12      lda 1281      (Check For Mist Flag)
001D:800B 29 40           and #40      ($1281 = 40 => Set)
001D:800D F0 0E           beq 801D    (If Yes - Execute my code, Else Return)
001D:800F A9 01           lda #01      (Load New Tile Value #01 Chosen for Testing)
001D:8011 8F D4 92 7F  sta 7F92D4  (Overwrite address with new value)
001D:8015 8F D4 93 7F  sta 7F93D4  (Overwrite address with new value)
001D:8019 8F D4 94 7F  sta 7F94D4  (Overwrite address with new value)
001D:801D 6B               rtl              (Return Long)

So as you can see it replaces the original subroutine call with one way out in the middle of nowhere - then runs the code as originally written after which my changes are tacked on. As expected there was a slight delay when called - it's quite the trip - but it does its job. I haven't gone into the ROM too much to see where the dead-zones are but I'm happy to hear anything y'all have to tell me. My ambition (bar set high for me) is to strip equipment before character departure; in my mind at least I feel it may be frustrating to play a hack that changes the character line up as well as the joining/leaving times. But that's probably a ways off; there are other things to explore in the meantime. Until then let me say looking back at some of your earlier posts: you guys are good! :cycle:

« Last Edit: December 04, 2013, 02:36:58 PM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #558 on: December 03, 2013, 05:01:22 PM »
That is a good idea with Fabul's ship, but also keep in mind that Chillyfeez found that there's entrances to the Tower of Babil on the Overworld, they could probably also be replaced to use another event.

Chillyfeez is probably more talented than me. My skills are more about recording, observing, and identifying than they are anything else. Granted I can make a good ASM hack or two.

I've never had any luck finding empty space, (granted I've never really looked) but I do know that Chillyfeez has found some areas that are vacant.

I forgot to mention that I love your idea to put the equipment of leaving characters into the Fat Chocobo Storage as it feels much more legitimate than losing that equipment forever and it also doesn't run the risk of filling up your own inventory.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,266
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #559 on: December 03, 2013, 07:00:55 PM »
Aw, shucks, you guys...
But seriously, that goes back to what I said earlier about this being a great forum to bounce around ideas and grow ROM hacking skill.
When I decided about a year and a half ago that I would try hacking FFIV, my only ROM hacking experience was a graphical mod of the original Zelda I did about fifteen years ago (now lost in time). I had no clue the things we're doing now were even possible, let alone the fact that I would be discovering new ways to do them.
That being said, wait til you see the latest evil genius piece of crazy I've been cooking up. I'm working on a playable preview of my "big project," now that I've got the characters all created and a working idea of the full plot, it seems like the next logical step - who knows when I'll actually finish the whole thing, but there's a bunch of stuff I'm doing that I want to showcase. Primarily, I've sort of made the battle system my bitch, including new commands to replace some of the more useless old ones, and... character-specific limit breaks.
I'm still probably a few weeks away from where it's polished enough to post, so if I seem less active you'll know why... also, this is the busy season for me at work, so that isn't helping to move things along.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #560 on: December 03, 2013, 08:22:49 PM »
Now this sounds like a great Mod Chillyfeez! I can't wait to hear more information about this!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #561 on: December 03, 2013, 08:55:16 PM »
Now this sounds like a great Mod Chillyfeez! I can't wait to hear more information about this!

Seconded!  :terrydia:
"Now I know; and knowing makes it even more confusing..."

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #562 on: December 07, 2013, 05:25:12 AM »
Something rather screwy is going on with Cry.

Oh, that's why. Alright, here's what's wrong with this...

The description of it is a little vague...

"Set Target's X to half its X"

It should read something more akin to...

"Subtract Target's X from half of User's Y"

Also again, I wasn't clear with the Store bytes, so changing those two alone wouldn't change anything but the foe's Steal Evade value. Here is what you need to add to that...

0x1EB16 (without header) 9D 2F 20   STA $202F,x[$7E:22AF]   A:0069   X:0280   Y:0000   P:envMxdizC - Store A in Monster's Steal Prevention.

And that should fix that.

I'm afraid I'm more confused now than I was before...

"Subtract target's X from half of user's Y" doesn't make any logical sense to me. It almost sounds like "User.Y = (User.Y / 2) - Target.X" but that can't be right... surely it's the target's stat value that's being changed here right? So it should be Target.X = something. For example, could you mean this:

Target.X = Target.X - (User.Y / 2)

So something like "Subtract half of User's Y from Target's X"?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #563 on: December 07, 2013, 09:40:15 PM »
Yes, the way you have put in Target's X = Target's X - (User's Y/2) is a much more readable way to read it.  Eh heh, sorry syntax of this sort isn't really a strength of mine.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #564 on: December 08, 2013, 03:34:02 AM »
Yes, the way you have put in Target's X = Target's X - (User's Y/2) is a much more readable way to read it.  Eh heh, sorry syntax of this sort isn't really a strength of mine.

Not a problem. I can usually get what you mean, just English can be a bit ambiguous by its very nature sometimes. With mathematics there's usually only one way to interpret it. ^_^

Anyway, updated again with fixes to Boast and Cry.

Next step is reading/displaying tile graphics. I have to revisit all those graphics tutorials again now, because it's been that long since I did anything graphic related...  :blits:
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #565 on: December 08, 2013, 11:32:49 AM »
Tiles and Graphics, oy that sounds like a tricky portion to implement. Unfortunately when it comes to graphical representations I can't make much heads or tails of it. Chillyfeez might know a bit more about it though.

Hmm, Boast is still screwed up and still writes to the Slot of the Character that immediately is after the User. Did you change it from a base 80 back to 00?  80 is only meant to be used if its being written to the 2680-2780 portion of RAM (commands generally don't use that unless they're accessing Magic or Fight Routines) and that's only when its hitting a target rather than self in such a case.

Also it seems the options for Cry are completely gone in this version.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,266
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #566 on: December 08, 2013, 04:18:02 PM »
Tiles and Graphics, oy that sounds like a tricky portion to implement. Unfortunately when it comes to graphical representations I can't make much heads or tails of it. Chillyfeez might know a bit more about it though.
I've done quite a bit of messing around with the game's graphics, so I'm pretty familiar with where graphical data is located and how to manipulate Tile Layer to edit the data, but if you need info on how SNES interprets graphical data, that's a bit outside my scope of knowledge. Still, if there's anything I can help with, as always lemme know.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #567 on: December 08, 2013, 07:07:32 PM »
Hmm, Boast is still screwed up and still writes to the Slot of the Character that immediately is after the User. Did you change it from a base 80 back to 00?  80 is only meant to be used if its being written to the 2680-2780 portion of RAM (commands generally don't use that unless they're accessing Magic or Fight Routines) and that's only when its hitting a target rather than self in such a case.

Also it seems the options for Cry are completely gone in this version.

Cry has options on mine. I suspect I may have compiled the executable for the Windows version and forgotten to add it to the zip. Try it again now and let me know if the problems persist.

I've done quite a bit of messing around with the game's graphics, so I'm pretty familiar with where graphical data is located and how to manipulate Tile Layer to edit the data, but if you need info on how SNES interprets graphical data, that's a bit outside my scope of knowledge. Still, if there's anything I can help with, as always lemme know.

Yeah I need to refresh myself on how to interpret palette and graphical data. I know where to go to get that information (after all that's how it's reading the font and menu graphics) but it may take some time and experimenting to get myself reacquainted. I'm not planning on making the tile graphics editable from within FF4kster, but I would definitely like it to display the tiles. That way you can see what tile it is you're editing as opposed to some kind of text description like "upper left corner castle wall tile" or something... also it will be absolutely vital to read and display the tile graphics correctly when it comes time for the actual map editor; the user needs to see what the map looks like in-game as they edit it. Which is another reason I want it to be read directly from the ROM. That way if you change the tile graphics in something like Tile Layer, the changes will be reflected in FF4kster and you won't have to just remember what old tile your new tile corresponds to and try to imagine what it looks like, as you would if you did that with something like FF4Tools.

Additionally, if I can make a generic enough function, I might be able to add graphics to other editor components as well such as previewing NPCs with correct palettes, or more ambitiously, preview weapon attack animations with their proper graphics and palettes, likewise for spells, and even monster graphics.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #568 on: December 08, 2013, 08:13:44 PM »
Yep, that appears to have been the problem with Boast, hmm... there's still something wrong with Cry. As in, it doesn't appear to change anything outside the usual. Hmm... oh I see. That is using an "80" for the first argument when it should be using "00" and adding from that. So it was reading (Character after Porom in battle formation) Palom's Atk Power which is 6 and half of that is 3 which subtracted from the Imp's Defense (which is 10) and was placed into their Steal Evade value.

Ah, seems you forgot to change that "save Value to..." to also match (or be a separate entry) the value that is originally being subtracted. This is located at 0x1EB16 9D 2F 20 (Save value to 202F in Monster's Data) in a non-headered ROM.

Very ambitious plans in mind, indeed!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,266
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #569 on: December 08, 2013, 09:35:49 PM »
I was just thinking the other day that it would be nice to be able to preview NPCs. Can't wait!