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

Master Formula List

Started by Salanewt, 25, May, 2014, 01:47:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Salanewt

#20
Well, the second one isn't a check at all; merely an observation I made when I was researching this. If you cap your characters at those values, then you can guarantee your desired turn order 100% of the time. When you factor in gear, classes, buffs and so forth, then you can change around your turn order fairly easily. Granted, since reaching those agility values isn't very likely, you would almost be further ahead to try figuring out what agility values you would expect your characters to have by the end of the game and work with that.

In other words, exactly what leaf said! I think he once mentioned that dividing those values by two would give you your "practical use caps" for a normal save file.

Other than that, you've got it.


Edit: Healing and Regenerate formulas are up; they are pretty simple as far as calculations go. I probably won't do the HP% ability effects because those don't use a consistent formula, and I likewise won't add any custom formulas until there is a decent collection of vanilla ones in the first post.
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?

jjppof

The value returned by the Ailment Success formula is X.
   if X >= rand(0, 65535): the ailment was successful

Is it right?

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

floor() always rounds down and to a integer?

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

I didnt understand these 3 terms:


  • effect's base chance - are these values given?
  • vulnerabity's 25
  • unk_arg

Salanewt

#22
I think in this case, it's actually a random number from 0-99 (x00-x63) and it will always succeed if you get 100% or higher. I should probably add this to the first post...

Floor(luck) rounds down because it doesn't use decimals; for example, a luck value of 60 is pretty much the same as a value of 61 in this case. Both will be 30 when you divide them by 2.


As for the other three terms:


  • Base chance/rate: Yep! There's a spoiler tag in the first post that lists the rates along with most (if not all) of the effects that use those rates. A flat rate means that it doesn't use the formula, while the rest of them will.
  • Vulnerability 25: Each class has three values which correspond to ability effects; if there is a value above 0 in a class, then it will add +25% to the success rate of that effect. Enemies also have these three values that correspond to ability effects. If looking at them in the editor, they will be the numbers at the bottom of the class section and the ones above the elemental tables for enemies.
  • Unk_arg: We're not actually too sure on what it does. Teawater thinks it has something to do with multi-target effects, but I currently have a theory that it might have something to do with whether the "effect only" formula is being used or not. I'm sure one of us will test it in the relatively near future.

I hope this helps!


Oh yeah, I forgot to mention that the poison (battle) formula is up! Well, more like a calculation than a formula, but still. It's pretty powerful!
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

#23
Quotefloor() always rounds down and to a integer?
Correct. Floor(25.6) = 25. Floor(25.1) = 25. Floor(25.9999) = 25. etc. It's identical to a truncation for positive numbers, e.g. Floor(25.55) = 25 and Trunc(25.55) = 25, but differs in the case of negative numbers, where Floor(-25.55) = -26, and Trunc(-25.55) = -25. Since we pretty much never deal with negative numbers in games, the difference is mostly academic.
[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]

jjppof

Which 3 values are you saying?
I see 2 values for party members in class section and 4 values for enemies in enemy section.
If one of these values is higher than 0, the Vulnerability  is 0.25? If not, 0?

just few enemies have all 4 fields 0 and they are strange enemies.
Can I let it 0.25 fixed?

And for a while, I will let the unk_arg = 1.

And I didnt undertand the spoiler table with the rates:
35% (24 - Sleep), for example. The base value is 0.35 or 24?

Salanewt

#25
Oh yeah, I have a slightly different version of the editor that displays those correctly. Um...

The two values in the party editor are actually supposed to be four 8-bit values (with only three of them being used) rather than two 16-bit values. If you convert the number you see in that picture to hex format and separate the numbers, you should have effects x1F and x3C. Converting these to decimal again would give you ability effects 31 (may drain HP) and 60 (recover 50% damage to HP). As far as I can tell, most of the classes only use up to two vulnerability slots each despite three being available. As for the enemy editor, the box on the right does nothing at all; you can pretty much ignore it. Both classes and enemies can have them all at 0, or they can use all three.

I don't really understand what you mean by the ".25 fixed" part, would you mind clarifying that question a bit?

And lastly, the base values are whatever ends with a % symbol. The brackets merely list a bunch of the effects that use those percentages.
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?

