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

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #570 on: December 10, 2013, 03:50:23 AM »
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.

I didn't forget, it absolutely was writing to that address. However, it turns out that address was incorrect; it was off by exactly 200. Are you using an unheadered rom by any chance?  :wink:

Anyway I fixed those and uploaded again. Hopefully this time I got it all right. Might be a good idea to refresh any roms that were saved using the previous version (that, or go into a hex editor and fix 1EB17 back to whatever it should be).
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #571 on: December 10, 2013, 04:43:55 AM »
Indeed, the ROM I use is unheadered (I thought unheadered and non-headered were the same thing. A mistaken assumption?) that should do the trick!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #572 on: December 10, 2013, 12:05:00 PM »
...

They do mean the same thing, I just can't read apparently...  :isuck:

Anyway it's finally working correctly now I take it?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #573 on: December 11, 2013, 10:58:42 AM »
Indeed! It is finally working. Hard work and perseverance brings reward, as they say. I will post more command mods when I have the time, but I've been feeling ill lately and finals are... well actually they're here so it will be a little bit of time before I can get back to helping implementing those.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #574 on: December 14, 2013, 11:54:34 AM »
Well I made it through finals...finally. I hope everyone else is fairing alright. But on to better things. I've been thinking about my intention to strip party members as they depart. I had a few ideas with regard to how to handle it; the easiest of which would be to use the storage capacity of the Fat Chocobo. I had even thought of extending that further to allow for a completely separate storage for gear - maybe even dual functioning Namingway - Storingway does have a bit of a ring to it. That of course led me into where exactly I planned to save this data. I found a post from  the long-long ago with some spaces in the rom to work with, so routines wouldn't be such a problem to work in now:

Per request from Leno...

Unused space (offsets with header):

7F31 = 623 BYTES
E055 = 1195 BYTES
10135 = 203 BYTES
181BE = 66 BYTES
1F3FB = 133 BYTES
200E3 = 285 BYTES
23B4C = 124 BYTES
23DD0 = 1072 BYTES
43AB9 = 1863 BYTES
5FF58 = 680 BYTES

*stopped here, that should be enough for now

The problem, of course, is SRAM: Not going to find much in there - and even if I did I'd never trust it through an entire play-through; even if I watched it the whole time. So given that I started thinking of How much I would need to store in SRAM vs what I could recalculate as needed. My first thought was to go through the event list and see what I could do-away with - hopefully at least freeing up some flags; if it came down to it I could always try playing games where you use a single index to store a bound double index. When my brain takes me on trips like that I usually end up:  :eek: I was actually starting to think about events when I decided to go back a look through some other posts to see if anyone else came up against this. I found a very handy list of events put together by this guy who is really-really modest about his ASM cataloging:  :wink:

...Since it seems that we're getting into the nitty gritty of the game's system. I think I'll list a number of non-essential events that can be safely replaced which are not important to the story as well as sprites that bear little on the game. I will also list their Trigger number and location for touch events.

