øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2021.msg22819e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index932f.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2021.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index932f.html.zx³%g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ…¬.UOKtext/htmlISO-8859-1gzip0|Ö.UÿÿÿÿÿÿÿÿTue, 10 Mar 2020 05:45:45 GMT0ó°° ®0®P®€§²ð®±%g^ÿÿÿÿÿÿÿÿ·>.U FFIV Job System (Culmination of all of our works and hacks)

Author Topic: FFIV Job System (Culmination of all of our works and hacks)  (Read 5512 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
FFIV Job System (Culmination of all of our works and hacks)
« on: March 25, 2015, 05:49:38 PM »
In my most recent hacking stint I've formulated methods to go far beyond the limits of our original Table mandated routines by moving these to empty spaces and repointing accordingly. Hacking 101, now that I really think on it. But in so doing I've concocted a way to increase our Command space from a measly 27 slots (in hex) in which a lot of them are paired commands anyhow to a much more robust 38-3B amount of slots. Meaning that there would be enough room for 18-20 new routines without touching any others. The concern would invariably become "But what about Bank 03? It's nearly full as is!" Oh, that it is, but we aren't necessarily locked into Bank 03, the makers left leeway by tying the Bank choice at the very end of the "find table pointer" routines, meaning you would create a JSR to some unused space, create a check to see if the Subroutine is beyond a certain amount, if so jump to another place filled with empty space and that's where you can start to use unique subroutines.

That takes care of that, but then the second question, "Why would we ever need so much space?" And that is a fair point. With 13 characters there is only room for 39 (decimal) unique  commands and when Magic slots are taken into account that drops to 28.  And that's where my other new hack comes into play. This hack is an event instruction which moves Battle Commands into SRAM and when initialized the second part of that event instruction hack is to add any given Command to any Slot of a character's Commands. Another piece of this hack is that it loads Commands by Character basis rather than Actor basis, so it takes up a lot less space (a necessity as there is not much free space at all in SRAM.)

With the ability to mold a character's Command Set as one pleases, a lot of things would open up. With roughly  20-30 new Command slots to use people could allow their creativity flow as they will not have to worry about replacement and all of that and they can have these new commands accessible in any event setup they please.

But here is where this idea comes in to make a showcase...

Cecil will start the game with Dark Wave.

Say you go into the Training Hall and instead of a bunch of NPC's there are statues of the PC's. When you talk to say... Dark Knight Cecil's Statue the game will check to see if a flag is on that indicates Dark Knight Cecil is present through the use of my Flag Check Skip Instructions hack that I have recently made. If not it will say "Nothing happened." If you talk to it with the Dark Knight in your party you would then be prompted. "Would you like to change Dark Wave to Dark Omen?" and a Yes/No prompt would appear. If you have Dark Omen then it would ask "Would you like to change Dark Omen for Dark Wave?"  Through the very same use of flags. Or you could even have both Dark Omen and Dark Wave on at the same time, but my thought is to supply a unique command slot for each character that can hold them, so in essence Dark Knight Cecil could have 3 command slots thus three Cecil Statues that would offer new commands (likely for some price, or based on game progress). And so on and so forth with the other characters.

Does such an idea sound workable, does anyone have any suggestions to improve upon this thought or other ideas that could utilize expanded Commands/Flag check Hack/Command Placement in RAM and manipulation hacks?

« Last Edit: April 07, 2015, 01:57:07 PM by Grimoire LD »

koala_knight

  • Tunnel Armor
  • *
  • Posts: 166
  • Gender: Male
    • View Profile
What about using the shop system somehow for unlocking the statues through purchase?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
What about using the shop system somehow for unlocking the statues through purchase?

This could be done... if it was built in a specific manner. I have been thinking about this for a while now on designating certain shops to sell not items, but Spells (for an overarching spellbook like FFV does), I imagine it would be quite complicated, but the effect may be worth it. Your idea is workable and if I create a few custom strings related to the statues I might be able to plug them into Shop's menus. Problem would be price though... I think that would probably be the most difficult part about this idea, I can easily make other items act as placeholders with changed names, but I would likely have to write a table of prices for this idea. I'll try to start cracking stores though.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
This is a really cool Idea. I'm a little hazy (maybe you went into more detail somewhere else?) On the details of exactly which limits you've overcome to the original set of commands.
As I see it, the limits are:
1) bank 03 space (not too difficult to overcome)
2) command name space (pretty sure command names are wedged into a bank of other text data, like character default names &c. This could probably be moved pretty easily, as long as you find all of the pointers into command name data and adjust them appropriately)
3) command ID numbers - probably the toughest to overcome because of how the game regularly adds C0 to the ID for various functions, meaning there can only be a maximum of 3F commands, ever, and we want to make sure to not overwrite things like Change, Parry, Show (well, except in hacks that get rid of Hide), Off, Land (the second half off Jump), the ending portion of Spirit Wave, Running away (I don't think we've ever explored this, but it must be a command), whatever else I might be forgetting...

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
This is a really cool Idea. I'm a little hazy (maybe you went into more detail somewhere else?) On the details of exactly which limits you've overcome to the original set of commands.
As I see it, the limits are:
1) bank 03 space (not too difficult to overcome)
2) command name space (pretty sure command names are wedged into a bank of other text data, like character default names &c. This could probably be moved pretty easily, as long as you find all of the pointers into command name data and adjust them appropriately)
3) command ID numbers - probably the toughest to overcome because of how the game regularly adds C0 to the ID for various functions, meaning there can only be a maximum of 3F commands, ever, and we want to make sure to not overwrite things like Change, Parry, Show (well, except in hacks that get rid of Hide), Off, Land (the second half off Jump), the ending portion of Spirit Wave, Running away (I don't think we've ever explored this, but it must be a command), whatever else I might be forgetting...
Welcome back Chillyfeez!


