News:

The forum has been updated to SMF (2.1.3)!
Please be patient as we work to polish up the place and update features as we can.

Main Menu

Ailment and Debuff Formulas

Started by Rolina, 06, October, 2012, 09:00:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Aile~♥

They certainly do activate a lot, and are indeed effective boss-killers, but it's been my experience that they don't activate as often as it seems like they should against many bosses.

May Ignore 50% of Defence I think has a flat 50% activation rate, though I may be mistaken. The "Ignores Defence" effect is theoretically 100%, but it doesn't seem to be work out that way for me.
[sprite=16, 6, 0]:P[/sprite]

Lloyd: Easy as pie.
Genis: Sweet!
Presea: ...Sweetie pie...
Zelos: Let's not start on this again...

[spoiler=epic mindscrew][/spoiler]

Rolina

If luck does affect these, than a high luck unleash character would be freaking godly...  We've got to figure out how specifically these mechanics work, because if that works for more than just ailments, then it opens up one hell of a lot new options, such as varying degrees of effect activation (May do 2x damage, low rate - May do 2x damage, mid rate - May do 2x damage, high rate, etc)

Aile~♥

No, not your own luck, the target's luck. At least, that's what I think. Maybe I'm wrong.

But there are already 2 different versions of the damage multiplying effects which to the best of my knowledge have different effect rates. It seems like the 2x damage and 3x damage effects that appear later in the effect list trigger more often.
[sprite=16, 6, 0]:P[/sprite]

Lloyd: Easy as pie.
Genis: Sweet!
Presea: ...Sweetie pie...
Zelos: Let's not start on this again...

[spoiler=epic mindscrew][/spoiler]

Kide

QuoteIt seems like the 2x damage and 3x damage effects that appear later in the effect list trigger more often.

Exactly. And that's why I believe those effects don't depend on Luck, otherwise there would be distinct base chances for the same effect. (Although that's still possible, but make less sense in my mind...)

Aile~♥

Or it could be that the alternate 2x/3x damage effects work the same way effects number 67, 80, and 85 work.

At any rate, the HP to 1 effect is most definitely affected by Luck.
[sprite=16, 6, 0]:P[/sprite]

Lloyd: Easy as pie.
Genis: Sweet!
Presea: ...Sweetie pie...
Zelos: Let's not start on this again...

[spoiler=epic mindscrew][/spoiler]

Daddy Poi's Oily Gorillas

#25
It's unlikely that 2x and 3x damaging effects generate 3 random numbers like those three effects, or else I would have noticed them in that function. I will indeed try to research them in-depth to see how they are different, though.

During my research, it seems like some effects labeled "?" may actually do something..



This is in the Start a turn function.  Most notably includes your action choices. (AKA: Attack, Defend, Item, Psynergy,Djinn, Summon, etc.) It is used during the actual attacks, and not during the selection of the attacks.
Quote from: wordpadCode: 081244F8

65 = May cayse double the damage
41 = ?
42 = May cause double the damage
43 = ?
44 = May cause triple the damage
68 = May cause triple the damage
89 = May multiply damage by 1, 2, or 3


0812451A = Code for effect 89.

Set the R6 value:
08124562 = Code for effects 65 and 68 ; R6 = x99
0812456E = Code for effect 41 ; R6 = x40
08124574 = Code for effect 43 ; R6 = x20

Set the R5 value:
0812457E = Code for effects 65 and 41 ; R5 = 2
08124588 = Code for effect 42 ; R5 = 1

0812458E = R0 = random number
08124592 = Random number is of byte.
08124596 = Checking random number against R6.

stuff...


081245D2 = Code for five effects:
36 = ? ; R5 = x3F (6 bits) 1.5625% chance?
37 = ? ; R5 = x1F (5-bits) 3.125% chance?
38 = ? ; R5 = xF (4-bits) 6.25% chance?
39 = ? ; R5 = x7 (3-bits) 12.5% chance?
40 = ? ; R5 = x3 (2-bits) 25% chance?

0812460E = Random number And R5



08124696 = ? = Calculate_Ailment_Success (Return Boolean)

As for the ailment success function. Effects could be assigned a costant base percent without the formula, or they could be assigned a base percent with the formula, I will look into these specific effects soon to see if they differ.



The unk_arg in the ailment success function I believe is supposed to be used with the "/100" to make a percent. This percent is probably for use with multi-target attacks. ; From center to outside: 100%, 60%, 30%, 30%, 30%, 30%. Atleast in the damage formula, anyway. ; (In the Start A Turn function, I see this value is 100%, but I'm not sure how that one is used, as I think that one may be executed only in certain cases, not sure how it works yet.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Rolina

Quote from: Kide on 02, November, 2012, 05:54:05 PM
QuoteIt seems like the 2x damage and 3x damage effects that appear later in the effect list trigger more often.

Exactly. And that's why I believe those effects don't depend on Luck, otherwise there would be distinct base chances for the same effect. (Although that's still possible, but make less sense in my mind...)
It's also why I wondered if caster luck was taken into account for those, despite it not usually being the case.  Maybe some are affected by luck, but others aren't.  Attacks like "May pierce 50% defense" and "May drop HP to 1" this makes sense for, but others, namely the chance for multipliers, it kind of... doesn't.

Salanewt

#27
Quote from: Teawater on 09, October, 2012, 11:52:55 AM
It looks like there's a part of the code where if defender's luck is 40+, about 8 of the effects are given a chance of 0%. (For example, x18 and x19 (May Inflict Poison/Venom)

Effect's can also have a base chance without a formula (When their numbers are negative ), but when the formula is used (x0-x64), I think it looks like this: Not sure if I made any mistakes.

success =
(((((((Attacker's elemental level - Defender's elemental level) - Floor(Defender's luck / 2)) * 3) + effect's base chance + (vulnerabity's 25)) * unk_arg) / 100)  >= rnd())

Notes:
x52 = "82 - May force target out of battle" is always 0% when class is not NPC. (0% for player characters?)

These generate three random numbers... This would make, for example, a chance of 50% (one) to be 87.5% (three), I think.
x43 = "67 - Inflicts Seal"
x50 = "80 - Inflicts Death Curse"
x55 = "85 - May inflict Stun"

Hopefully I didn't get anything backwards or messed up. I've only looked at the stuff from 080B08C2 and down, but there may be some stuff above this address that may have conditions for when this formula is skipped.

Where attacker and defender labels are placed are just assumed, I didn't double check them, but it wouldn't make much sense otherwise.

Good day! Just a bit curious, but would you mind explaining what "unk_arg" and "floor" mean in this instance? It kind of looks like you were saying that "unk_arg" is an unknown argument that may be related to calculating success rates for multiple enemies and/or the diminishing base damage formula, but it's just a bit too confusing for me to be sure.

It also looks base success rates are not assigned to any ability effect above #85 or below #8, meaning that anything outside of the 8-85 range either has a success rate of 100 (such as attack buffs) or one that is calculated differently (such as revive only working on downed units, etc.); these all branch to the 100% success rate value. Each effect within this range has a pointer that goes to its success rate value, meaning that a lot of them are shared among effects. There are also 16 base success rates. Of course, there are a couple flat duplicates in here, so I'll just list the success rates and provide some examples of effects that use them.

Base success rates (assigned in the function at 080B0514):
080B0660 - 70% (12/13 - Def debuffs)
080B0664 - 75% (16/17 - eRes debuffs)
080B0668 - 30% (22 - Charm)
080B066C - 45% (24 - Sleep)
080B0670 - 55% (18/19 - Poison/Venom, 25 - Seal)
080B0674 - 25% (26 - Haunt)
080B0678 - 20% (27 - Instant Death)
080B067C - 65% (20 - Delusion, HP Drain)
080B0680 - 35% (21 - Confuse, 34 - HP to 1)
080B0684 - Flat 60% (56 - Revive to 50%)
080B0688 - Flat 90% (57 - Revive to 80%)
080B068C - Flat 70% (73 - Revive to 60%)
080B0690 - 60% (8/9 - Attack debuffs, 28 - Curse, 32 - PP Drain, 80 - Curse)
080B0694 - 50% (35 - May ignore 50% of Def)
080B0698 - 40% (23 - Stun, 85 - Stun)
080B069C - Flat 100% (Def buffs, eRes buffs, Regen, Reflect, Break... seems to be the default for anything that either shouldn't fail or has its success rate calculated differently)


One point of interest is that the HP% revives actually seem to have a +10% success rate over the amount they revive you to. So like, 50% revive has a 60% success rate. It's still kind of dumb, but at least this mostly rules out the likelihood of the two being calculated in the same code. These are only base rates of course, so you still need to keep the formula(s) in mind when thinking about this.

So yeah. Hope this helps!

Edit: Teawater pointed out that the revive effects were flat success rates, meaning that they don't actually use the formula at all. Forgot to mention this, so I have tweaked the list to show this.
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

Daddy Poi's Oily Gorillas

#28
floor means round-down. So if your defense is 3... 3/2=1.5, 1.5 is rounded down to 1.
ceil would be round-up, but it's not used in this case, so...
round, you already know, (Anything below .5 is rounded down, anything above or equal to .5 is rounded up.)

@unk_arg, I think that's what it is.. Effects that cover over multiple enemies. The target being 100, and every enemy away being a lower number as so. (At least, that's what I think it is?)

(And when I say "argument" I really mean "argument". Because it's coming from the function's argument itself. (If I remember correctly.)


Hm... looks like the revives have flat base rates? If they branch to  080B069E, it's made negative, which cancels the formula.

I wonder if I studied something else on Revive a long time ago? Time to see what it was I was thinking... Edit again: It appears documenting it back then has proven to be useful!
Quote080B0740 = Ability_Effect_Revives(ability_effect) //If effect revives, return 1, else 0.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Salanewt

#29
Oh yeah! No idea why I didn't realize that before, but I know what that means. Thanks!

"unk_arg" makes sense. I could see it as being 100 for primary targets (or for target:all units), and then declining more the further away the other targets are from the primary target.

I think so, yeah; I should probably edit the previous post to mention that. I'm pretty sure there is a function in the general vicinity of this and the success rate calculation one that has something to do with the revive effects that you looked into.


Edit: Just to make sure, does the elemental level value part of the formula only count the level of the ability in question? Because unless I've failed with my calculation, it kind of looks like instant death (/condemn) can only have a success rate of up to about 58%, and this is if your elemental level is 13, theirs is 0, their luck is 0-1, they are vulnerable to it, and are the primary target. If I did this correctly though, then this means that delude and HP drain have a 103% success rate under similar conditions.
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

Daddy Poi's Oily Gorillas

#30
080B07AA = Function call is here.

It's in the same function as the formula, but this is near the beginning of the function. (I forgot what it does, but I do think that it's possible that I may have studied this entire function a long time ago.)

That part pretty much exits the function if you're using a Revive effect when you still have HP. (success=0)


@Your edit:

Elemental level code is at 080B0A08. There are two function calls pointing to the same function:
080B0028 = get_elemental_level(pc,element)

@Instant death
13 *3 = 39 + 20 = 59 + 25 = 84.

I wonder what happens when the ability is a non-element. I think it's a "0" for elemental levels.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Aile~♥

I would guess that elemental level for a non-elemental attack is assumed to be either 0 or 5. Either one has the same end result in the calculation.
[sprite=16, 6, 0]:P[/sprite]

Lloyd: Easy as pie.
Genis: Sweet!
Presea: ...Sweetie pie...
Zelos: Let's not start on this again...

[spoiler=epic mindscrew][/spoiler]

Daddy Poi's Oily Gorillas

It's 0. (You are right since x minus x is 0) By the way, I edited my post 5 minutes before you posted. :)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Salanewt

Oh, whoops. Missed one of the brackets in the formula!

Well that makes it a bit better then. Still not ideal when considering that eLevel differences are usually much smaller and luck levels tend to be somewhere above 0 more often than not, but it's better than I thought. Thanks for pointing that out!
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

Aile~♥

Well, it's even worse than that since there normally isn't more than one spell to inflict any given ailment, and you aren't necessarily likely to have a particularly high elemental level in the element the foe is weakest to. So it's quite difficult to target a boss's weak point with an ailment.
[sprite=16, 6, 0]:P[/sprite]

Lloyd: Easy as pie.
Genis: Sweet!
Presea: ...Sweetie pie...
Zelos: Let's not start on this again...

[spoiler=epic mindscrew][/spoiler]

Salanewt

That's a good point, especially with most ailment abilities being either earth or wind-based. Anyway, I guess I can do one real example then. Dullahan and Dull (let's go with the Pure Mage class).

(((((((5 - 10) - Floor(59 / 2)) * 3) + 60 + (25)) * unk_arg) / 100)  >= rnd())

((-5 - 29) * 3) + 85 >= rnd())
= -102 + 85 >= rnd())
= -17% success rate >= rnd())
= Probably > 0, given that the effective floor is likely not a negative number (unsure) and that the rnd would probably make it a positive value. I think Teawater would have to clarify how the >= rnd()) part works to be sure, since I haven't really researched this stuff much myself.


Unless I horribly messed up again, that's still pretty bad. I'm positive it will still technically work if the RNG likes you enough and lands the effect anyway, it's just that the window for it to do so is really low.
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

leaf

Luck is broken =3c

Although I don't see how it could "technically work" if the success rate is being calculated as negative.
[spoiler=quotes]
[9:00:50 PM] Randel Peltier: Ok...what did I do last night?
[9:01:19 PM] Kain: Something boring, repetitive, and lasted for about sixty seconds.
---
[10:45:08 AM] Salanewt: But yeah, the elemental phalluses are being... Stroked up by Saturos and co., and the energy will go towards... Mt. Muffin, where the Golden Climax will arise.
[7:28:42 PM] Salanewt: An added bonus is that Isaac and co. were trying to stop Saturos and co. because their beliefs state that Mt. Muffin should remain a virgin.
---
[9:54:21 PM] Randel Peltier: Guess the number in my head an you get to pick what I say. Number between 1-10
[9:54:28 PM] leaf: 11
[9:54:36 PM] Randel Peltier: @#$%!
---
[8:38:13 PM] Randel Peltier: Shes like this queen up on a pedastal that I have yet to court.
[8:38:29 PM] Kain: You've tried courting her.
[8:38:43 PM] leaf: and failed spectacularly
[8:38:44 PM] Randel Peltier: Ive tried...shes the best dating game ever.
---
[12:24:35 AM] Salanewt: I need to find a picture of a naked person to put on the Christmas tree next year.
---
[2:19:06 PM] Zeadra: wait... Rief's a guy???
---
[1:09:57 PM] Zeadra: well if you want to know if its a new effect or something weird, just check GS1, if side step is there maby it is the nimble dodge thing
[1:10:35 PM] Kioll: For once, you've contributed something useful.  o.O[/spoiler]

Daddy Poi's Oily Gorillas

#37
@rnd() It amounts to generating a random percent up to like... 99.

The function is at 080B039C. (You'll see the call at the end of the formula.)

Basically, that function generates a random 16-bit number, multiplies by 100, then shifts out 16-bits. Which means you get a random percent from 0x0 to 0x63. ; 0-99 in dec.

0x0000 * 0x64 >> 16 = 0
0xFFFF * 0x64 >> 16 = 0x63

-17 will probably fail everytime?

@leaf: Maybe, maybe not... Maybe status ailments aren't meant to be used on bosses?
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Salanewt

Haha, probably wouldn't work most of the time! I'm just not entirely sure because Eclipse can sometimes lower it's attack (at least from what I remember, may be fuzzy). Kind of makes me wonder if summons maybe bypass elemental levels or something, since that seems to be the only way it would actually work at all.

So I take it that the ">= rnd()" part of the formula basically means that an effect is only guaranteed to work if it's at 99% or higher? Since that's greater/equal to rnd, which can be 0-99.

As far as using status ailments on bosses goes, I don't know. They could have made bosses immune to the deadlier ailments and/or effects without having to rely on luck or the formula to do it at any rate. So like, instead of a 40+ luck check, they could have included an enemy ID check to make a few groups of enemies and/or bosses immune to certain effects and then maybe had a luck check at 90+ or something. :/
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

Aile~♥

The point leaf is making is that that's the minimum possible hit chance (either 0% or 1%) to hit the boss with the ailment it has vulnerability to, and that's not even with capped Luck. Plus, that's the only class that gets access to Dull to the best of my knowledge, anyway.

Eclipse could theoretically have a debuff rate on Dullahan if being summoned by a Wind Adept character with 9 Jupiter Djinn set. (So Sheba summons Eclipse while Ivan supplies the Jupiter Djinn for the summon, for example.)

(((((((14 - 10) - Floor(59 / 2)) * 3) + 60 + (25)) * 100) / 100)  >= rnd())
= ((4 - 29) * 3) + 85 >= rnd()
= -75 + 85 >= rnd()
= 11% success rate if you can roll 0.

In fact, you actually require a Jupiter elemental level of 11 to have a 2% chance of dropping Dullahan's attack. (Again, that's assuming the percentile die used to calculate effect rate can roll 0.)
[sprite=16, 6, 0]:P[/sprite]

Lloyd: Easy as pie.
Genis: Sweet!
Presea: ...Sweetie pie...
Zelos: Let's not start on this again...

[spoiler=epic mindscrew][/spoiler]