jjppof

#26
Nooooooow I got this "class ability"... nice nice nice....

If a certain class havent a certain ability, I let the base 0, right? Its summing...

------ wai-wait..... hahahaha editing.......

If a char has a class that has these abilities:
Sleep and Haunt (2426)

This char will put someone to sleep, so the formula is:

(((((levelRate - floorThing) * 3.0) + 0.35 + 0.25) * unk_arg) / 100.0)

noow... this same char will poison someone else, so the formula is:

(((((levelRate - floorThing) * 3.0) + 0.55 + 0) * unk_arg) / 100.0)

right?

Salanewt

I think I understand what you're asking now! So...

The base rates in the spoiler are used in the formula regardless of whether a class/enemy is vulnerable to it or not (with the only exceptions being the flat success rates, as those don't use the formula). All a vulnerability does is add +25% to the value calculated earlier in the formula, and it won't do this if the class/enemy does not have a particular vulnerability. I guess it basically makes +0% the default, yeah.


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?

jjppof

#28
(((((((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())

for the elemental level, what is the element? Which of the four element I choose? Element of the skill I'm casting? Ask is good... hahahahaha


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

see how the code is:

function state_rate(caster, taker, state_id, skill){
    element = skill.element_id
    levelRate = 0
    if caster.isEnemy
       levelRate = eLevel_Enemy[caster.id][element] - eLevel_Ally[taker.id][element]
    else
       levelRate = eLevel_Ally[caster.id][element] - eLevel_Enemy[taker.id][element]

    floorThing = (caster.luck/2).floor

    baseChance = getBaseChance(state_id)

    unk_arg = 1

    abilities = getAbilities(caster)
    vulnerabity = 0
    if state_id in abilities
       vulnerabity = 0.25 
 
    value = (((((levelRate - floorThing) * 3) + baseChance + vulnerabity) * unk_arg) / 100)
    return value
  }

//in other function....
[...]
if rand(0,99) <= state_rate(caster, taker, state_id, skill)
        add_state(state_id)
[...]

leaf

Yes, element of the skill you're casting. So if you're casting haunt, you would use venus elemental levels for the attacker and defender. If you're casting delude, you would use the jupiter elemental levels for the attacker and defender. And so on.
[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]

jjppof

Ailment Recovery

(((Luck * 3) - (Turns * 5) + base_chance) * 655) >= rand()

Every turn I have to check this?

Daddy Poi's Oily Gorillas

#31
Quoteunk_arg = 1
This should be 100. (Or you could leave it if you get rid of the /100 part.)

Think like this: a * 100 / 100 = a * 1

Anyway, it still looks like unk_arg is for multi-target.

First (Primary Target) = 100%
Second (Next to the target) = 60%
Third = 30%
Forth = 30%
Fifth = 30%
Sixth = 30%

But if you want to use decimals... then be my guest. ( a * # without the /100 in the equation. For example, a * 0.6)

QuoteEvery turn I have to check this?
Yes.
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! :)

jjppof

#32
Quote from: Teawater on 06, June, 2014, 01:21:11 AM
QuoteEvery turn I have to check this?
Yes.

But which states I have to check this? I cant have this check for downed, for example.

------------
and this unk_arg = 100 for the main target
                       = 60 to the next to
                       = 30 and so on
                                 ?

Daddy Poi's Oily Gorillas

#33
There might have been a chance that I misread...

If you're asking where the checks should be done, I believe it is done at the end of a Round. (After everyone has taken a turn.) Hopefully I read that right. ; I believe that the check is made for each character, so that's probably how I misread.)

*Went back to quickly double check something*[spoiler]81247F8 = End

Random chance of recovering from an ailment/debuff
(((Luck * 3) - (Turns * 5) + base_chance) * 655) >= 16BIT[rand()]
Attack = 30%
Defense = 20%
Resistance = 20%
Delusion = 30%
Confuse = 60%
Charm = 70%
Stun = 20%
Sleep = 50%
Psy-seal = 30%
08124810 = Start
08124850 = End

08124854 = Decrement Attack (De)Buff Turn Duration
081248B4 = Decrement Defense (De)Buff Turn Duration
08124914 = Decrement Resistance (De)Buff Turn Duration
08124974 = Decrement Delusion Turn Duration
(Sees clearly once again.)
081249B0 = Decrement Confuse Turn Duration
(Regains consciousness.)
081249EC = Decrement Charm Turn Duration
(Regains consciousness.)
08124A28 = Decrement Stun Turn Duration
08124A64 = Decrement Sleep Turn Duration
08124AA0 = Decrement Psy-seal Turn Duration
(Psynergy seal)
08124AF8 = Decrement Regenerate Turn Duration
(Recovering HP)
08124B56 = [18][1]'s HP is fully restored!
08124B68 = [18][1] recovers [22] HP!
08124BA8 = Decrement Reflect Turn Duration
08124BCC = Decrement Agility Buff Turn Duration
08124BFC = Unknown (Djinn-related)
08124CAC = Unknown (Djinn-related) (Linked from pub only.)
08124CC0 = Return
08124CC4 = Start
08124D92 = [21] is set to [18][1]!
08124E1A = End

End of round (+ status effects)
08124E20 = Start of function.
08124F0C = [21] is set to [18][1]!
0812501E = Approximate location for setting Counter-Attack (Reflux) to 0.
081250A8 = [18][1]'s HP is fully restored!
081250B0 = [18][1] recovers [22] HP!
08125104 = [18][1]'s PP is fully restored!
08125120 = [18][1] recovers [22] PP!
08125150 = [18][1]'s Agility returns to normal!
0812517A = [18][1]'s Attack returns to normal!
081251A4 = [18][1]'s Defense returns to normal!
081251CE = [18][1]'s Resistances return to normal!
081251F8 = [18][1] sees clearly once again!
08125222 = [18][1] regains consciousness! (3306)
0812524C = [18][1] regains consciousness! (3310)
0812527C = [18][1] is no longer stunned!
081252AC = [18][1] wakes from slumber!
081252D6 = [18][1]'s Psynergy seal is gone!
08125300 = [18][1] stopped recovering HP!
0812530C = Call Decrement Reflect Turn Duration
0812532A = Reflect no longer affects [18][1]!
0812535A = End of function.[/spoiler]Apparently, my documentation didn't list it detailed enough...

"But which states I have to check this?" = states? *confused and feels lame for not understanding*

Each character has a series of bytes for each status effect counter. For example, you'll need 5+ Sleep count-downs, one for each PC and enemy, and 5+ for Stun, and everything else that counts turns.., I forget what happens when your character is Downed, but I could assume you could set all these count-downs to 0.



@unk_arg = Yes, pretty much... it stops at "Sixth" (11 characters) because going further is not supported.
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

#34
I think you're actually supposed to be cured of everything when you are downed though, so it shouldn't check in that instance anyway. It's actually one of the easiest ways to get rid of haunt if you're somehow broke and have Revive or something.

Cool, thanks for the info Teawater! I'll add it to the first post.


And... Researching the "effect only" formula right now. Some of it seems pretty complicated, but I have figured out this much so far:

((Output Damage * 100)/100)/(Multi-Penalty)
Multi-Penalty = 1 for primary target, 2 for secondary, 5 for tertiary, 10 for quaternary


I'm still trying to figure out exactly how "Output Damage" is calculated, but it does involve using the difference between the attacker's ePow and the defender's eRes stats. This shared function also has some code that defines the max eStat difference range to be from -199~200, so a difference that is a greater or lesser amount than one in that range will simply be overwritten with the floor or cap. Basically, this means that there is no difference between ePow/eRes stats of 0/200 or 50/250 (ignoring the cap of 200 of course).


Edit: Renamed "unk_arg" to "multi_arg" in the formula, seeing as it's not an unknown variable anymore.
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

QuoteMulti-Penalty = 0 for primary target, 2 for secondary, 5 for tertiary, 10 for quaternary
So I'm guessing you meant it should be 1 for the primary target, unless it has infinite success rate >_>
[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

#36
--- Part 1: Defense Mod(?) ---

@Multi-target for Effect Only: Are you sure that's multi-target?

"1" = 1/2 (0200064B is 1 when Isaac's defending. Maybe that's how Defend's defense is done?)
"2" = 2/5
"3" = 1/10

So that you can understand how the scaling looks:
"1" = 5/10
"2" = 4/10
"3" = 1/10


--- Part 2: Multi-target damage ---

Anyway, as for Multi-Target Damage, the percents are:

100%
50%
30%
10%
10%
10%


--- Part 3: My attempt to look at the formula ---

For the formula, I'm seeing..

damage * unknown * (multi_target_value_out_of_100/100) * defense_mod

Notes:
damage = includes the elemental mod.
unknown = Too lazy to look up at the very moment.
multi-target = see second part of post.
defense_mod = See first part of post.
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! :)

jjppof

#37
I will try to express me better...

Every turn end I have a function that apply the recovery formula and update the states tuns count:

function update_state_turns(){
  foreach state in chars: //loop all states of all chars in battle
     actualChar = state.getActor
     luck = actualChar.luck
     actual_state_turn = state.turnCount
     recoveryBaseChance = getRecoveryBaseChance(state.id)
     formulaValue = (((luck * 3) - (actual_state_turn * 5) + recoveryBaseChance) * 655)
     randomNumber = rand(0, 65535)
     if formulaValue >= randomNumber
       remove_state(state.id)
     else
        state.turnCount -= 1
  }
}

function end_turn{
[...]
  update_state_turns()
[...]
}


What I'm asking is:
this method update_state_turns is checking all kinds of states, including downed (hahahahaha every end turn a char has a chance to revive). Beyond this state, which others can't be checked?
I dont know, but haunt and poison cant be recovered by this formula, I guess....

Salanewt

#38
leaf: Oops, that's right! Fixed it.

Teawater: I was pretty sure, but I just double checked and I think you might be right. Defending cuts almost all damage in half, and I tested the code with a 3-target Drain spell. Whenever I switched the primary target between two enemies, the secondary enemy always took half the damage it took when it was the primary target; neither of them had the defend command to begin with. That's why I was mistaken.

That being said, I don't see one for the "95% damage decrease" effect in here. I guess that might be because it was added in GS2 and Camelot figured out a better way to calculate it. Or something.

As for attempt 3, that's pretty much what I have now. That "unknown" part is what I'm looking into right now, and that's what uses the ePow/eRes calculation code to modify the base damage. It looks like almost every damage formula uses it, so figuring this out would make figuring the rest of the formulas out much easier. I think.

And... here's exactly what I have now in my .txt file, with your corrections in place:

Base Damage
(
(Output Damage(multi_mod * 100)/100))*def_mod
"multi_mod" = 100% for primary, 50% secondary, 30% tertiary, 10% everyone else
"def_mod" = 100% for normal, 50% for 50% damage off, 40% for 60% off, 10% for the 90% effect. Probably hard-coded in every damage formula, yay!

The "Output Damage" part is what is calculated with base damage and the eStat differences; I've figured a fair bit of it out, so I'll continue doing a little more research until I get back to work. It's temporary until I figure out exactly how it is calculated, in which case it will be replaced with the earlier parts of the formula. It also seems to happen in the "multiply by 1.28?" function that you weren't too sure about in the data document. It also looks like I don't have your "unknown" modifier in the formula; would you mind looking into that at some point while I research this other part?

Edit: When the time comes to add the completed formula to the first post, I'm probably not going to bold the "def_mod" part because that's seems to be a part of the damage formula out of laziness. I don't know. The 95% one isn't in here anyway, so... yeah.


jj: I think this function is supposed to apply to every unit at the end of the round, so everyone should be finished their own turns by then. It also shouldn't apply to poison/deadly poison, haunt, death curse/countdown, and death/downed. Or buffs! :happy:






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?

jjppof

Quote from: Salanewt on 06, June, 2014, 11:02:46 AM


jj: I think this function is supposed to apply to every unit at the end of the round, so everyone should be finished their own turns by then


Yeah, in the way that the code is, It is applying for everyone.

Quote from: Salanewt on 06, June, 2014, 11:02:46 AM


It also shouldn't apply to poison/deadly poison, haunt, death curse/countdown, and death/downed. Or buffs! :happy:



Thats the information I wanted!! Thanksss  :happy: