Golden Sun Hacking Community
October 17, 2017, 10:07:12 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
  Home   Forum   DC Wiki Help Search Calendar Downloads Login Register  
Pages: 1 2 3 [4] 5   Go Down
  Print  
Author Topic: Master Formula List  (Read 23012 times)
0 Members and 1 Guest are viewing this topic.
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #45 on: June 07, 2014, 04:03:05 PM »

Probably, that formula is horribly incomplete. Though taking another look at it, the "Output Damage" part should multiply with the bracket stuff before getting divided... Although that's a placeholder for the rest of the formula anyway, so it probably doesn't matter quite as much if it weren't a placeholder.

But basically, this one formula that I'm trying to look at doesn't actually use the base damage of the ability in its calculation; that comes after all of the complicated eStat variation stuff. I think the end result will probably look something like this:

(((Base Damage * eStat_var) * 100)/[LSR 10] * unk_arg * (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 90%

The "eStat_var" is what I'm trying to figure out right now. It basically handles the variation as "ePow - eRes" for the ability's element (should it have one), and uses that number between -199 and 200 for calculating something. I'm pretty sure that also comes from the effect only formula, but I'll double check later (haven't really taken a look at the code before this one BL). It also looks like it's used by almost every other damage formula, so I'm probably going to post it as its own formula when I'm ready to add the finished version of this. The downside is that it looks like there are certain parts that are either not used by this damage formula or are used only under certain circumstances.

Edit: The difference will effectively appear to be "(Base Damage * (eStat_diff))/100" or something. For example:

(50 * (200-50))/100
= (50 * (150))/100
= 7500/100
= 75

But the formula itself is much more complicated than that. I have no idea why this is the case. Maybe the programmer who designed this had an hourly wage as opposed to a contractual one and stretched their efforts needlessly just to go home with a higher pay cheque. Maybe not.

Anyway, back to the pre-edit stuff!


And I'll take a closer look at the "multi_mod" stuff a bit later as well. I could have sworn that something was multiplied by 100 at some point, but there's also a good chance that I messed that up because it was later at night. Although that could also have been for the def_mod... You know, I think it was. I'll check later though!


Oops, I had one register incorrectly labeled as the element ID rather than the eStat difference. Fixed!

« Last Edit: June 07, 2014, 04:24:19 PM by Salanewt » Logged

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?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2376

« Reply #46 on: June 08, 2014, 02:52:38 AM »

Turns out the unknown I didn't know was the multiplier that ability effects use.

This starts right at Effect Only formula:
Spoiler for large image:
Just a moment ago, I was working on this incomplete image tutorial. Not sure if I'll finish it off or not, though.

Yes... imgur is good. photobucket resizes large images, but imgur doesn't!
« Last Edit: June 08, 2014, 06:28:06 AM by Teawater » Logged

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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #47 on: June 08, 2014, 05:21:53 AM »

Nice work! I've added a bit more to the WIP formula I have thanks to your post:

If Cloak is not in use;
And if ailment success /= 0 (if there is one);
And if damage > 0;
(((Base Damage * eStat_var) * 100)/65536 * ability_mul * (multi_mod * 100)/100)) * def_mod
"ability_mul" = Ability effect multipliers (see respective multiplier effects), defaults to 1 when there is no effect
"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 90%

Obviously the "eStat_var" part is the incomplete part, but I haven't quite worked out a good way to write out an effective formula for it. Getting there though.

The linked function in the second red section links to another function, and that is the function that does all of the weird calculations with the base damage and eStat difference. It's then multiplied and divided a bit before being brought bad to the original function. To make a long story short, you could expect to see values well over x100000 if following the formula as it's coded in the game.


I was also mistaken on the "effective calculation" before, but I don't really care about fixing that one when this is the important one...


Edit: I removed the "Confirmed" and "Unconfirmed" headers from the first post because it kind of looks like we're on a roll with confirming them. So... the first has been replaced with "Vanilla" for now. I'll probably change it again later though, it's just a placeholder until I decide whether to add a second section for "Custom" formulas that are available as hacks or just keep it as a list of strictly unmodified formulas. About 99% sure it will be the latter.
« Last Edit: June 08, 2014, 05:43:00 AM by Salanewt » Logged

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?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2376

« Reply #48 on: June 08, 2014, 06:29:22 AM »

Quote
Nice work! I've added a bit more to the WIP formula I have thanks to your post:
Thanks, and you are welcome.

Quote
I could have sworn that something was multiplied by 100 at some point
I still don't remember seeing anything about the multi_mod being multiplied by 100... Hmm... But if you find anything, then be sure to enlighten me. :)

By the way, I've just updated my image tutorial in my previous post. It seems that's all the effect-only stuff... (I omitted the "But it has no effect" part in case it was used elsewhere as well? Not sure.)

Quote
"Confirmed" and "Unconfirmed" headers from the first post because it kind of looks like we're on a roll with confirming them.
Sounds good. I was wondering what the point of having those were if we were most likely not going to have any unconfirmed ones. (Or as many, anyway.)

---

I believe you forgot to list the Critical Hit/Unleash formula(s)... (Along with the the effects that are related.)

----

Looking at the Added Damage formula, I see something that tells me Attack + (Attack/4) as part of the formula... It might be with just one enemy, though? 304 Wild Gryphon

Added Damage:

max(0, userAttack - targetDef + (abilityPower * 2)) * elementalFunction(eStatDiff)

Note: It's possible that abilityPower being multiplied by 2 is undone... in which case, it could be that (userAttack - targetDef) is divided by 2...?

Multiplier:

max(0, userAttack - targetDef) * elementalFunction(eStatDiff) * abilityPower / 10


---
Now back to the 1.28 function: If you look at the call at 080B0350 (and the code around it.), it's almost like it's doing x*128/100. (Unless I'm mistaken?) That's mainly what's needed, however, I have a feeling the table was suppose to be used to change the scaling? (But they ended up keeping it linear?) Probably similar to Stat Growths? Hm..

if arg r1 = 0: (ePow - eRes) * 1.28 + 0x100

if arg r1 = 1: (ePow - eRes) * 1.28 / 2 + 0x100

Theories: (wip?)
If you have an eStatDiff of -200, the damaged returned might be 0. (if r1=1: 0x80)
eStatDiff of -100, you get 0x80... (if r1=1: 0xC0)
eStatDiff of 0, you get 0x100... (if r1=1: 0x100)
eStatDiff of 100, you get 0x180... (if r1=1: 0x140)
eStatDiff of 200, you get 0x200... (if r1=1: 0x180)

It pretty much looks like the function at 0x080B02DC returns base 16 percentages. So the parent-level function will need to shift 8-bits out after multiplying? (Um... will still need to look into this further, though.)

Hmm.. By the way, Is the r2 arg for the function at 080B03E0... is it a percentage done in base 16? If so... hehe.... so two base 16 percentages are multiplied together, making it so you have to shift 16 bits.
« Last Edit: June 08, 2014, 01:22:22 PM by Teawater » Logged

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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #49 on: June 08, 2014, 01:42:49 PM »

Multi: Yeah, I've been thinking about it and it doesn't make sense to me anymore. Just removed it from the WIP formula in my text file.

Critical hit, right. Thanks for posting it! I'll wait until we're a bit closer to figuring out this eStat calculation stuff before adding them, since it may help.


As for that last one, yep. This is basically what I have as far as tracking the difference (excluding mostly irrelevant registers):

During (1):
r0 = ePow-eRes (moved to r6) -> x05

During (2 - Loop):
r6 = ePow-eRes

During (3):

r0 = 0 (if ePow-eRes difference is positive), xFF9C (-99, if negative) -> positive sum of r6-r0 -> sum of (r0*r2)
r1 = 0 -> x64
r2 = 0 -> x80
r5 = #080C6B04 -> 0 (if positive), xFF80 (-127, if negative)
r6 = ePow-eRes

During (4 - Post-division)

r0 = r0/r1
r1 = x60
r2 = x64
r3 = r0-r1
r5 = 0 (if positive), xFF80 (-127, if negative)
r6 = ePow-eRes

During (5 - End):

r0 = r0+r1
r1 = x100


So basically, the value is multiplied by 128 at some point and then divided by 100 shortly after. It kind of looks like 256 is added to it at some point as well, which is when it gets back to the previous function:

r0 = ePow-eDef output damage? -> x100 (moved from r5) -> r0*r3 -> Output Damage
r1 = x100
r2 = x64
r3 = base damage (moved from r6) -> r3*r0 (before r0 = x100)
r4 = ??? (x08 or x0C so far)
r5 = x100
r6 = base damage

And then it's multiplied by 100 again after the output is multiplied by the base damage, but before it is divided/shifted at the end of the function.


Looking at the image again, it's kind of weird that they added exceptions for Doom Dragon in this part of the code rather than have an external function like with Agatio/Karst.
Logged

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?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2376

« Reply #50 on: June 08, 2014, 02:07:04 PM »

Seems after you understand it a bit, the functions aren't really that confusing... Except for the reason behind making it longer than it needs to be.

By the way, Even the documentation at GameFaqs seem to have it right (At least I think they do? I only checked the Element part.):  http://www.gamefaqs.com/gba/561356-golden-sun-the-lost-age/faqs/22880

Special Physical Attacks:
    Damage = [Base Damage * Mult Mod] + Add Mod
    If Elemental, Damage = [Damage * (1 + Relative Power / 400)]

Basic Psynergy Attacks:
    Psynergy has own Base Damage
    Damage = [Psynergy Base Damage * (1 + Relative Power / 200)]


They're calling eStatDiff by Relative Power. :)

! + (100 / 400) = 5/4 = 125%
1 + (100 / 200) = 3/2 = 150%
Logged

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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #51 on: June 08, 2014, 03:24:13 PM »

Yeah, I noticed that Gamefaqs thing as well a couple days ago. It is pretty accurate as far as end result, but it would be cool to understand how exactly it's done in the code for future reference. It would also be less confusing to call it relative power now rather than change it in the formula later at any rate! Happy

Plus, thinking about it, their calculation for relative damage makes much more sense. The reason why I have been ignoring it is because it's done differently in the code, and the first post is pretty much reserved for formulas as they are executed in the code; makes it less confusing for those who may want to look at the code themselves in the future. Plus with the whole "lacking decimal numbers" thing, you basically have to multiply a number by a certain amount and then divide it to get a fraction.

If Cloak is not in use;
And if ailment success /= 0 (if there is one);
And if base damage > 0;
((Base Damage * Relative Power) * ability_mul * multi_mod /100) * def_mod
"ability_mul" = Ability effect multipliers (see respective multiplier effects), defaults to 1 when there is no effect
"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 90%

So that's basically what the full formula comes to. The "Relative Power" bit (as it shall now be called to avoid confusion) is the part that we should try confirming at some point.
Logged

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?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2376

« Reply #52 on: June 08, 2014, 04:05:54 PM »

Okay...

I'm just saying that the guide is very accurate at the simplifying part.

Remember these?
Quote
if arg r1 = 0: (ePow - eRes) * 1.28 + 0x100

if arg r1 = 1: (ePow - eRes) * 1.28 / 2 + 0x100

All you have to do is divide by 256 or 0x100, and you get these: (Literally.) The formula that I made above was before I checked with the Faq.
Quote
if arg r1 = 0: (ePow - eRes) /200 + 1

if arg r1 = 1: (ePow - eRes) /200 / 2 + 1

Relative Power ... and the "what it should be" sound like two slightly different things? Um? I think.
« Last Edit: June 08, 2014, 04:10:21 PM by Teawater » Logged

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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #53 on: June 08, 2014, 04:18:03 PM »

That's certainly true, yeah! Like, I will add the "simplified" version(s) to the first post, but I didn't want to put them up until after we confirmed the formula as calculated in the function (one for the casual readers, and one for the coders).

I've also been pretty busy with my studies, so I haven't really been looking into this a lot lately... Sorry! Is the bottom one what I should add to the first post then?
Logged

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?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2376

« Reply #54 on: June 08, 2014, 04:24:28 PM »

Yes. The code does divide by the 256 that I just posted in my previous post...  In three different functions (The parent functions to the child function you were probably looking at.).... (It's actually like hitting two birds with one stone, because it's shifting the other bits due to multiplying other numbers as well.)

Function 1 shifts 9 bits... 8 from the percent, 1 from actual dividing of attack - defense... I think
Function 2 shifts 16 bits.... 8 from the percent, and 8 from the percentArg. And same with Function 3.



If Cloak is not in use;
And if ailment success /= 0 (if there is one);
And if base damage > 0;
((Base Damage * ((Relative Power/200) + 1)) * ability_mul * multi_mod /100) * def_mod
"Relative Power" = User's Elemental Power - Target's Elemental Resist
"ability_mul" = Ability effect multipliers (see respective multiplier effects), defaults to 1 when there is no effect
"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 90%



Fixed! (I think?)


Formulas: (Mostly a WIP, so you can probably confrrm them, if you want.)

Added Damage: (Left out crit/multi_mod/effect_mod)
max(0, max(0, ((userAttack - targetDef) / 2) + abilityPower) * (1 + (Relative Power/400)))
max(0, max(0, ((userAttack - targetDef) / 2) + abilityPower) * (1 + ( Int(Relative Power*256/400)/256 )))
max(0, max(0, ((userAttack - targetDef) / 2) + abilityPower) * (1 + ( Int(Relative Power*0.64)/256 )))

Multiplier: (Left out crit/multi_mod/effect_mod)
max(0, max(0, (userAttack - targetDef) / 2) * (1 + (Relative Power/400))) * abilityPower / 10
max(0, max(0, (userAttack - targetDef) / 2) * (1 + ( Int(Relative Power*256/400)/256 ))) * abilityPower / 10
max(0, max(0, (userAttack - targetDef) / 2) * (1 + ( Int(Relative Power*0.64)/256 ))) * abilityPower / 10

Effect Only:
((Base Damage * (1 + (Relative Power/200))) * ability_mul * multi_mod /100) * def_mod
((Base Damage * (1 + ( Int(Relative Power*256/200)/256 ))) * ability_mul * multi_mod /100) * def_mod
((Base Damage * (1 + ( Int(Relative Power*1.28)/256 ))) * ability_mul * multi_mod /100) * def_mod

Where /200 and /400 occur, there is a rounding error, because the game rounds off to the nearest 1/256th before actually multiplying to anything.... To fix the rounding error, multiply the numerator by 256, get a decimal number, remove the decimal places, and then divide by 256 (To undo what you multiplied by earlier. Because * 256/256 is *1, which doesn't change anything.)


By the way, you left out multi_mod and effect_mod from your healing formula. (I'm going to assume the majority of the damage functions use these, so you can probably abbreviate on them.)

Quote from: Some battle related functions that go with stats - Their stat-like behavior is probably why they're in Party Mechanics
080AFF28 = get_summons_total(addr) addr is where to list the summons.
080AFF7C = get_summon_address(summon)
080AFF94 = obtain_summon(summon)
080AFFAC = get_elemental_levels(pc,pc_ram_addr,sp) pc can be 0-7 for PCs, or 8+ for enemies.; Return 0.
080B0028 = get_elemental_level(pc,element)
080B005C = get_enemy_elemental_attr(enemy)
080B0084 = update_elemental_pow_resist(pc_slot, pow_res_ram_addr) Includes base levels and djinn, not sure about item bonuses.
080B0144 = find_matching_class(pc,pc__ram_addr,item)
080B0288 = get_class_address(class)
080B0298 = Djinn set/removal calculations (grabs/updates class ID (possibly abilities too)? and links update_elemental_pow_resist)
080B02D4 = Call 080B0298.
080B02DC = toElementalHexPercent(Relative ePower, eHalfEffective) (Converts to hex percentage. (Multiply by 1.28 or 0.64 and add 256. Equivalent to (1 + Relative Power / 200) and (1 + Relative Power / 400), but those have a rounding error.) In parent function mult. with value and shift out 8 bits.) It’s like converting 100 to +50% in hex. (If eHalf, +25%) (150% and 125%)
080B0378 = Random Number Generator //Returns 16-bit (x0000-xFFFF)
080B039C = Return random number x0-x63.
080B03AC = calcAttack(attack,targetDef,power,Relative ePower) targetDef could be 100%, 50%, or 0% of value depending on effect. Used by Added Damage & Multiplier
Return max(0, max(0, ((userAttack - targetDef) / 2) + abilityPower) * (1 + (Int(Relative ePower*256/400)/256)))
080B03E0 = calcCast(abilityPower,Relative ePower,percent) (From left?) elemental pow/resist related  *Called from Summon and Effect Only formulas…
Return abilityPower * (1 + (Int(Relative ePower*256/200)/256) * hexPercent
080B0408 = calcHeal(Same as above, but it multiples arg r1 by 2 and subtracts by 200 at beginning.) (From Center?) *Called from Healing formula(s).
Return abilityPower * ((Int(ePower*256/100)/256) * hexPercent

080B0434 = get_elemental_attr(pc)
080B0460 = get_item_criticals(pc_addr)
080B04BC = unleash_check(pc) Returns ability to cast. (Unleash if chance succeeds, or attack.)
080B0514 = Base Ability Effect Success Chances?
080B06A8 = Return 1 if enemy found in table 080C6B18, else 0.
080B06C8 = Return 1 if enemy found in table 080C6B76, else 0.
080B06E8 = is_vulnerable/weakness(pc_addr, ability_effect)
080B0740 = Ability_Effect_Revives(ability_effect) //If effect revives, return 1, else 0.
080B075C = Calculate_Ailment_Success(attacker,defender,element,effect,percentMod)

I figure the three functions calcAttack, calcCast, calcHeal, are the base calculations, while the battle mechanics themselves use modifiers like multi_mod, effect_mod, and def_mod.


It appears that PP Recovery doesn't have a random value that gets added.
« Last Edit: June 09, 2014, 08:10:12 AM by Teawater » Logged

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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2376

« Reply #55 on: May 07, 2017, 04:47:31 AM »

I see this is a master formula list... but it is pretty small... It also looks like most formulas use a random number... and since the RNG is like a formula, I have a question? Does it fit here as well?


GS1/GS2:
seed = seed * 1103515245 + 12345
return seed << 8 >> 16 (16-bit random number.)
The initial seed should start at 0.

GS3: (Seems to do this type of thing in various places, but I'm not certain if there are any exceptions.)
seed = seed * 69069 + 1
return seed >> 16

Another function will do this after updating seed:
return ((seed >> 16) * range) >> 16 (Random number from 0 to range-1)
Not sure if the initial seed is 0 or not.

In all cases, seed is a 32-bit number.
Both RNGs are listed here: https://en.wikipedia.org/wiki/Linear_congruential_generator


GS3 might have another function, because the one listed with range is from 02171A64... and my scanner detects it only being called FIVE times!:
02171678
021716D4
02171810
021718BC
02172FF4


Other random number calculations found (Same seed * 69069 + 1 stuff , all numbers from in battle....)
02003624 (Arm function)
020059C0
02015D80
0202D454
0210F750
02110C78
021120B0,02112108
021194C4
02119634 = Function for calculating it as it should have been....
02119A54
0211AE54
0211CD4C
...there are way too many to list... of course, most of them are appearing with-in functions and are not a function themselves. (Except for two and maybe three/etc.)
Perfect to use as an access polnt to studying GS3's data, though!
(Also, compilers are weird, so not so sure about blaming the dev for having it everywhere.... Since a simple define in c language(s) is not a function, but some sort of substitution/etc..)
« Last Edit: May 07, 2017, 11:23:25 AM by Fox » Logged

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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #56 on: May 08, 2017, 12:38:29 AM »

The RNG function fits!

Also, thanks for the contributions to this topic. :P
Logged

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?
View Profile WWW
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #57 on: September 24, 2017, 03:43:06 AM »

Okay, I threw a new one in here involving the ePower boosts you get from summons! I really need to update this thing more. :P
Logged

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?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2376

« Reply #58 on: September 24, 2017, 04:27:36 AM »

Good job! But I recommend also listing the 10, 30, 60, 100, thing as well.. (And if GS1 can have summons that raise EPower for multiple elements at once or not?)


--
Also, I thought I found an error with one of the percents somewhere.... that I think I messaged you about a very long time ago... I can't remember if you ever fixed it or not, though.


---
I think I'd like to know which abilities have the Stun effect... so I can figure out why one stun generates three RNs... ; Would be funny if it was to mimic the animation or something. ; Otherwise, it could be related to a Type...? (Weapon Type, Ability Type, etc?)
« Last Edit: September 24, 2017, 04:36:22 AM by Fox » Logged

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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4565

« Reply #59 on: September 25, 2017, 05:54:17 AM »

Oh yeah, that's a good point; I'll add it soon!

I think I remember you mentioning that once? I just fixed Sleep's percentage earlier so that may have been it.


As for the other Stun, I think Fire Puppet uses it (effect 85). Not sure about any others, since usually an ability will use 23.
Logged

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?
View Profile WWW
Pages: 1 2 3 [4] 5   Go Up
  Print  
 
Jump to:  

Cbox
Yesterday at 09:57:26 AM
AZVRE: Im pretty okay, what about you?
Yesterday at 01:17:14 AM
Fox: I think the nine is doing a cirno on me, though... Anyway, how is everyone doing today?
Yesterday at 01:12:20 AM
Fox: onesixtwo*
Yesterday at 01:12:00 AM
Fox: Okay... Meanwhile... ah... 162 being a number that has made itself known to me.... I look at the relationships of the numbers.... 162  1+6+2 = 9 ; onesizetwo = alphabetical order = 9 characters ; Distance apart analysis: os = 4 = 1[6][2] , st = 1 = [1]6[2] , ot = 5 = [1][6]2 ; ost = original sound track?
October 15, 2017, 06:31:17 PM
AZVRE: ah okay :D i thought i caused some trouble
October 14, 2017, 07:49:16 AM
Fox: Oh i know... You were messing with yours, and the description says mine. It's kind of a funny bug. :P
October 13, 2017, 08:18:31 PM
AZVRE: I did not edit your profile tho. Just to erase that confusion ^^"
October 12, 2017, 04:49:56 AM
Fox: e.g. this art = http://forum.goldensunhacking.net/Themes/Jupiter/images/catbg.gif (etc.)
October 12, 2017, 04:48:58 AM
Fox: I have a question: Where did the art for the headers come from? (Like the backgrounds to each of these things... "Affiliates", etc... Asking just incase it inspires me to do something... but if Charon made it, then that's cool too.
October 11, 2017, 04:23:02 AM
FoxWas thinking about having something for the editor anniversary, but I believe I had to change my mind....
October 10, 2017, 12:58:36 PM
Fox: That's alright. ;       @AZVRE's profile: "Current Activity:  Editing the profile of Fox." ...Eh... That looks weird.
October 07, 2017, 11:45:16 PM
Atrius: Sorry about that, the auto bot detection is still working, but it also requires an admin to visit the site regularly.
October 04, 2017, 04:17:40 AM
Fox: Yeah, it does bring a small amount of activity. Not good quality activity, but it's still activity, nonetheless.  Now if we can get them to randomly post pictures and vdeios!
October 04, 2017, 02:10:48 AM
Majora: If nothing else, I like how they're copying the content of real posts at random. Interesting to see how they adapt to seem more authentic
October 03, 2017, 08:29:38 PM
Fox: medico6601 = Most likely another bot. :(
September 26, 2017, 03:32:24 PM
Fox: by ten* Excuse me.
September 26, 2017, 03:32:12 PM
Fox: Oh yes... Also multiply all levels by two. (So actually, an adept will have levels of 54, 3, 2, and 1, rather than 5, 0, 0, 0.... if going by those.)
September 26, 2017, 03:29:07 PM
Fox: ...I mean the theory also saves space on the Status Screen.
September 26, 2017, 03:26:11 PM
Fox: Random/fun concept theory: What if we got rid of ePow/eRest, and just made eLevel do everything. :P (A process of cleaning stuff up... Though, could make things less versatile. - Like, if a Djinni add 1 eLevel = Okay, that's understood... by why specifically +5 on the ePow/eRes (Rhetorical))
September 23, 2017, 04:42:08 AM
Fox: Oh nevermind, it does... but I swear I saw that a minute ago.

Affiliates
Temple of Kraden Golden Sunrise
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.074 seconds with 22 queries.