Behemoth Battle 51 (Trigger 4 in Bahamut's Cave 2F)
Behemoth Battle 52 (Trigger 1 in Bahamut's Cave Bahamut's Floor)
Hummingways
Namingway
OUCH!
Cecil's Maid
Item Selection - Soft
Finding Odin before Feymarch (Trigger 1 in Baron Castle Odin's Room)
Devil's Road is sealed  (Trigger 2 in Baron Devil's Road)
Staying at a 50 GP Inn (You could honestly only have one, all same  have the screen go black, let the music play and reappear in front of Innkeeper the rest of it is just little niceties which aren't really necessary)
Staying at a 800 GP Inn
The current is too strong for us to get in! (Not necessary)
Giott: Open the Door! (I don't believe this is even used in its normal event)
Fallen soldier in Damcyan's basement (sad, but not necessary)
Staying at a 100 GP Inn
WA! (Not sure where this is even used)
Being poisoned by bartender in Mysidia (Mysidia events, while amusing, aren't necessary)
Staying at a 200 GP Inn
Speaking to White Mage in Mysidia
Being turned into a Toad by a Black Mage
Resting for free in Fabul (Trigger 3 in Fabul King's Room) (The Cecil bed can be used for that)
Staying at a 400 GP Inn
HP Restoring Pot
MP Restoring Pot
Being turned Mini in Baron's Classroom
Staying at a 1600 GP Inn
Staying at a 3200 GP Inn
Staying at a 6400 GP Inn
Staying at a 12800 GP Inn
Baron Dancer's Dance
Kaipo Dancer's Dance
Fabul Dancer's Dance
Agart Dancer's Dance
Mysidia Dancer's Dance
Baron Dancer's Dancer after killing Cagnazzo
Mythril 3 Dancer's Dance
Toroia Dance Troupe's Dance
Dwarf Castle Dancer's Dance
Reading the Magazine
Obtaining the Magazine
Obtaining a Grimoire 6C
Obtaining a Grimoire 6D
Trading the Pink Tail for Adamant Armor
Do you have a pass?
Watery Pass - North exiting message (Trigger 7 in Watery Pass 5F)
Behemoth Battle 50 (Trigger 0 in Bahamut's Cave Bahamut's Floor)
Obtaining a Grimoire 91
Viewing the Moon through the telescope

There may be a few more, but that should free up quite an amount of new events for people to use.

Seriously, way to go Grimoire! I mean that list was nothin' compared to all the routines you picked out and deciphered. I was going through those posts all  :childish: about it and then I hit your homemade recipes for FF-I spells and I was like  :omg:

ok: Fanboy-set to off. But yeah color me impressed - and that's not to forget about Chillyfeez, Pinkpuff, or anyone not mentioned: all of you :happy:

Anyway - here's what I've got to contribute for now. I was looking back at the shadow data posts from Phoenix a few years back. I was intrigued by the approach taken there, cutting out unnecessarily stored data; but knowing that he had some trouble and my still being a noob I was thinking about more simplified approach. I've attached a few tables I put together for reference: they show every party formation that I could think of (please correct as necessary) and I was thinking through what shadow slots would be occupied as the game progressed. What occurred to me (and this has been discussed before) was that all five slots really needn't ever be occupied with one exception after leaving Fabul. It's there that all the slots are occupied, the next one that is loaded shortly thereafter is Tellah on Mt. Ordeal: technically Tellah (2) to be swapped out almost immediately for Tellah (3): the fully charged model. My idea (probably simpler than this post) is to load Tellah into the party after Rosa is taken, before the doomed sea-voyage. I had thought that I might be able to hide him, similar to Rydia in the Fabul battles; but thinking that those were specific battle setups that would be impractical.

I did think of one thing. When I first started thinking about hacking years ago the first thing I looked at in FF4 was the data for the party and I found that setting the first bit to 00 would remove the character from the party - but in function only: all the other data stayed where it was as if they never left -  and you could even swap the position of the ghost and it would swap the data as if it were anyone else. Then just changing the bit back made it look as if it never happened. But that's my plan: when Rosa leaves take Tellah(1)'s data out of Shadow Slot 1 (I labeled it S:1 in my table w/ Tellah(1) = 04) and put it in the empty space Rosa left behind. While doing that nullify the first byte and it shouldn't show up.

Looking into it more that's what happens in the Fabul battles - leaving the RAM open reveals that Rydia's first byte is set to 00 as each battle starts and then goes back to her default of 83. Actually looking into it more I found out that the the old data for a character isn't removed even if copied to a shadow slot - instead that byte is zeroed out and the rest of the data remains until overwritten. So in a list what I plan is:

Fabul Battles - Rosa Departs

~~Copy S:1 --> Rosa's Slot Overwriting her Data
~~Set 1st Byte of Copied Data to Zero

Shipwreck

-Copy Rydia --> S:4
~~Copy Yang --> S:1 (instead of S:3)
-Rydia, Yang, and Edward are removed


Mysidia (Speak with Elder to Trigger Events) **

~~Set Tellah Byte to 84
-Palom & Porom Join
~~Set Tellah Byte to 00

** This is just a safety check - it makes sure Tellah doesn't lose overwrite-roulette
      It should be fine if Tellah is either in the 4th or 5th slot

Mt. Ordeal

- Fire/Golbez Cutscene
~~Meet up with Tellah & Set Tellah Byte to 8A in place of "Join Event"


- All Other Events Normal
~~ Must Change Loading for Yang (2) with S:1 instead of S:3


This should leave S:3 blank the entire game - 64 bytes that as far as I can tell should never be touched. I figure this should be pretty easy to pull off, but that might just be my sleep deprived deliria talking...The Tellah copies should work as a straight-forward routine, and remapping Yang 1 & 2 should be just a few keystrokes in FF4kster!  :wink:

That's it for now  :sleep: Let me know what y'all think; sorry if any of this is redundant information. Please feel free to point me towards any relevant posts I may have missed. Thanks everyone!

« Last Edit: December 15, 2013, 02:09:32 AM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #575 on: December 14, 2013, 02:35:55 PM »
Wow - inspired! I don't think I'd ever heard of that before, that not only does zeroing out the first byte make the character invisible, but the game actually uses that trick.
Nice going!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #576 on: December 14, 2013, 06:38:48 PM »

I know right - I got a major LOL out of that one  :happy:

I had an idea - extending my last one - part of it thanks to you!

Bear in mind, you're not taking over Mist, Valvalis and Kainazzo's monsters in these examples, you're taking over their image arrangements.

That got me thinking about using that same concept elsewhere to reuse space; character code vs graphics references. For (probably the best) example, I took Edward and swapped out his first two bytes (well...FF4kster did it for me  :cookie: for Pinkpuff!) - to make him Edge - as I had hoped (because otherwise major  :wtf:) everything was fine with him, battle and menu wise but the idea I was testing was how it would effect other appearances of Edward.

I didn't change the NPC calls and since they are not tied to the actual characters (for the most part - which is still kind of weird to me :P) Edward appeared in scenes as he was expected to. He was still a Spoony Bard - no trouble in that battle.

Next I made sure he got yanked out of the party correctly without screwing things up down the road - quick glance ahead supports a yes - so good-good

Specifically - I skipped ahead to the end of the game. As an aside - I often test things by loading a saved game (at various points/parties) with the PAR code to call the Great Whale from the map - that way I can easily get anywhere quickly, more or less - and for Zeromus I actually converted a trigger in Bahamut's cave to send me there. What do you use for testing - I'd think along the same lines but I'm curious. Also, I have been able to load Zemus' lair right from Baron ("Wait - you told me this was Cid's house!") but I've noticed jumping worlds sometimes lead to formation call problems - turns out that they did mean it when they numbered the worlds - but that's the reason why I always fly Whale-Way-Express.

Anyway I wanted to check to make sure the end still played - it did. He was in the Prayer Tower, and he appeared with Tellah so that I would believe in myself - though that wasn't enough the first time because I forgot to bring Paladin Cecil which leads to a dead party against Zeromus  :isuck: But he appeared with Tellah - loading the Edward battle sprite. This was the one I was actually concerned over because I knew it was an enemy spell that corresponded the ghost calls and I wasn't sure where it pulled from.

So the last test to see if I could make something out of this was to replace the battle sprite code for Edward with someone else (I picked Palom) - I thought for sure I'd get to the battle and Palom would be standing behind Tellah - nope still Edward!  :childish:

So now I've got Edward loaded with pointers to Edge and his Battle data is overwritten with the data from Palom without adverse effect. So, in my mind, I could theoretically drop a new set of code over Edward's, and then have this New-ward join the party later after Edward leaves - he should load his initial info, which has now changed, and Edward himself can keep lying in that bed - with no worry of him not showing up on cue at prayer-time.  :terrydia:

It may be a way to shuffle things around to add new characters. My first thought there would be to add the newbie (let's say RacerX) in place of Edge's code while Edge is elsewhere in the ROM and transferred over Edward after he leaves the party - or something along these lines. I haven't gone through it completely - I just skipped around - but in my mind it should work. I'll work that out completely at some point and patch the ROM to make sure that I can get through the game at some point meeting RacerX and not missing Edward cheering for me in the final fight. I'm curious to hear what everyone thinks  - and please point out any visible logic short-circuits; but if this whole thing works I think there'd be some good to come of it.
"Now I know; and knowing makes it even more confusing..."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #577 on: December 14, 2013, 07:28:55 PM »
A little more about swapping out character data. I looked at the RAM map over on Datacrystal (http://datacrystal.romhacking.net/wiki/Final_Fantasy_IV:RAM_map)

The following 64-byte memory blocks contain out-of-battle character data:

7E1000: Center Character
7E1040: Upper Character
7E1080: Lower Character
7E10C0: Center-up Character
7E1100: Center-low Character

The following 128-byte memory blocks contain in-battle character data:

7E2000: Center Character
7E2080: Upper Character
7E2100: Lower Character
7E2180: Center-up Character
7E2200: Center-low Character

Use the following offsets to gather information about each character:

+0: Character identifier. Read this modulo 64 - the 2 most significant bits appear to be flags. Known values are:
1: Cecil (Dark Knight)
2: Kain (beginning of game)
3: Young Rydia
4: Tellah (pre-Damycam)
5: Gilbert
6: Rosa (pre-Fabul)
7: Yang (pre-Baron)
8: Palom
9: Porom
10: Tellah (pre-Paladin)
11: Cecil (Paladin)
12: Tellah (post-Paladin)
13: Yang (post-Baron)
14: Cid
15: Kain (pre-Sealed Cave)
16: Rosa (final)
17: Rydia (final)
18: Edge
19: FuSoYa
20: Kain (final)
+2: Level.
+3: Status flags. (4 bytes)
+7: Current HP. (2 bytes)
+9: Max HP. (2 bytes)
+11: Current MP. (2 bytes)
+13: Max MP. (2 bytes)
+16 through +47: Various stats (Strength, Agility, etc.)
+48: Head equipment slot
+49: Body equipment slot
+50: Arms equipment slot
+51: Right hand equipment slot
+52: ???
+53: Left hand equipment slot

That goes along nicely with my other post. That would provide insight into how one could vary battle data. Also, I checked it out and those addresses do work (unheadered 1.1 rom) - but it doesn't update changes until going into a battle. Likewise here zeroing the first byte removes the character from the lineup and they do not return after the battle (just as taking them out of the field will also have them removed from battles). Just a little more food for thought.  :finger:
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #578 on: December 15, 2013, 01:41:07 AM »
I usually use the White Chocobo to force a location or event (by editing the White Choc event using FF4kster). If you load a map within an event instead of from a "warp point (I.e. a door or stairs)," there tends to be less of a problem for the game figuring out whether you're in the Overworld, Underworld or Moon.

I'm a little unclear about your RacerX - does/will he have his own set of graphics? If so, where will they be stored in ROM, and how will the game know to load them?

+51: Right hand equipment slot
+52: ???
+53: Left hand equipment slot

I think that "???" is right hand equipment quantity, for arrows.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #579 on: December 15, 2013, 02:52:20 AM »
White Chocobo - nice!  You've also helped shed light on something I ran into when testing some events a few weeks back: I had changed the Devil's Road in Baron to send me to the moon, which at times had problems - but I was using the soldier in that room as my way to play-test an event in the underground - which had no problems loading the map down there (Giott's crystal room to be exact). So yeah - now I know to watch for that: Thanks Chillyfeez!

As for RacerX:     Yes...

    - Oh, you want me to actually follow up, don't you?   :relom:


What I had in mind was to store the graphics data somewhere in the ROM (that's really as far as I went on that ATM) and then when the time comes call some assembly routine (to be programmed later) to overwrite Edward's data. My thinking is that only changing his actual data but still referencing him in the game as an actually character will (hopefully) avoid unforseen issues in calculations down-the-road. This seems to be a much safer (and easier) alternative to my attempting to try and mimic a character's functionality by writing subroutines to reference new areas of data - which was my Plan A but I had to bag that on account of being insane for me to try - Though I'm learning I'd say I've only recently graduated to no longer needing training wheels on my bike - however, that sort of ASM attack, like trying to go from bike to jetliner, is probably beyond me. That's me, though...were attempts to be made others might fare better.  :wink:

I did think of one problem: RacerX may be limited to Edward's battle commands - or similarly he may not be able to cast magic from the menu: I don't know how that's controlled - does just having spells in the spell list allow you get past "Cannnot Use" - or it could be as (I'm thinking about it) both in and out of battle magic use is tied into what commands are available - hence Edge having Ninja listed under magic in the menu. But on the other-other hand there's is a separate location for the spell lists themselves and the the game expects Edge to have magic, so he does.  :hmm:   - Thoughts?

I'll have to look into that one. But my first line of defense there would be to start off working with alternative versions of known characters: Tellah (2) is barely used - it wouldn't take too much tweaking to change all the events that key off of Tellah (2) and make them look instead for Tellah (1) - In fact, I think it's just in the Mirror room - and even there it should only be one event action: dropping Tellah (2) as a party member. Using my proposed trick of bringing Tellah(1) back early, hiding him and then going from him to Tellah(3) I could potentially squeeze a new character out of Tellah(2). But I know they don't have the multiple copies of his graphics - so all three would be trying to access the same code - but that's along the same line as Edward - once Tellah is gone from the PC line-up I should be free to drop new code in his place.

That brings me to an Assembly question: If I were to write a simple loop to move a character's data from some dead-zone in the ROM to replace an old character - how noticeable do you think that would be? If I go low-brow and just straight up loop through 64 bytes of non-battle data + 128 bytes of battle data + incidentals I haven't thought of - I feel like I can't just sneak that call in just anywhere - it'd be PlayStation battle loading in Chronicles all over again...What do you think?

...and if you were thinking: "Man this guy just keeps on going..." - you'd be correct; so full credit for that answer   :tongue:
"Now I know; and knowing makes it even more confusing..."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #580 on: December 15, 2013, 03:03:09 AM »
...and in all that I forgot to reply to the last bit:

  I think you're absolutely right about it being quantity - And though not listed I'm sure left-hand quantity is after left-hand in the battle code just as it is in field code. That was going to be something I was thinking about changing if I ever tried full shadowing.

Since there aren't any unused locations of RAM (that I know of), I knew I had to fit as many characters' stat data within this 64 x 5 = 320 bytes of data that I could. Ideally, this would be 14, because there are 14 character classes and sets of sprites (not including Golbez and Anna, who don't have complete sets). In order to do this, I needed to store only the absolutely essential stats of a character, removing non-essential stats like modified strength/agility/vitality, hit percentage, attack statuses, etc. I call these "non-essential" because they can be calculated from a character's base stats and equipment data.

Looking at the data, I pared the stat list down to: character id (1 byte), class id (1), level (1), max HP (2), max MP (2), base str/agil/vit/wis/will (5), helmet (1), armor (1), gauntlet (1), right-hand weapon (2), left-hand weapon (2), and experience (3). This adds up to 22 essential bytes per character. Finally, I divided the 320-byte block by 22, and lo and behold there's room for 320/22 = 14.54 characters. It's like it was fated to be.

I like that approach - and since I would hope that you can't have arrows in both hands (does the game allow that??) that you really only need one quantity byte for the two hands to share (and a little extra code to assign it properly when read). Of course, that's the kind of shortcut that works on paper but then gets me in the end. I feel like doing stuff like that I'll be looking at a crashed game someday thinking "What were the odds the boy was going to look in the vegetable crisper?"
"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 #581 on: December 15, 2013, 06:12:09 AM »
I did think of one problem: RacerX may be limited to Edward's battle commands - or similarly he may not be able to cast magic from the menu: I don't know how that's controlled - does just having spells in the spell list allow you get past "Cannnot Use" - or it could be as (I'm thinking about it) both in and out of battle magic use is tied into what commands are available - hence Edge having Ninja listed under magic in the menu. But on the other-other hand there's is a separate location for the spell lists themselves and the the game expects Edge to have magic, so he does.  :hmm:   - Thoughts?

You can use FF4kster to edit this (that is if I'm understanding your question correctly):

Edit Jobs -> Select the person's job (e.g. Bard) -> "Edit spell list links" -> Set white, black, and/or call to whatever spell lists you want.

They will be the same list in battle and in the menu. I may at some point add functionality to have them be separate but for now I'm assuming most people would want and expect them to be the same. The magic will be accessible from the menu and such (so you won't need to worry about "cannot use"). It does not currently allow you to change the text that overwrites "Black" with "Ninja" for Edge, but that will probably come in time as well.
Let's dance!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #582 on: December 15, 2013, 07:32:38 AM »
Do you see how easy that instruction to change spell links is? – 100% Amazing – I mean it when I say had I not come upon your editor I’d probably not even be into this at all other than dreaming and maybe some hex futzing. I remember first looking into this long ago and being frustrated that I couldn’t mix and match battle commands - Not a problem anymore!  :happy:

As for my extended character roster scheme I was thinking as follows:


Playthrough as usual up through losing Edward

With Edward not coming back call ASM routine to overwrite Edward’s data (graphical at least)

Meet RacerX which would correspond to “Add Edward” – but he would look like a new character


That’s the plan in a nutshell – but in this scheme I’d have to then make sure either the Job pointer is also changed or I also change what “Bard” corresponds to in terms of available commands – otherwise RacerX will have “Sing” & “Hide”

Really, though, I think that whole plan with overwriting data of no-longer needed characters may be too involved – in fact I’m pretty sure that I’m overthinking it – I do that. :P

What I’m thinking I'll do is what I was saying with Tellah and repurpose multiple copies. As I understand it now you get Kain (1) (for 5 seconds) and then he’s gone for a while – but because you met him and he’s still a shadow he is going up in level to match. What happens if I meet Kain (2) in Baron and then meet Kain (2) again as normal in the Tower of Zot – I’m going to find out as soon as I post this but I still want to get your perspective on that. The two Kains would still be pointing to a lot of the same things but I still want to see what's going on behind that curtain.

Oh yeah – 10" of snow outside today - I think it’s time to do some more experimenting.  :cybez:
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #583 on: December 15, 2013, 09:19:15 AM »
The biggest hangup I foresee for the RacerX plan would be that I'm not sure if it's known how the game determines where to look for a character's graphics. There's probably a set of pointers somewhere. Assuming you find those (should be possible given enough time), is there enough empty space in ROM that can actually be pointed to? The nice thing about pointers is that you can be all over the map with them, so to speak. The not-so-nice thing about pointers is that the "map" is only 8000 (hex) or FFFF bytes long, depending on where in ROM they point to, which is not a whole lot in terms of graphical data.
This is all theorhetical, but assuming pointers are used, and you can find them, then it's only a short trip to finding how they're used (it's usually a simple calculation like x + pointer = data location). It might then be possible to change x in order to point to a latger empty bank. Of course, you'd have to rewrite all of the other characters' graphics into that bank, too.
I don't have a lot of time to do stuff these days - I've even had to put my own stuff on hold - but I'll be interested to see what you come up with.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #584 on: December 15, 2013, 06:11:57 PM »
Finally! The flu is gone (or mostly so) and finals are now over. All that is on my plate is work, I am fine with that.

Now this is an Incredibly ambitious plan you have set up here LordGarmonde. I am still a little hazy on the RacerX proof of concept. Is it supposed to show that you can have a character be replaced in function but not in story role in order to free up that data? Because you can. The Sprite designations for NPC's and Party (Leader) is a very different thing. One that I've looked at, but came up blank. There is one thing that troubled me with this and its exceptionally troubling when you may plan on using a character outside of Dark Knight/Paladin Cecil as the main character.

That problem is in some cases when a cutscene ends (or in some cases, during) the game will default to either 00 Dark Knight or the 0B Paladin (I have no idea what makes this differentiation) for the displayed graphic. Everything else is completely fine in changing.

Also great find with how the "single character", "exclude character" battles work! I never realized that their ID Byte was written to 00 for those fights.


Though if you want to test something event-wise Immediately at a new game, you would change...

In Unheadered Rom this is at...

281 - A9 10 - Starting Event.

With this also you won't have to erase the second Longest event in the game which is the Starting Events.

Also about my ASM work... I was really glad that I managed to include all (most) of FFI's formulas and was building a patch, but FFIV's system doesn't really allow a lot of it to be too useful without a Heavy overwrite of the basic battle system, which might be worth it. Though one thing that did upset me was my inability to pinpoint the Level Up Random Bonuses that I had planned to utilize from the earliest levels to the end.


For PinkPuff -

Now that we have everything worked out with the current commands, I can post some information for other command implementations... (As before, they are in a non-headered ROM)

Dark Wave

Dark Knight's Hit-All Attack Option, includes Value Loss 1/8 (Yes/No), What Value to decrease by 1/8 (See Kick for more info.)

  • Value Loss 1/8: 1E9F2/1E9FB/1EA00
  • Loss of Value Yes/No?: 1E9FF


Note: The Value Loss looks at two values. The first is Max HP, 2009 (or 0920 as it will appear)  the second address looks at Current HP 2007, and the last one is Save to Current HP 2007. The "Yes/No? option would NOP the instructions at 1E9FF with EAEAEA to make sure nothing is subtracted. It is also important to note that Dark Wave's formula flows right into Kick.

------------------------------------------------------------

Kick

Yang's Hit-All Attack Option, includes Damage /2 for Kick (Yes/No?), What values will be used by Kick (and Dark Wave), Value Resisting Dark Wave (On/Off) and Creature Type which Nullifies Kick & Dark Wave
  • Damage /2 for Kick? (Yes/No?) 1E724
  • Null 03E724 with EAEA to get rid of the dividing
  • Values used by Kick/Dark Wave: 1E71C/1E731
  • Basic 20XX parameters. Normal matters follow
  • Value Resisting Dark Wave (On/Off) 1E79F
  • Basic 20XX Parameters. Normal matters follow.
  • Creature Type which Nullifies Kick & Dark Wave 1E797
  • An AND#20 Normally, can be changed to any other Creature Type.

I tried to do something a little nicer, but I kept the old "Note" format above and this version which includes the descriptions underneath the main line. Please let me know which method you prefer.

« Last Edit: December 15, 2013, 06:54:34 PM by Grimoire LD »