• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 16, 2024, 06:58:47 pm

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


ASM Request: Stat Down Skills Accept Element

Started by Eternal248, January 22, 2012, 06:10:32 pm

Eternal

Exactly what it says on the box, folks. I'm requesting that formulas 15, 1A, 1D, 2B, 55, and 56 accept elements- namely Dark- so that bosses can be immune to them. Not sure how difficult this would be to do, but I'm sure it can benefit quite a few folks.
  • Modding version: PSX & WotL
"You, no less human than we? Ha! Now there's a beastly thought. You've been less than we from the moment your baseborn father fell upon your mother in whatever gutter saw you sired! You've been chattel since you came into the world drenched in common blood!"
  • Discord username: eternal248#1817

Pickle Girl Fanboy

It makes more sense for stat changes to decay back to their original values over a period of time.  That's the hack I'd request, since it fixes all the problems with stat buffs (Yell, Accumulate, Reactions) and debuffs (SP Break, PA Break, Dances).

They should decay back to their original values at a rate of 1 point every (n) clockticks, where the modder decides what (n) is.  This will also require a fix for A Save, which IIRC increments the original stat value, though this change isn't kept after battle.

Think about it: no more Yell SCC, no more run away/Accumulate/1HKO, no more easy equipment stealing/farming, no more 5 Dancer/5 Bard kill squad, and it will FINALLY fix (as in unbreak) Speed Save.

RavenOfRazgriz

Quote from: Eternal248 on January 22, 2012, 06:10:32 pm
Exactly what it says on the box, folks. I'm requesting that formulas 15, 1A, 1D, 2B, 55, and 56 accept elements- namely Dark- so that bosses can be immune to them. Not sure how difficult this would be to do, but I'm sure it can benefit quite a few folks.


I would like these Formulae accepting various elements too.  I cannot imagine it being very hard at all, since it's just read hit rate, modify XA (except with Cancel, which sets it to 0), and these routines are already encapsulated somewhere.

Quote from: Pickle Girl Fanboy on January 26, 2012, 11:47:07 am
It makes more sense for stat changes to decay back to their original values over a period of time.  That's the hack I'd request, since it fixes all the problems with stat buffs (Yell, Accumulate, Reactions) and debuffs (SP Break, PA Break, Dances).

They should decay back to their original values at a rate of 1 point every (n) clockticks, where the modder decides what (n) is.  This will also require a fix for A Save, which IIRC increments the original stat value, though this change isn't kept after battle.

Think about it: no more Yell SCC, no more run away/Accumulate/1HKO, no more easy equipment stealing/farming, no more 5 Dancer/5 Bard kill squad, and it will FINALLY fix (as in unbreak) Speed Save.


I don't think you realize how improbable something like this would be to code, and how counterintuitive it would be for the player as it probably wouldn't display anything when your stat decrements back down.

This also wouldn't "fix" Speed Save much.  You don't need 40 Speed.  You really only need to get 3-4 points, which is pretty easy to do off an R-Ability.  If you're building more Speed than that, you're an idiot.

Pickle Girl Fanboy

January 26, 2012, 02:09:29 pm #3 Last Edit: January 26, 2012, 02:28:10 pm by Pickle Girl Fanboy
Basically, I'm requesting a hack that gives certain stat changes a CT, just like status effects.  The wiki shows that the game keeps track of both original SP/PA/MA and Current SP/PA/MA.

http://ffhacktics.com/wiki/Formula_Hacking

Quote# 0x0030 Original PA
# 0x0031 Original MA
# 0x0032 Original SP
# 0x0033 PA bonus from items & ?? (?)
# 0x0034 MA bonus from items & ?? (?)
# 0x0035 SP bonus from items & ?? (?)
# 0x0036 PA // Shouldn't this be Current PA?
# 0x0037 MA // Shouldn't this be Current MA?
# 0x0038 SP // Shouldn't this be Current SP?


As for the animation, you're right, we probably can't add a "(SP/PA/MA) decays 1 Point!" dialog along with the -1 SP/PA/MA symbol (which should be the correct color).  Not yet, at least.  But once someone disassembles and documents the routines that do this, we should be able to add this in.

I bet that FDC already encountered these routines, while moving the checks for various things to the AI flags.  I'm further betting that he already linked several of these routines to the AI flags.  It shouldn't be that much of a stretch to give stat deviations from original stat values a CT, and then to link the  -1 (stat) symbol's appearance to the triggering of the stat change decay.

I imagine it has some of the difficulties of creating a new status effect slot, since it requires most of the same things.  Namely, a CT and a link to an symbol, along with whatever is required to code the if(then,otherwise).

EDIT

Just thought of something.  This could be a way to create a "Regenerate (n) MP every turn or every (x) clockticks" hack.  Since the game keeps track of both the max MP and current MP, you could code something that checks if a unit's max MP = current MP, and if it doesn't then increment current MP by a static amount, or a % of original MP every (n) clockticks, or at the beginning of every unit's turn.  It might be a good idea not to show the increase, since it would slow the game down - unless you did it along it's own, individual CT, like the Dance and Sing moves, and have static changes to everyone which show all at once.

Or I could be totally talking out my ass.

Pride

"Original" in that context completely misleading. It is the units RAM PA/MA/SP before boosting equipment is added. Abilities or Reactions that increase those stats will still affect the "original" value. So the game does not keep track of those stats at their original value. It recalculates the units stats at the end of a battle by their raw value.
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

Glain

Argh. Why does anything ever not accept elements? Does that even make sense? I mean, you can flag an ability as non-elemental if that's what you want. The element check, and everything that goes along with it (cancel/half/weak/absorb/etc), should really be done at the end of the formula after damage is already calculated. Not to mention all the XA modification stuff (strengthen, etc) is ridiculous and should be applied to the final damage and not the XA. As it stands (for the original post) this is 6 separate hacks and probably none of the formulas have enough space, so they'd all have to be rewritten in kanji space. It seems like the right way to do this is to rewrite the entire formula section... which FDC is already doing.

PGF, your proposed change would probably require wading through tons of ASM that hasn't been documented in BATTLE.BIN and trying to figure out what it all does. Then, you'd need variables for every unit (counters) to determine what phase of the stat decrement you're currently on. Where do those go? Then, you'd need to write custom code for the code to handle all of that, which has to be put somewhere (kanji space?) How much space do we have? Space space space. Not to mention you'd have to jump to new code in tons of different routines and handle all the logistics of doing that and jumping back while preserving register values. Let's just say it wouldn't be a ton of fun.

Plus with what Pride says about the original values not being stored, you'd have to put those somewhere too (for each unit). More space, woo!
  • Modding version: Other/Unknown

RavenOfRazgriz

Quote from: Glain on January 26, 2012, 02:40:41 pm
Argh. Why does anything ever not accept elements? Does that even make sense? I mean, you can flag an ability as non-elemental if that's what you want. The element check, and everything that goes along with it (cancel/half/weak/absorb/etc), should really be done at the end of the formula after damage is already calculated. Not to mention all the XA modification stuff (strengthen, etc) is ridiculous and should be applied to the final damage and not the XA. As it stands (for the original post) this is 6 separate hacks and probably none of the formulas have enough space, so they'd all have to be rewritten in kanji space. It seems like the right way to do this is to rewrite the entire formula section... which FDC is already doing.


Final damage on basically ALL THE MULTIPLIERS is another aspect of FDC's Formula Hack I basically forced him to do at gunpoint.  With floating-point multiplication.  ALL THE ROUNDING is abolished.  Granted, this (making these formulae accept Elementshit) is still kind of a big thing for a lot of people in making stat manipulation something that can exist in the game without it being horribly derp.

Quote from: Glain on January 26, 2012, 02:40:41 pmPGF, your proposed change would probably require wading through tons of ASM that hasn't been documented in BATTLE.BIN and trying to figure out what it all does. Then, you'd need variables for every unit (counters) to determine what phase of the stat decrement you're currently on. Where do those go? Then, you'd need to write custom code for the code to handle all of that, which has to be put somewhere (kanji space?) How much space do we have? Space space space. Not to mention you'd have to jump to new code in tons of different routines and handle all the logistics of doing that and jumping back while preserving register values. Let's just say it wouldn't be a ton of fun.

Plus with what Pride says about the original values not being stored, you'd have to put those somewhere too (for each unit). More space, woo!


You used a lot more words to describe this than I would have given a fuck to.  You'd need at least 5 CTs, tons of space to actually write the "decaying" code, more room to copy over all the Raw stats for every unit in the fight before it begins, a way to adjust those Raw stats when gear is swapped or broken, etc... 

Tl;dr this ain't fuckin' happening, PGF.

Pickle Girl Fanboy

January 26, 2012, 03:01:57 pm #7 Last Edit: January 26, 2012, 03:15:00 pm by Pickle Girl Fanboy
lol I'm goin down!

Seriously though, I know I saw somewhere - probably during the discussion about changing the Unarmed Attack formula to (original PA * current PA) * (Brave / 100) - that someone mentioned A Save increments original PA.  My erroneous belief that the game tracks original SP/PA/MA led to the flash of inspiration which begat my posts.

Since your SP/PA/MA aren't updated when you level up in battle, but only after battle, I should've known that the game doesn't track pre-raw, raw, or original SP/PA/MA.  The posts in the unarmed attack formula hack topic screwed me up.

Oh well.  Something else for tethical to do right the first time.

EDIT

I also should have noticed that original refers to the stat before the equipment-based stat bonuses, which change the hardcoded minimum stat to the minimum plus the equipment bonus; since it's impossible to remove those bonuses unless you remove the equipment.

Choto

As a consolation, I believe FDC was implementing a cap at stat growth somewhere, which shouldn't be painful at all to code as you could probably integrate it into the formula rewrites. This will at least prevent most of the stat abuse. Then again I could be wrong

RavenOfRazgriz

Quote from: Choto on January 26, 2012, 05:56:05 pm
As a consolation, I believe FDC was implementing a cap at stat growth somewhere, which shouldn't be painful at all to code as you could probably integrate it into the formula rewrites. This will at least prevent most of the stat abuse. Then again I could be wrong


Xifanie wrote that.  It's completely independent of the Formula Hack for various reasons.

Choto

Quote from: RavenOfRazgriz on January 26, 2012, 06:25:42 pm
Xifanie wrote that.  It's completely independent of the Formula Hack for various reasons.


Doh, my bad. Thats why I included the disclaimer at the end. Where is that hack? I didn't see it in her hack thread.


Choto

Found it, for those interested, this was from Xifanie:

Stat gain/break cap + Maintenance prevents stat break
WW/XX = Lower Limit which the stat can be reduced.
YY/ZZ = Upper Limit which the stat can be raised.
For example, a lower limit of 1/3 and a upper limit of 1/4 for someone with 18PA, would be:
lower cap: 18PA - (18PA * 1/3) = 12PA
upper cap: 18PA + (18PA * 1/4) = 22PA
This hack takes full consideration of equipment.

BATTLE.BIN
0x000EDB8C
77777777
77777777
77777777
77777777
77777777
984B6DAC
9C4B6EAC
1980033C
CC086324
2218A300
C0010434
1A006400
10300000
D0FFC724
0300EA2C
2230A600
03000210
00000000
FC520508
21400901
9100CB90
04006B31
02000B14
00000000
22400901
3A000A10
00000000
2150C700
36004B91
30004A91
22706A01
0300CA90
30000D34
1800AA01
12500000
06800C3C
21604C01
03000714
01000D34
0300C624
02008C25
0300A715
00000000
0600C624
04008C25
CA108A91
7800CC90
7900CD90
006A0D00
2160AC01
7A00CD90
006C0D00
2160AC01
18004C01
12600000
19000B3C
1A008B01
12600000
2538C001
21708E01
WW000A34
XX000C34
18004E01
12500000
1A004C01
12500000
2250CA01
22504701
YY000B34
ZZ000C34
18006E01
12580000
1A006C01
12580000
2158CB01
22586701
2A680A01
02000D10
00000000
25404001
2A686801
02000D10
00000000
25406001
1580033C
8C4B6A8C
904B6B8C
944B6C8C
984B6D8C
9C4B6E8C
63000634
6B350608
01000734

BATTLE.BIN
0x00126598
1580033C
8C4B6AAC
904B6BAC
E8520508
944B6CAC

Does this mean that if you have an item that gives +X PA, and it gets broken, and the decrease would bring it below the cap, it would stay at the cap instead of falling lower? run on sentences ftw


Rfh

Choto, Can you post the only part of the hack ''Maintenance prevents stat break''
  • Modding version: PSX
  • Discord username: rfh

RavenOfRazgriz

Still pushing for someone to actually fulfill Eternal's request here.  The Stat Break Limitation hack is a sub-par answer because there's no player-end feedback for knowing when the "cap" on either side was reached, and according to Austin it apparently has quite a few bugs anyway in terms of both function and display.

Glain

Does anyone know if calling elemental cancel (0x00186ff8) at the end of a routine that does something other than damage would work, or would we have to slog through "Is the element cancelled? Branch to somewhere where we don't perform the action!"?
  • Modding version: Other/Unknown

Glain

How about a universal elemental-cancel hack, or even a broader universal elemental-everything hack? Any reason not do it that way?
  • Modding version: Other/Unknown

RavenOfRazgriz

Quote from: Glain on February 14, 2012, 05:09:33 pm
How about a universal elemental-cancel hack, or even a broader universal elemental-everything hack? Any reason not do it that way?


I can't think a reason not to.  Can you do a pair of universal status routine too, one regular and one 2D-ified?  Just grab any flag that seems unused and set it as a flip-switch.  I mean, fuck, may as well go the whole nine yards if you're gonna do it.  I assume this'll also have the Weapon Strike fix built-in too, with that random unused flag being used as the on-off switch for weapon element. 

Tl;dr - Do everything, do it right the first time.

Glain

Nah, I'm not looking to do any of the other stuff here; too messy. The only thing I'm thinking about doing is adding the call to 0x00186ff8 to the routine that calls the formulas, right after the formula call. Except now that I've investigated it, I think "apply elemental" is a better name than "elemental cancel". It's got control statements for half/weak/cancel/absorb, multiplies "weak" damage by 2, halves "half" damage, etc, and nullifies "cancel" actions (sets them to 0% hit among other things).

It even checks to see if you have oil status and multiplies XA by 2 for fire abilities, but I think where I call it, it's gonna be too late for that, because we've already calculated damage, unless I hack it to just modify the final damage.
  • Modding version: Other/Unknown