Users browsing this thread: 1 Guest(s)
Patch: Doggy Miss Bugfix

#1
Posts: 4
Threads: 2
Thanks Received: 10
Thanks Given: 0
Joined: May 2019
Reputation: 0
Status
None
FF3 US - Doggy Miss Mod
version 2 (updated)
released on 11/10/2019
author: Bropedio
download

I'm not sure if this bug has been addressed before, but it seems Interceptor and Golem appear up to 80% less often than they are meant to. This patch rewrites the miss animation selection subroutine to ensure that Interceptor and Golem always appear when they successfully block an attack. From the readme:

--------------------------------------------------------------------------------
This patch fixes a bug that randomly prevents Interceptor and Golem
from blocking attacks, even after they cause the attack to miss.

After reaching the miss routine (due to Dog Block or Golem), the game
selects a miss animation at random from the combination of all available
equipment and Interceptor or Golem. If an equipment block is selected,
the miss proceeds as though it had been caused by regular evasion.

The end result of this bug is that Interceptor will appear less frequently
when Shadow's equipment enables various block animations: dagger parry,
sword parry, shield, and cape. If all 4 equipment animations are available,
the chance of Interceptor appearing is reduced from 50% to 10%, though he
will still trigger misses 50% of the time.

Additionally, this patch routes Dog/Golem past the check for
Vanish/M-Tek/Zombie status that similarly causes Interceptor or Golem to be
silently replaced with a basic "miss" animation.
  Find
Quote  
[-] The following 3 users say Thank You to Bropedio for this post:
  • Gi Nattak (11-09-2019), madsiur (11-09-2019), seibaby (11-08-2019)

#2
Posts: 3,674
Threads: 267
Thanks Received: 701
Thanks Given: 300
Joined: Oct 2011
Reputation: 60
Status
Faith
Nice catch and nice fix!
  Find
Quote  

#3
Posts: 132
Threads: 1
Thanks Received: 50
Thanks Given: 4
Joined: Oct 2015
Reputation: 14
Status
None
i never considered this a bug, but rather Square's way of accounting for what is an arbitrary order of operations, so as to not lopsidedly "credit" the dog for an overwhelming and unfair number of blocks.

that is, if Protection A can randomly block 25% of attacks, and Protection B can randomly block 25% of attacks, somebody with both protections in place actually has four categories of dodges (or lack thereof):
i. Nothing blocks the attack (9/16)
ii. Only Protection A blocks the attack (3/16)
iii. Only Protection B blocks the attack (3/16)
iv. Both Protection A and B would've blocked the attack (1/16)

the question becomes: how do we divvy up credit for the overlapping Category (iv)?  the game can't well test Protection A's and Protection B's blocking of the attack simultaneously; it has to test ONE of those things first.  maybe we decide the first check alphabetically, by dice roll, by drawing straws, zodiac sign, etc.  whatever the method, it's a bit arbitrary as to who or what goes first.  and yet because the game's code is _fixed_, that entity is going to be checked first for EVERY applicable attack on that target!  so when an attack gets blocked -- by ANY means -- that first-checked entity gets a lion's share of the credit, even though other methods of protection were just as deserving.

Square attempts to more equitably distribute the credit for blockage by putting all blocking methods with animations into an eligible "pool", then randomly choosing between these animations.  the math may not be precise, but at least they're spreading the credit around.

from what i'm reading, your patch says that equipment/relics should never be in the "pool" with Dog/Golem, and always apportions credit to whichever would-be blocker of the attack has the good fortune of being checked first.

that happens to be the dog.  but what inherently makes Interceptor more worthy of credit for Category (iv) than a big, shiny shield or a three-foot (3-centimeter actual size; objects in Match.com profile are further than they appear) broadsword?  don't some enemy attacks come in above the waist?  is a pooch truly the first line of defense against all physical threats, or would it vary with their placement or the flow of battle?  again, Square's coders had to pick *some* Protection Method to check first; it just as easily could have been the character's evasion.  in that case, would it be fair to credit gear for the many attacks the dog might have blocked?

with a fixed order of operations, somebody's a' getting snubbed -- until a random "pool" or some method of accounting for overlapping block chances is introduced.  and that's what Square does!  the merging of weapon/equipment/relic and dog/Golem block animations into the eligible pool at C2/23CB seems pretty deliberate to me, so it's hard to call a bug.

i won't deny that Square's method is somewhat crude in how animation-possessing gear gets elevated above non-animated gear.  however, it's a bit of a shorthand: if gear can visually parry/block/dodge an attack, it can get credit for the missing.  if Square assigned a high Evade/MBlock rate to a piece of gear, they're likely to also attach an animation to it, and thus make it eligible for credit.  a more precise and nuanced way than a simple random roll would probably check the Evade stats of all gear that gets put into the block animations pool, and scale the occurrence of their animations accordingly.  however, such a function would be closer to 1200 bytes, and the source of many migraines. ;P

so Square went with lesser of the evils, and decided to randomly, evenly apportion credit between eligible blockers.  imperfect, but fairer than arbitrarily favoring whichever one was checked first in the ROM code.

Interceptor claiming credit for every last miss in Category (iv) turns him from a ninja's humble companion into one of those prancing AKC dogs with the lustrous coat of fur and the needlessly perfect posture.  that is, an insufferable twat who wouldn't last 2 minutes on an actual battlefield.  he'd go from Best in Show to First in Grave!

----

EDIT: but i spose that if one views the dog as a persistently earlier line of defense than any gear, it does make sense to have his animation prioritized over equipment's rather than considered side-by-side.

challenge implications are turning Shadow into a counterattack machine, yet having Golem get used up more quickly on attacks that weren't a threat to you to begin with.
Quote  

#4
Posts: 4
Threads: 2
Thanks Received: 10
Thanks Given: 0
Joined: May 2019
Reputation: 0
Status
None
You make a good case for this having been a deliberate decision by the developers, assassin -- I had not considered that possibility, and I think you may be right. Maybe it would be better to rename my patch from a "bugfix" to something else?

I personally think of Doggy/Golem more as part of the Bodyguard/TrueKnight category, which is why I thought of the animation handling as a bug. The change I've made will definitely be a nerf to Golem and a boost to Interceptor, so some additional balancing may be called for.

If we wanted to go the other direction, and make the existing animation selection routine more intuitive, I think I would lower Interceptor/Golem's evasion chance, and apply it directly to the target's Evade during the primary evasion calculation lower in the hit determination routine. That way, the pool of available evade sources would all be handled similarly, which would better explain why they are randomly interchangeable.

As a side note, one of the BNW beta testers, Cecil, just discovered a bug with this patch, so I will be uploading version 2 shortly. The current bug will cause misses against targets without any block animations to be converted into hits, followed by removal of statuses from the attack data, just as if DogBlock/Golem had intercepted. The cause is the `CPX` op assuming that X had been set by the block bit selection code.

Version 2

I've updated the patch to reflect assassin's point about whether the code constitutes a "bug", and to resolve a mistake that was causing non-equipment misses to be treated like DogBlock or Golem by accident. See the update readme.txt inside the zip file for more details.

The initial post has also been updated with the current version.
  Find
Quote  

#5
Posts: 245
Threads: 18
Thanks Received: 109
Thanks Given: 42
Joined: Mar 2014
Reputation: 8
Status
None
I disagree with Assassin's assessment. I don't consider Golem or Dog as a buff to evasion; I view them as separate mechanics because they are explicitly evaluated separately. They have priority over blocking so their animations should also take priority and not mix with evasion animations.

It's possible that they were meant to emulate an evasion buff and were just clumsily coded, but I don't think the way the animations are handled is enough evidence to suggest such a thing when the mechanics are so explicit.
  Find
Quote  

#6
Posts: 132
Threads: 1
Thanks Received: 50
Thanks Given: 4
Joined: Oct 2015
Reputation: 14
Status
None
to be sure, i recognize Golem and Dog to have their own algorithms (including a coin flip for block chance), and not be evasion buffs per se.  but i see their early evaluation as more of a result of Square having to test *something* first (quantum computing aside), as opposed to those inherently being a consistent first line of defense.  and then Square's random animation pooling as reflecting their awareness that they were giving too much credit to Interceptor/Golem and an attempt to mitigate this.

iow, i see the Esper and Dog as layers of protection that function outside of Evade proper, but exist side-by-side with equipment protection, as opposed to one group being strictly in front of or behind another.  conceptually, which entity catches an incoming attack first can depend on unstated things like attack height or angle, flow of battle, pure chance, etc.  the animation pooling is a nod to these variances, without trying to track or evaluate them with specificity.

admittedly, some of this boils down to assessing intelligence and nimbleness of the guardians.  how "eager" and "swift" are they to block -- i.e. does it always put them out "in front" of swords and shields?  also, regarding the other modified branch, are they "stupid" enough to bother protecting a character that's clearly Clear, or a rotting Zombie?  for instance, True Knight wearers won't try to protect Clear targets, but otherwise aren't so bright.
Quote  

#7
Posts: 132
Threads: 1
Thanks Received: 50
Thanks Given: 4
Joined: Oct 2015
Reputation: 14
Status
None
Bropedio: thanks for the reply.
   
Quote:If we wanted to go the other direction, and make the existing animation selection routine more intuitive, I think I would lower Interceptor/Golem's evasion chance, and apply it directly to the target's Evade during the primary evasion calculation lower in the hit determination routine. That way, the pool of available evade sources would all be handled similarly, which would better explain why they are randomly interchangeable.

ah, so you'd be "flattening" it out some, putting the guardians on the same layer of protection as gear.

i do think it's possible to accomplish more balanced accreditation than both vanilla and your patch under the existing system of multiple layers (of non-fixed conceptual/intended order, in my view).  going back to the four categories in my first post:

Quote:that is, if Protection A can randomly block 25% of attacks, and Protection B can randomly block 25% of attacks, somebody with both protections in place actually has four categories of dodges (or lack thereof):
i. Nothing blocks the attack (9/16)
ii. Only Protection A blocks the attack (3/16)
iii. Only Protection B blocks the attack (3/16)
iv. Both Protection A and B would've blocked the attack (1/16)

suppose equipment is Protection A, and Dog or Golem is Protection B (with their own block percentages, of course).

my goals here in balancing are to:
1. not let the constancy of the $3CE4 flags lump Category iii into Category iv.
YET ALSO:
2. not let the first-checked-in-code nature of Protection B pull Category iv into Category iii.

we do not need to worry about Category ii getting pulled into (iv), because Golem and Dog block flags are only set situationally.

{Warning: following paragraph matters less than the others, and edits have ballooned it, so give it low priority until everything else makes sense.}
apportionment of credit within Category iv matters some, but it's relatively minor once we've dealt with Goal #1.  [EDIT: the fairest way is probably a simple coin flip for the broader, initial choice between guardians and gear, as opposed to the weighted way i'd implied.  once gear is chosen, then the random pooling is employed.  our mere detection of Category iv tells us that Dog/Golem and equipment/evasion were both good enough to block a given attack -- regardless of what a protection method's initial block chance was.  by this point, neither has a higher claim to legitimacy than the other, so a coin flip makes sense.  if we edited Dog's initial block chance from 50% to 10%, for instance, that would already be reflected in the sizes of Categories iii and iv being smaller; further penalization (or rewarding) within Category iv would be nonsensical double-counting.  now, if we want to show limited deference to Square's original code without a return to pillaging Category iii, we *could* keep the random "pool" method in place only as a Cat iv tiebreaker.  but it carries a representation issue, in that having more animation-eligible equipment types can "crowd out" Dog or Golem.  however, it's not so bad for Dog to be underrepresented within (iv), given a sword (for example) might be routinely underrepresented relative to a shield that has a lower Evade boost.  note that the below code does NOT yet reflect the coin flip approach.]

how to do Goals #1 and 2, and get crediting more in line with the protection layers' respective blocking probabilities?  we need to know the chances that an Esper/Pooch -blocked attack would have hit or missed on its own.  the most direct way is simply to simulate this by running Function C2/22FB!  it's a good-sized function and thus not particularly quick, but we're still keeping things to one call per execution of Function C2/220D.

