Users browsing this thread: 1 Guest(s)
Possible solution to the sap death bug

#21
Posts: 161
Threads: 1
Thanks Received: 59
Thanks Given: 15
Joined: Oct 2015
Reputation: 16
Status
None
C-Dude:

(01-22-2021, 07:45 PM)C-Dude Wrote:
(01-22-2021, 05:26 PM)assassin Wrote: C-Dude: reading that patch's code, i am utterly failing to grasp why it should make any difference whatsoever -- unless there was a monster whose counterattack script pointer was some very high value (e.g. E000h), most likely in a hack/expansion.  do you know where this was originally posted?

thanks; no rush.  on xKas, are you using a non-Windows OS or something?

Warrax gave me the information as a short response in a hack discussion thread.  There's basically no other documentation accompanying it.

https://www.ff6hacking.com/forums/thread...l#pid37811

I got the feeling that the sap was consuming the existing counter, so the code increments the counter before proceeding so that both sap damage and the counter script execute.  I don't know the specifics, though; this is untread ground for me.  I do know it DOES make a difference, though, because without it my hack would skip the death trigger entirely on a sap tick, but with it it at least triggers the boss death animation and sounds (even if there's nothing on screen to actually fade out).

okay, that topic in turn links to an ancient Mnrogar's post, where Imzogelmo gets into the reason for making the patch.  it's indeed the hacked monster scripts with high addresses that i suspected.  so if it's helping you, it's probably because your monster's (counterattack) script pointer is a giant value (8000h to FEFFh).  and i doubt it's periodic damage/healing specific; without the tweak, such a monster would be deprived of counterattacks, period.

-----

(01-22-2021, 10:04 PM)C-Dude Wrote: @assassin
I was able to get xKas to spit out a binary file for me, which I could then transfer to the appropriate addresses in my own file using HxD.  So yay, I know how to do that now.

I had to alter your code to jump to the C0 bank and return long, since I lacked the space to fit it in C2.

thanks for testing!

Quote:It... somewhat works.  Seizure correctly triggers a monster's death counter, but it is not triggering the "Monster HP at or below <X>", the FC 06 battle script command.
I had to remove Imzogelmo's code (the block I shared earlier) to get yours to work, but removing Leetsketcher's Item/Magic counter patch (by coping the vanilla Hex from its associated addresses) made your new function do nothing.  I think there might be problems with my Vargas script, which I tweaked to handle bugs introduced by the latter patch (Leetsketcher's).

ah, re: Imzogelmo code, i'm assuming because your long jump to C0 takes 4 bytes?  one workaround would be to JSR to a 5-byte helper function in C2 that does the long call.

glad the death counter at least works. Tongue  as for the "Monster HP at or below <X>", my patch will not let anything other than FC 12/FC 1C run if they're the 2nd or later instance of Command 1Fh found in a "batch".  so that on its face doesn't surprise me ... but what *does* is how a second counter is making it into the same batch when your monster isn't even dead, IF that's even what's happening!

can you test the patch without 4bf4-code-2a2b.asm assembled (so just the other 2 files)?  while i view its changes as eminently logical (albeit of limited necessity in actual gameplay contexts), there's an off-chance its increased permissiveness is somehow expanding a batch, to where a counterattack trigger that *would* launch FC 06 is somehow becoming the 2nd+ Command 1Fh in a batch, where it'd normally be the 1st (and thus my Function C2/4BF4 code wouldn't stymie it).

i'm baffled as to why the Item/Magic counter patch's removal would affect things, as they edit different functions, and i don't read the variables that he nulls.  but there could be some complex or delayed interaction sailing over my head.  to the extent that absence of Leet Sketcher's patch lets more counters run, that could throw off the counterattack sequencing, and thus what gets loaded into a given batch, etc.

Quote:Here's my nonStandard Vargas script if you care to look at it.  I have yet to test your patch against any other bosses as I was having trouble here.
[snip]
Setting seizure and standing around to wait lets Vargas bypass the 'Off with ya now!' event.
I think Vargas is a good monster to test these things on because he's got a lot of moving parts: he's got an in-battle event, a timer, a targetability toggle, and several HP checks (well, Vanilla Vargas has several, I truncated it to one).

EDIT: If struck once by anything (even a spell that does nothing, which my status monster casts IF a status is present) after Seizure is applied, the script will run as expected.  So there seems to be an edge case where Seize is inflicted and then no other damaging exchange occurs.

yeah, really.  he's a tutorial boss in more ways than one. O_o

truthfully, i don't even follow how a non-fatal Seizure would ever trigger that FC 06 in vanilla, ignoring my and Bropedio's patches entirely.  it should be disqualified on THREE counts:
1) not a conventional turn/attack
2) originating from self
3) the monster is not dead, so no $3A56 to override #1 and #2.

has your Vargas died at all in the test battles and gotten revived somehow?  that could cause a lingering $3A56 flag, in the absence of Terii Senshi's Psycho Cyan bugfix.

really, what i suspect is happening is that your special status monster is triggering the FC 06.  is its spell being cast from its conventional script as opposed to counterattack?  without that monster there, i have a hunch that Vargas will never run his FC 06 counter, unless/until the party outright attacks him conventionally (i.e. not via Seizure or counters).

in your EDIT text, are you saying that this one strike will allow *multiple* subsequent Seizure ticks to trigger the script, or just the first one after the strike?  if the former, that's reminding me of behavior with FC 05 (or 01/02/03, but to a lesser extent, as Variable $327C [used solely by FC 05] is handled differently than the others) on vanilla.  that is, failure to clear variables used by the script commands lets things get "stuck" as long as certain, non-qualifying turns/attacks (e.g. a Seizure tick, or monster's own spell being reflected) are what inflict the damage.  however, FC 06 uses no such variable, so i dunno why it'd be affected in this way.
Quote  

#22
Posts: 282
Threads: 22
Thanks Received: 113
Thanks Given: 111
Joined: Dec 2018
Reputation: 18
Status
Moog
(01-23-2021, 05:46 PM)assassin Wrote: ah, re: Imzogelmo code, i'm assuming because your long jump to C0 takes 4 bytes?  one workaround would be to JSR to a 5-byte helper function in C2 that does the long call.
Yeah, that's what I did.  I inserted an "Extra1" label with its freespace in C2, which was a subroutine that consisted of "JSL Extra, RTS".  I then made sure to replace the RTSs in the original Extra with RTLs as necessary.  In one of them (the one I think you want me to try removing; I'll have to double-check) I also had to add a separate "DoneDone" label and turn one segment into a subroutine, because it was optimized in a way that was not conducive to moving into another bank.

(01-23-2021, 05:46 PM)assassin Wrote: i'm baffled as to why the Item/Magic counter patch's removal would affect things, as they edit different functions, and i don't read the variables that he nulls.  but there could be some complex or delayed interaction sailing over my head.  to the extent that absence of Leet Sketcher's patch lets more counters run, that could throw off the counterattack sequencing, and thus what gets loaded into a given batch, etc.
When I was first play-testing my hack I found a lot of monster scripts were not executing the way they should (and do) as compared against Vanilla.  As such, I had to do a lot of counter shuffling and code adjustment to get them to do what I needed.  I suspect my changes to the monster scripts were a necessity for the presence of Leetsketcher's patch, and without it they aren't playing out in the right way.

You're probably on the money about it allowing more counters to run.

(01-23-2021, 05:46 PM)assassin Wrote: truthfully, i don't even follow how a non-fatal Seizure would ever trigger that FC 06 in vanilla, ignoring my and Bropedio's patches entirely.  it should be disqualified on THREE counts:
1) not a conventional turn/attack
2) originating from self
3) the monster is not dead, so no $3A56 to override #1 and #2.

has your Vargas died at all in the test battles and gotten revived somehow?  that could cause a lingering $3A56 flag, in the absence of Terii Senshi's Psycho Cyan bugfix.
I do have the Psycho Cyan bugfix applied; perhaps the interaction is there. Vargas has not died and revived in any of the tests, though; with your patch applied he always correctly activates his on-death script and ends the battle, even from seize damage (and even if he skips triggering the second phase of the fight).

(01-23-2021, 05:46 PM)assassin Wrote: really, what i suspect is happening is that your special status monster is triggering the FC 06.  is its spell being cast from its conventional script as opposed to counterattack?  without that monster there, i have a hunch that Vargas will never run his FC 06 counter, unless/until the party outright attacks him conventionally (i.e. not via Seizure or counters).

in your EDIT text, are you saying that this one strike will allow *multiple* subsequent Seizure ticks to trigger the script, or just the first one after the strike?  if the former, that's reminding me of behavior with FC 05 (or 01/02/03, but to a lesser extent, as Variable $327C [used solely by FC 05] is handled differently than the others) on vanilla.  that is, failure to clear variables used by the script commands lets things get "stuck" as long as certain, non-qualifying turns/attacks (e.g. a Seizure tick, or monster's own spell being reflected) are what inflict the damage.  however, FC 06 uses no such variable, so i dunno why it'd be affected in this way.
The invisible monster casts a spell that does nothing (no damage, no statuses) but cannot be dodged.  This is so that an animation will play on screen to inform the player of certain statuses the monster may possess, such as haste or slow.  When the spell to indicate 'slow' was cast by the invisible monster against Vargas, the next seizure tick triggered his HP reaction, blowing away the party and bringing in Sabin.  Vargas then behaved as if his HP was sufficiently low for the remainder of the battle, until the seizure damage triggered his death script and he ran away.  During that time there were several more casts of the 'indicate slow' spell by the invisible monster, though not for every seizure tick.

The invisible monster's script is nothing BUT FC commands: it checks its own monster variable which counts up each turn (until it hits 8 and resets), and then attempts FC 08 counters against all monster targets.  I can share that script too if it will help.

Based on what you said, though, it seems like the spell is being counted as a 'hit' even though it did no damage, allowing the counter script to react as if it is a fresh counterattack. ...If only there was a way to guarantee that would happen, even without an animation. Perhaps a secondary spell that literally does nothing, cast against all monsters before any actual status check occurs. I'll try that after I try it without the middle file and I'll let you know what happens.

EDIT: I tried it without the $C24BFD part (the .asm file you asked me to exclude) and it seems to work the same way.
You were correct that the status monster was triggering the HP trigger; when it makes a spell cast, the FC 06 script THEN makes a check against the monster's HP, which allows that to trigger exclusively as a result of Seizure damage [it basically refreshes the counterattack].
  Find
Quote  
[-] The following 1 user says Thank You to C-Dude for this post:
  • assassin (01-23-2021)

#23
Posts: 161
Threads: 1
Thanks Received: 59
Thanks Given: 15
Joined: Oct 2015
Reputation: 16
Status
None
crap!  i meant to say try it without 4c5b-fix1a.asm (and with the other 2). Finger

sorry.  if you're up for testing that way, it'd be appreciated.  but also understood if you've reached your fill on this.
Quote  

#24
Posts: 282
Threads: 22
Thanks Received: 113
Thanks Given: 111
Joined: Dec 2018
Reputation: 18
Status
Moog
@assassin

Tried it again with the $C24CA2 spot being vanilla, and it seems to work the same way (properly triggers death script on seize damage, only triggers HP level script if an attack hits after seize is set). So I'm either not triggering the edge cases you were trying to shield against, or either script will do to fix the problem.

Hope this stuff is helping Bropedio too.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite