Author Topic: Chillyfeez's Mods, hacks, research notes, etc.  (Read 17621 times)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #135 on: March 06, 2015, 10:35:19 PM »
My Protect/Shell Status Mod also uses one unused stat byte. (x74) since I never saw any part of it being used.

We don't often use those unused bytes in our routines as we don't often need to. They do make good spaces for new status spots though.
Aha. I stand corrected. :)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #136 on: May 02, 2015, 07:54:51 AM »
I got to thinking this morning (ut-oh...): what about "true" confusion for monsters?

Why do we have all of these AI scripts wasted on what a monster should do if it's confused? Why not just have them do what player characters do - pick an action and a target at random?

Shouldn't be too hard to do... I've seen where enemy battle scripts are loaded into RAM. It would take a bit of a routine to make the game find the right set of possible commands, but it certainly wouldn't be impossible. From there, do an RNG to pick a byte within the monster's designated script area. Make sure it's less than E8 (otherwise generate a new random number), make sure it's preceded by a byte FB or higher (to be sure it's not the parameter to a targeting byte, or whatever - otherwise, as before, generate a new RN), "flip a coin" to determine ally target or enemy target, RNG to determine target(s) within that group, and... GO!

As far as game mechanics hacks I've done, the difficulty level is mid-range at worst, and the benefits to AI editing and gameplay experience would be fantastic!

I'm back to work today after my week off, but this'll be my next little distraction...

I'll do my best to assure it plays nice with my other hacks (because, you know... me).

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #137 on: May 02, 2015, 11:13:31 AM »
What if it randomly picks something nonsensical like "Show message 54" or "Set weakness to Ice"? Or would it always look for something that's a spell/technique or command?

My bad, I didn't read your post thoroughly enough the first time ^_^

But even so, there are some monster techniques that are used for battle control purposes, things like "Suicide, bring in next monster", "Something happens to Adult Rydia" and such... what about those? Also there are some monsters that rely heavily on reactions and don't really do much on their own turns; would it look at reaction scripts too?
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #138 on: May 02, 2015, 01:55:46 PM »
Well, if there are monsters you really don't want to be confusable for fear of what they might do, status immunity would still be an option.

Regarding whether reaction abilities would be included... I don't know.
At this point, this is still in the theoretical phase. As I said, I have seen the place in RAM where the game stores AI scripts, but I haven't examined them fully yet. The way I see it, there are two possibilities for how the scripts are arranged:
1) all of a monster's scripts, including reaction scripts, are grouped together by monster
Or
2) scripts are organized first by type (normal, then reaction), and then by monster
If it's possibility 1, then easy-peasy. If it's 2, then not so much.

So... I'll keep you posted as things progress.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #139 on: May 03, 2015, 06:00:47 AM »
One option would be to have a charmed monster always target a random monster, Fight. Admittedly, it wouldn't be as interesting, but it would be simpler to implement and you wouldn't have to worry about anything going wonkee.

Another option might be to just have it leave the scripts themselves alone but just switch up the targeting. So, if a monster is charmed, then whenever it would target an ally with something, it instead targets an enemy with it. Whenever it would target an enemy with something, it instead targets an ally with it. This option would probably also have issues with the "control code" type techniques (though, if you have it leave "self/none" targeting alone it might mitigate it somewhat, or as you suggest, just make those monsters immune to charm) but it might make for some interesting plays regarding the timing of the charm or the interactions with the monster's reactions. For example, charm a Behemoth let's say, then Holy or Meteo it. It's magic damage so it's still charmed, so it reacts by targeting all monsters (instead of all characters) and casting Storm. Yippee!
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #140 on: May 03, 2015, 09:34:21 AM »
I just realized something... You're thinking about the status as "charmed," and I'm thinking about it as "confused."
In later FF games, they are disparate, but in FFIV they are treated as one and the same.

Generally, when cast on the party, the visuals suggest charm... I'm thinking about the technique used by Lamia-types where the heart floats toward the character, then the character literally faces the opposite way and starts fighting for the enemy.
What few visuals we have for the status as cast on monsters suggests confusion more - with the little bird  flying in a circle.
However, the spell is called "Charm," and the default FFIV effect on monsters suggests charm more than confusion.
The thing is, I like the idea of confusion more than charm. Erratic behavior by the confused fighter lends itself to the potential for extended status effects - if the chosen action is fight, then there's only a 50% chance that the fighter's own side is targeted, then of course the chance that self still isn't the target. Furthermore, there's a possible downside for the caster to confusion - if a monster casts a full cure on one ally under certain circumstances, there exists the possibility it might full-cure its whole party, just as there exists the possibility a confused Behemoth might Storm your party at any moment unprovoked. Charm status - simply flipping the "enemy" and "ally" bytes - would always benefit the caster greatly (pending success), since un-charmed monsters can't choose to whack their ally out of it, and the potential to abuse the system as in your behemoth example.
That being said, what you're suggesting (option 2, I mean, option 1 really would provide no gameplay benefits) would definitely be far easier to assemble...

Targeting bytes are bitwise, BTW, so the first monster in the battle - the one whose stats are stored at 7E2280 - is always "80," even if it's that monster acting. Whereas 00 works as "target self" for the party, I'm not positive it works that way for monsters. I struggle to think of any monster techniques that have a necessary self target (like "Hide").

I don't know, I guess I'll have to think about it a bit before I finalize the plan...

Anyone else reading this who might want to chime in thoughts and opinions?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #141 on: May 03, 2015, 07:25:27 PM »
I just realized something... You're thinking about the status as "charmed," and I'm thinking about it as "confused."
In later FF games, they are disparate, but in FFIV they are treated as one and the same.

Generally, when cast on the party, the visuals suggest charm... I'm thinking about the technique used by Lamia-types where the heart floats toward the character, then the character literally faces the opposite way and starts fighting for the enemy.
What few visuals we have for the status as cast on monsters suggests confusion more - with the little bird  flying in a circle.
However, the spell is called "Charm," and the default FFIV effect on monsters suggests charm more than confusion.
The thing is, I like the idea of confusion more than charm. Erratic behavior by the confused fighter lends itself to the potential for extended status effects - if the chosen action is fight, then there's only a 50% chance that the fighter's own side is targeted, then of course the chance that self still isn't the target. Furthermore, there's a possible downside for the caster to confusion - if a monster casts a full cure on one ally under certain circumstances, there exists the possibility it might full-cure its whole party, just as there exists the possibility a confused Behemoth might Storm your party at any moment unprovoked. Charm status - simply flipping the "enemy" and "ally" bytes - would always benefit the caster greatly (pending success), since un-charmed monsters can't choose to whack their ally out of it, and the potential to abuse the system as in your behemoth example.
That being said, what you're suggesting (option 2, I mean, option 1 really would provide no gameplay benefits) would definitely be far easier to assemble...

Targeting bytes are bitwise, BTW, so the first monster in the battle - the one whose stats are stored at 7E2280 - is always "80," even if it's that monster acting. Whereas 00 works as "target self" for the party, I'm not positive it works that way for monsters. I struggle to think of any monster techniques that have a necessary self target (like "Hide").

I don't know, I guess I'll have to think about it a bit before I finalize the plan...

Anyone else reading this who might want to chime in thoughts and opinions?

It is ironic. FF1's Confusion works exactly as you described. The afflicted will choose to attack an enemy or itself.
FFII is the first game to have it be closer to FFIV's Charm status, except there's something interesting here. FFII's Confusion status on allies will only have them attack allies. What's even more humorous about this is that Confusion is not removed by attacking an ally... meaning there is no reason ever to attack an ally in FFII, yet this oversight causes one of the biggest gamebreaking bugs for the game. Ironic.

But monsters are even more interesting. You'd expect older technology would just let them attack allies with physical attacks, right? Since it works that way for players? Well that's not true here. They can use one of their spells from their random AI pattern on their own side. Another irony.

FFV and VI seems to take this model...

Again FFIV is the odd one out wasting Tons of space with these "If Confused..." scripts. which, while entertaining at times, doesn't seem reasonable in a game where we're struggling for space as is. My Random AI routine hack will get around this by just having one or two AI scripts devoted to "If confused - normally attack allies" "If confused - Use Random AI routine on allies".

Ironically FFV and VI do just this for their enemies Confused Status, a special list of commands that the player can gain access to with Manipulate.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #142 on: May 03, 2015, 09:13:46 PM »
Well, I've been reinvigorated to work on TfW after your and ZERO's playthroughs, and once I get through the bug fixing and finishing the training room, I'm kind of excited about what comes next (a battle, not the next chapter... The next chapter is actually gonna be kind of a nightmare because of the breadth of locations). So maybe I'll mull things over and keep this idea on the back burner until I really need another side project...

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #143 on: May 03, 2015, 09:24:21 PM »
Oh yes, especially considering Confusion is such a small part of the game. If you have bigger fish you want to fry than I would say that's for the best. After all what was meant to be a short side-project kind of ended up supplanting Combat Boost's original version and now I am trying to think of ways to align the new ideas with what I've already accomplished or if to just release that as the new Combat Boost.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #144 on: May 03, 2015, 10:13:23 PM »
Yeah, I've been lucky enough that, with the exception of the Shadow Hack, everything I've done has been something that I've been able to work into my Big Project.
It's nice that it works as the unifying force for all (most) of my hacking endeavors, but the little side things also help me keep my sanity. Writing an entire town's dialogue, and setting all the monsters in a dungeon is wicked tedious work!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Chillyfeez's Mods, hacks, research notes, etc.
« Reply #145 on: April 10, 2016, 01:55:05 PM »
I just finished putting a new little function into TfW that I thought others might be interested in for their own projects at some point.
This is kind of a "User Options" sort of mod.
This allows you to scroll through all of the available (individual) targets in battle by pressing Y.
I developed this because I am working on a boss battle that involves seven different "Special" size monsters, which are scattered all over the screen. Since there isn't a natural formation that accommodates this particular arrangement of monsters, it's kind of hard sometimes to target a specific monster on the field. So I devised this mod so that the player can simply hit Y to scroll through available targets. Each Y press moves the target selection up by 1, instead of relying on using the D-Pad to move the cursor to where the game thinks the next monster should be. I was thinking this might come in handy for any battle that has a large number of monsters, but especially for a situation like mine.

If you want to use this assembly, by the way, bear in mind that for my purposes I used some free space realized by creating a new (shorter than what it was replacing) song. So inserting the bulk of this assembly where I did will likely cause problems, but you shouldn't have too hard a time finding a place to absorb the 53 bytes in question.

Code: [Select]
$02/B086 20 FC FF    JSR $FFFC  [$02:FFFC]   ;Normally this says "JSR $AE27" which is the routine that looks for D-Pad input

$02/FFFC 5C BD 80 08 JMP $0880BD[$08:80BD]   ;Jump to custom assembly. NOTE: BY DEFAULT THERE IS MUSIC DATA AT 880BD. I have a custom song there, so this is empty space for me, but you shouldn't have too hard a time finding 53 free bytes somewhere, and as this is a long jump, it can be anywhere at all.

$08/80BD A5 38       LDA $38    [$00:0038]   ;Load "Controller Input 2" (up/down/left/right/select/start/Y/B)
$08/80BF 85 1C       STA $1C    [$00:001C]   ;Store into 1C (probably not needed as a matter of fact)
$08/80C1 C9 40       CMP #$40                ;Compare with 40 (Y pressed without any other buttons)
$08/80C3 F0 04       BEQ $04    [$80C9]      ;If Y is being pressed (by itself) then skip the next op
$08/80C5 5C 27 AE 02 JMP $02AE27[$02:AE27]   ;Jump to regular D-Pad input routine
$08/80C9 AD 8D EF    LDA $EF8D  [$7E:EF8D]   ;Load currently highlighted target (which can be 00-07 for monsters, 08-0C for characters, FF for all monsters or 0D for all characters)
$08/80CC 1A          INC A                   ;Increase value by 1
$08/80CD C9 0D       CMP #$0D                ;Is the adjusted value 0D?
$08/80CF 90 01       BCC $01    [$80D2]      ;If less than 0D, skip the next op
$08/80D1 7B          TDC                     ;Transfer direct page (essentially, load 00 into A)
$08/80D2 8D 8D EF    STA $EF8D  [$7E:EF8D]   ;store new value into Current Target
$08/80D5 C9 08       CMP #$08                ;Is the value 08 or higher?
$08/80D7 90 0F       BCC $0F    [$80E8]      ;If not, skip to 80E8
$08/80D9 38          SEC                     
$08/80DA E9 08       SBC #$08                ;Subtract 8
$08/80DC AA          TAX                     ;Transfer A to X
$08/80DD BD C5 29    LDA $29C5,x[$7E:29C5]   
$08/80E0 C9 FF       CMP #$FF                ;Is there a targetable character in that slot?
$08/80E2 F0 E5       BEQ $E5    [$80C9]      ;If not, jump back up to the beginning of the routine to try again
$08/80E4 5C F1 AE 02 JMP $02AEF1[$02:AEF1]   ;Jump to the end of the D-Pad input routine (RTS)
$08/80E8 AA          TAX                     ;Transfer A to X
$08/80E9 BD 23 F1    LDA $F123,x[$7E:F123]   
$08/80EC C9 FF       CMP #$FF                ;Is there a targetable monster in that slot?
$08/80EE F0 D9       BEQ $D9    [$80C9]      ;If not, jump back up to the beginning of the routine to try again
$08/80F0 80 F2       BRA $F2    [$80E4]      ;Jump to the end of the D-Pad input routine (RTS)

And then there's this, which makes pressing the Y button make a sound (cuz it seemed weird for it to do something but not make noise)

Code: [Select]
$02/B90C 29 4F       AND #$4F                ;Normally, this says "AND #$0F" thus only making a sound for a D-Pad button, this change makes it so Y returns true as well
Enjoy!