1. Indeed, Bank 03 can be used but then from then on we can link the "which bank to look at" code into a JSR to custom code which looks to see what number the command of Spell Subroutine. As you noted, very easy to deal with.

2. This entire idea came from Command Name space. There is room for 65 (41) more Command names. I've tested this to its logical conclusion.

3. As you noted we are Stuck with 3F commands and nothing will let us go beyond this, because the game uses 00-BF for normal abilities. Anything beyond that is a Command.

I found an old document of Phoenix's which helped me build my original Command Disassembly and I also improved upon what was initially there with notes of my own starting from Jump's Return to a blank at the end. After that it goes back to normal routines. Also yes, that "Run Away" command is normally completely unused. In fact it is so unused no Command ever calls it. You can easily link to it and see its intended effect (I always thought it was meant to act like Morale did in FFI-III where an enemy low enough level or through the Fear spell would run. as you may recall my FFI Spells used this routine with a slight change.) What is odd though is that you still get Exp. as if you killed the foe, which shows they never got as far as they should have when programming it.


1E - A2E9 (03E9A2 - Jump's Return)
1F - 23E8 (03E823 - Focus's Return)
20 - E3E4 (03E4E3 - Spell Casting Portion of Twin)
21 - 4FB3 (03B34F - Wait Command)
22 - 38E4 (03E438 - Something to do with the very end of Regen Routine?)
23 - 0000 (Blank) - ??

23-3F does give us roughly 28 more command slots to work with, which is pretty large, I would say.

Since this may be of some interest to you here are my notes on pointers and all of that business.

Location of Command Pointers

08B850

(Change 03B160 to BF 50 BA 08) - New Location of Command Pointers

(Change 02B201 to BF 00 BB 08) - New Location of Command Stances

(Change 038BB3 to BF 80 BB 08) - New Location of Command Targets


FA850 - Location of Command Names


(Change 03A2AC to BF CC BB 80) - New Location of Status Disabling by Command

As you can guess this is all part of a package, something I'd like to call "Hacker's Paradise" which moves all of the pointers and gives the prospective hackers much more room to fool around with.

Here is what I have done at the moment...

(Change 039FA2 to BF D0 BB 08 ) - New Location of Command Timers

Original Location of Spell Subroutine Pointers (03D2AF) - Change To...

BF 20 BC 08 - New Location of Spell Subroutine Pointers

FFIV-Hacker's Paradise

This patch is designed to Free up a lot of space for potential hackers to use as they will including...

1. 2 new event instructions

A. One new event instruction can cause parts of events to skip if the right flag is on/off, or skip events entirely if a battle was lost.

B. This Event Instruction replaces a chosen Character's Battle Command with another Command.


2. Increase the Command Table from 27 to 3F Allowing for 24 new Command Slots.

3. Increase the Spell Subroutines Table from 34 to 7D that is More than Double the amount of spell Subroutines.

4. Chillyfeez's Shadow Party Hack obviates the purpose of worthless 5x Shadow Slots by instead breaking characters down to their essentials and rebuilding the characters when they rejoin the party since that is done automatically anyhow.

Space to Place Routines (unheadered and 1.1)


0001DE55 - 1195 Bytes!
00023C38-23C80
0023C94- 23FFF (A fair amount of Bytes.)
5FD58 - 680 Bytes!
6E3A0-6F25F EBF (3775 Bytes!)
977F0-97FFF - 80F (2063 Bytes!)


This sort of got me sidetracked from my Side Project as I aimed to make the Side Project have more command space to give enhanced commands to the returning Party Members ala FFIV Advance.



chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Wow, so this is a grand scale type thingy you've got going on!

The expanded spell routine space is what excites me the most personally, for sure, but something like this would really open up the platform for experienced hackers with good ideas to really play around...

Couple things come to mind immediately:

1) I was actually talking about whatever it is that makes the party run away, as in when you hold L and R... But is it possible that that is the actual use of what we've thus far referred to as the "Enemy Runs Away" routine? I'm not gonna get into actually doing stuff this evening, but tomorrow I might try setting a breakpoint to that routine and hold L and R to test that theory out...

2) be careful of those big empty spaces. Compare their locations with the ROM map in ffiv.txt. I had a brush with disaster recently by carelessly using some space in the 90000 block (I think). I was using some supposedly empty space after dialogue bank 3, and I was unaware of it. A long time later, I edited bank 3 in FF4kster and it almost destroyed my game. Took a long time to figure out what went wrong. Had do DL this utility called IPS Peek that analyzes a patch to tell you exactly which parts of ROM it affects, then compared each of those places between a ROM that was and was not patched with the recent changes. Took several hours to figure it all out, and that was only after I figured out that I'd be able to do this at all. Anyway, point is that I'm wary of big empty spaces now... Heh, I developed ROM agoraphobia. But as long as you know what is surrounding the free space you're using, you should be fine.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Wow, so this is a grand scale type thingy you've got going on!

The expanded spell routine space is what excites me the most personally, for sure, but something like this would really open up the platform for experienced hackers with good ideas to really play around...

Couple things come to mind immediately:

1) I was actually talking about whatever it is that makes the party run away, as in when you hold L and R... But is it possible that that is the actual use of what we've thus far referred to as the "Enemy Runs Away" routine? I'm not gonna get into actually doing stuff this evening, but tomorrow I might try setting a breakpoint to that routine and hold L and R to test that theory out...

2) be careful of those big empty spaces. Compare their locations with the ROM map in ffiv.txt. I had a brush with disaster recently by carelessly using some space in the 90000 block (I think). I was using some supposedly empty space after dialogue bank 3, and I was unaware of it. A long time later, I edited bank 3 in FF4kster and it almost destroyed my game. Took a long time to figure out what went wrong. Had do DL this utility called IPS Peek that analyzes a patch to tell you exactly which parts of ROM it affects, then compared each of those places between a ROM that was and was not patched with the recent changes. Took several hours to figure it all out, and that was only after I figured out that I'd be able to do this at all. Anyway, point is that I'm wary of big empty spaces now... Heh, I developed ROM agoraphobia. But as long as you know what is surrounding the free space you're using, you should be fine.

That is the goal indeed Chillyfeez, FFIV is a great game, it still holds up today but its clear how many shortcuts and bizarre programming methods they took with it, that Summon shortcut still leaves a really bad taste in my mouth that This was their method of having Asura be randomized (instead of being sensible and creating a unique spell routine for Asura.)

They used their table space very sparingly, seemingly knowing at an instant what they needed and thus many of the tables are by default inadequate for expansion, hence why they needed to be moved.

2. Now I've looked at all of these spaces and there is no text that I am aware of anywhere close to them, believe me that was one of my chief concerns as well.

1. "Enemy Runs Away" is its own routine. I have it documented already.

http://slickproductions.org/forum/index.php?topic=1883.msg19420#msg19420

As you can see it is very similar to Retreat except without the Exp. null and "running away sound" so it sounds as if the enemy is dying. As I said it was likely planned early on to be similar to Fear. It is entirely unused.

Though out of curiosity, what is FFIV.txt? This is the first I've heard of that document.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Wait - hang on. All this time when you were talking about "retreat," I assumed it was the thing that the soldier captain does after the three soldiers are defeated. Are you telling me that that's the same routine as when the party runs away?

No, you know the document. Yousei's document. Maybe it's called ff2.txt? Sorry if I made that more confusing. I haven't even had my computer on for the last week or so.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Wait - hang on. All this time when you were talking about "retreat," I assumed it was the thing that the soldier captain does after the three soldiers are defeated. Are you telling me that that's the same routine as when the party runs away?

No, you know the document. Yousei's document. Maybe it's called ff2.txt? Sorry if I made that more confusing. I haven't even had my computer on for the last week or so.

The party running away is something I haven't discovered yet (because if I had I'd try to make it so its not an instant process!) and is likely not involved in the commands, I could be wrong and would be glad to be wrong in this instance. But yes, that is what Retreat is, there's a small exception tucked away that looks for specific ID's of spells and one of those ID's is Retreat. If it's retreat Exp gain is nulled and the sound used is the "running away" sound.

"Enemy Ran Away" Command Routine however is what I've been discussing these last few posts. It is in the Command section but doesn't have a pointer assigned to it unlike all other commands.

Yousei's document, I only really know of the Tower of Babil docs, did he have another separate document from that?

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Yeah, what I'm theorizing here is that the "enemy ran away" routine might actually be the party running away routine.
The way I see it (and maybe I'm wrong, wouldn't be the first time) the party running away routine must be mixed in among the commands somewhere.

Surely you've seen yousei's document. I think we've discussed it before. If you download his FF4ed utility, it's packaged in with that. It'll be in its own subfolder called "documents" when you unzip the utility. I'm pretty sure the ROM map assumes v 1.0 (everything else yousei did specified 1.0) but the addresses are all close enough to give a broad overview of where most things are in ROM.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Yeah, what I'm theorizing here is that the "enemy ran away" routine might actually be the party running away routine.
The way I see it (and maybe I'm wrong, wouldn't be the first time) the party running away routine must be mixed in among the commands somewhere.

Surely you've seen yousei's document. I think we've discussed it before. If you download his FF4ed utility, it's packaged in with that. It'll be in its own subfolder called "documents" when you unzip the utility. I'm pretty sure the ROM map assumes v 1.0 (everything else yousei did specified 1.0) but the addresses are all close enough to give a broad overview of where most things are in ROM.

Oh, I forgot all about that program, I do still have it somewhere though...

Ah right! I forgot about this document. Thanks for the reminder.

But back to "Enemy Ran Away". This routine is literally just "enemy kills itself", show message "Ran Away". I have tested it on PC's to see if it would do anything special, they just drop dead with the message "Ran Away" displayed. This can't be used by the normal game because the game never actually uses the message "Ran Away" and anything dealing with leaving battle would have "Battle End" script to it, such as in the Exit Routine.


chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
OK, I remembered you talking about the "enemy ran away" routine, but didn't really remember what it actually did. So party running away is still out there somewhere, then. Guess I'll put it on the list of stuff to find at some point.

So all of those blank spaces seem safe according to ff4.txt with the possible exception of  977F0, which includes the data yousei has listed as "triggered event data," which I assume is the details of trigger event IDs, something that is definitely editable and expandable using FF4kster, which makes it dangerous to use...

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
OK, I remembered you talking about the "enemy ran away" routine, but didn't really remember what it actually did. So party running away is still out there somewhere, then. Guess I'll put it on the list of stuff to find at some point.

So all of those blank spaces seem safe according to ff4.txt with the possible exception of  977F0, which includes the data yousei has listed as "triggered event data," which I assume is the details of trigger event IDs, something that is definitely editable and expandable using FF4kster, which makes it dangerous to use...

Yikes, a good find, I had completely missed that was the section in question. Now is that implying Event Triggers as "Tanks shoot at Tower"? Or does it imply Event Triggers as "Warp/Treasure/Event"?

About party running away, at 7E38D3 that is Incremented by 1 which forces the party to flee. However this appears to be unique to Exit as normal running away does not appear to write to this..  I would think it unique to Exit but you can still lose money in this manner which doesn't happen with Exit, so I'm not really sure.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
We'd have to run some tests to be sure, but I think "triggered event data" refers to the data that tells the game (hypothetically, as I am at work and nowhere near the real data right now): "event call 05 = run event B2 if flag 61 is set and flag 65 is clear"

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
FFIV - Quasi-Job System
« Reply #14 on: April 07, 2015, 01:56:24 PM »
So I have racked my brain on this and I came up with a rather novel way to make sure each character is unique and (most) gain 24 Spells in all to fill out their spell books all without using too much event space... here was my original plan, which was highly obtrusive and cost a lot of event space...

Go into command hall, talk to corresponding PC Statue. Check a flag to see if Dark Knight Cecil is in the party. "Would you like to change Dark Wave for Dark Omen at the cost of 10,000 Gil?" Yes/No. Yes, run the new event instructions which put the Command into the character's Commands. Then set another Event Flag with Another Message of "Would you like to change Dark Omen for Dark Wave?" so on and so forth.

Doing this with 13 characters is just a terrible idea all around an enormous waste of Event Space, Flags, and Text Space...

So I went back to the drawing board and came with up with a Job Card idea (you may recall that was an older idea of mine, but I didn't really have the talent at the time to carry it out) There would be 3 Job Cards and each would run an event depending on which character was at the front of the party, change commands accordingly and that was it. It wouldn't change sprites or anything, but it would change up the given Command sets. It was a fairly simple plan and tons more efficient than the first... then I realized I wanted to go deeper...

Giving characters the roles is all well and good, but for example I turn Cecil into a Mystic Knight with JobCardC, sure he may have some Commands pertaining to the Mystic Knight but will he really Feel like a Mystic Knight?

That's when I decided to go for the ultimate step...

Changing these Quasi-Jobs would not only change Commands, but be the means of which to learn new spells.

You would no longer learn spells through Level Ups, but learn spells through Battles Fought...

This plan requires 26 free bytes in SRAM Thankfully there appears to be just 26 Bytes to use underneath my battle commands.

This would mean at 255 Battles max, the Class has been mastered. (It might not be that high and there may be certain conditions on whether a battle counts.) Every 20-30 battles then you would learn a skill associated with that class.

The incentive to switch classes then would be based on wanting to acquire these new spells for your characters or to deal with certain situations...

For instance Bard Edward will not acquire any spell through battle, but events throughout the world will give him his set of skills. Dragoon Kain will use his Combat Boost setup where he will learn magic from wounded Dragons. Scholar Edward is something entirely special and I think shows a good amount of sense with a Scholar. Relying on my Random Enemy AI he will be given a skill called Read that will allow him to use the applicable Enemy's Spells as his own for the battle. So say he uses Read on an Imp... that would give him Venom and Haste, granted I am trying to think of a way to balance it, but it seems like an interesting application of the idea of a "Scholar" class.

Now I should note that aside from very few exceptions (which still need worked out) changing Jobs will not allow a character to equip different weapons and armor, mainly because that system is so archaically done through FFIV's engine it would be too much of a headache to make function correctly.

What was my choice for how to go about all of this planning? Well it was actually quite simple and I'm somewhat ashamed I didn't think of it earlier...

Equipment, or to be more specific Accessories.

All accessories have been changed to "Job Slots" 20 Slots is what I needed and 20 Slots is what the game has by default, very good luck on my part.

Without an accessory equipped all characters are in their base job, with a Job equipped their job name will change (planned, not implemented) on the menu and the unused "Steal Byte" for players will act as the check.

So to summarize...

1. New Jobs can be obtained through Accessories
2. Each character has Three Jobs. 1 Base, 2 through Job Accessories
3. The character's command sets will completely change
4. A byte will be set in the character's data and will be the way the game knows to increment a byte at the end of battle.
5. After a certain number of battles the character will learn a spell (using the Spell Learning system and making it look at the character's specific byte, instead of levels) for a maximum of 255 battles until all spells in that class are learned.

With this also would come a scheme to get characters back into the party ASAP. So meeting Edward in Troia will trigger him rejoining. A quest can be undertaken to get the Twins back when you resurface from the Underworld. Cid adding the Heat Shield to the Falcon will have him rejoin and awakening Yang in Sylph's Cave will let him back in.

This is to make sure that the player can potentially have the team together for a good amount of the game instead of rolling their eyes at the prospects of training up Jobs for characters that haven't seen play since the first part of the game.

Does this idea sound good? Sound bad? Anything else you may like to add or some important and crucial matter that I may have missed in explaining this?

Please, let me know.