the main issue, rather, is that C2/22FB sometimes returns its Hit/Miss result in Carry Flag, but not always; nor does it always return to its point of invocation.  instead, it has *3* places in C2/220D that it can branch back to.  obnoxious.

but let's pretend for sake of discussion that this function has been cleaned up to be more modular, and we can JSR the thing like a normal routine.

here is my attempt at a "fairer credit" beginning and middle to Function C2/23BF ("Determine miss animation"):

http://assassin17.brinkster.net/forum-po...p-rev2.txt

it adds 18 bytes.

because Image-induced miss is a special case relative to usual Hit/Miss as block animations are concerned, we need to duplicate the status' check here (or our overhauled Hypothetical C2/22FB can return 1 of 3 results; where's a good Trinary flag when you need one?!).  however, i do believe that despite other checks (Sleep/Petrify/Freeze/Stop, hits at target back, 255 hit rate, Retort) being performed first in C2/22FB, we can avoid duplicating them here, due to the flow of logic (e.g. the situationality of my Image check being reached in the first place).
[EDIT: this code has Image defer entirely to Dog/Golem within Category iv, in the same way that animation-less equipment is already pushed off-stage by even a single piece of gear with an animation flag.  however, i probably went overboard; Image's plain "Miss" regularly supersedes all gear in vanilla, so having it be trounced by Interceptor/Esper doesn't really make sense.  good thing this section is theoretical code that won't assemble anyway. ;P
another TODO: incorporate Zombie/Clear/Magitek check into code.]

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

read the rest as a separate post; the board software likes to merge these things.  it's a different patch with (currently) distinct goals.

Quote:a more precise and nuanced way than a simple random roll would probably check the Evade stats of all gear that gets put into the block animations pool, and scale the occurrence of their animations accordingly.  however, such a function would be closer to 1200 bytes, and the source of many migraines. ;P

bah, it's only 1/5 of that.  and a couple tension headaches at worst.  i'm too dramatic sometimes. Tongue

yes, i got bored and coded the SOB:

http://assassin17.brinkster.net/forum-po...t-rev2.asm
http://assassin17.brinkster.net/forum-po...quAnim.zip  (for headered ROM)

besides accomplishing the above quote, the other major change is that animation-less gear (along with base character Evade/MBlock) now has a seat at the table!  if you have an elite item that contributes 30% evasion but has no animation attached to it, why should its flashier yet less evasive neighbors get all the credit?!  likewise for a character who gets much of their Evade au naturel (e.g. Shadow).

so the patch scales animation occurrences (or lack thereof) by the total Evasions/MBlocks of gear with each animation, and the total of animation-less gear and base character Evade/MBlock.

once the evasion/gear route is chosen over Interceptor or the Esper, $3CE4 is never even looked at again; i evaluate from the ground up.

this patch doesn't alter Dog/Golem at all; it's INTRA-evasion crediting.

and note that the _initial_ choice between Dog/Golem and equipment animations *in general* has not been changed to reflect plain "Miss" being a choice now.  it still uses the same pool of equally-weighted animations in selecting a path.   suppose you have an active Dog block, and a graphically eligible sword and shield: vanilla gives 1/3 chance to each (so 2/3 to equipment).  to best work within that system while incorporating my change, i should probably reserve 3/4 overall chance for the evasion-based animations.  while that'd compound the existing issue of under-crediting Dog/Golem, it's probably acceptable here because:
1) remedying that issue is outside the scope of this particular patch.
2) it reflects the patch's increased stature for the plain "Miss".

yet i'm not in a hurry to change it, for whatever reason.

also, note that if there was an Evade/MBlock-boosting weapon that broke in the middle of a multi-strike turn, this patch would fail to reflect the lowered Evade stat or the loss of the weapon's block animation.  it's hard to care, but i'm obligated to mention it. Tongue
Quote  
[-] The following 1 user says Thank You to assassin for this post:
  • Warrax (11-20-2019)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite