News:

As a consequence of the forum being updated and repaired, the chatbox has been lost.
However, you can still come say hi on our Discord server!

Main Menu

Editing elemental power sensitivity?

Started by Mion Sonozaki, 13, October, 2014, 07:14:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mion Sonozaki

Hey, I would like to buff the way the elemental power formula interacts with psynergy.

Currently, to my knowledge, each elemental power represents 1% of a spell's damage, with 100 elemental power being 100% a spell's damage, and 150 being 150% of its damage (a 50% buff)

However, I would like to buff it so that each elemental power increases a spell's damage by about 3% (making it MUCH more valuable!)

How would I go about this?

I did see some data in Teawater's code data list, but not sure how what too do with it:
Quote080B02DC = 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%)
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 * (1 + (Int(ePower*256/100)/256) * hexPercent
080C6644 = PC Elemental data (E. Levels 0-15)

Basically, I just want to make the Elemental Power formula more effective with Psynergy. Any ideas?

Rolina

Elemental Power has different influences on whether it's a physical or raw elemental attack.

Physical is (power-resistance)/400
Raw Elemental is (power-resistance)/200

Buffing Raw Elemental any more than it is now will also make the summon problem even worse.  If you do this, you'll need to take steps to notably depower summons (perhaps drop the efficacy of summons to 1.5% HP damage per djinn instead of the current 3% to balance it out).

Mion Sonozaki

Quote from: Rolina on 13, October, 2014, 09:36:31 PM
Elemental Power has different influences on whether it's a physical or raw elemental attack.

Physical is (power-resistance)/400
Raw Elemental is (power-resistance)/200

Do you happen to have the corresponding value to modify the raw elemental damage formula?

Quote from: Rolina on 13, October, 2014, 09:36:31 PM
Buffing Raw Elemental any more than it is now will also make the summon problem even worse.  If you do this, you'll need to take steps to notably depower summons (perhaps drop the efficacy of summons to 1.5% HP damage per djinn instead of the current 3% to balance it out).
And what data would I modify to accomplish this?

Daddy Poi's Oily Gorillas

#3
Yep! Those are the right functions, I believe, but I have a feeling the most obvious/easiest way /might/ be to edit this table.

080C6B04 (08 prefix means ROM section in GBA, so remove it if looking in a hex editor.)

It's 20 bytes. (0x14 bytes.) I think this is used for converting the Relative Power values to hex percent (aka: denominator of 256.), but I forget if the functions themselves also need to be edited or not (Probably not), so it's worth testing to make sure.

The table looks like this:

00C8 0100 0064 0080 0000 0000 FF9C FF80
FF38 FF00

So it starts at 200, and goes down to -200... Perhaps this way allows for some extra customization? Since you can make the point values vary depending on how many you have... or something. (Although, GS keeps it linear.)

I recommend editing the hex percent values. (Triple them?) Which would look like this:

00C8 0300 0064 0180 0000 0000 FF9C FE80
FF38 FD00
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! :)

Mion Sonozaki

#4
Quote from: Fox on 13, October, 2014, 11:37:22 PM
Yep! Those are the right functions, I believe, but I have a feeling the most obvious/easiest way /might/ be to edit this table.

080C6B04 (08 prefix means ROM section in GBA, so remove it if looking in a hex editor.)

It's 20 bytes. (0x14 bytes.) I think this is used for converting the Relative Power values to hex percent (aka: denominator of 256.), but I forget if the functions themselves also need to be edited or not (Probably not), so it's worth testing to make sure.

The table looks like this:

00C8 0100 0064 0080 0000 0000 FF9C FF80
FF38 FF00

So it starts at 200, and goes down to -200... Perhaps this way allows for some extra customization? Since you can make the point values vary depending on how many you have... or something. (Although, GS keeps it linear.)

I recommend editing the hex percent values. (Triple them?) Which would look like this:

00C8 0300 0064 0180 0000 0000 FF9C FE80
FF38 FD00

I am a bit confused here.

The table of x080C6B04 is:
Quote
00C8 0100 0064 0080 0000 0000 FF9C FF80
FF38 FF00

changed to????

00C8 0300 0064 0180 0000 0000 FF9C FE80
FF38 FD00

The 0100, changed to 0300, represents the value of what?

Changing 0080 to 0180 does what?

FF80 to FE80???

And FF00 to FD00? How is that tripling???

I understand your modification is tripling the damage (I wont be able to test this out until tomorrow), but what does each value you've changed represent?

And can you please walk me through an example of modifying this, please?

Daddy Poi's Oily Gorillas

#5
QuoteAnd FF00 to FD00? How is that tripling???
Because those are negative numbers.

FFFD = -3
FFFE = -2
FFFF = -1
0000 = 0
0001 = 1

Signed numbers go from 0x8000 - 0xFFFF (negative numbers), and 0x0000 to 0x7FFF (positive numbers).
Unsigned numbers go from 0x0000 - 0xFFFF (all positive numbers.)

0xFF80 = -128
Multiply the number by 3, and you end up with a larger negative number:
0xFE80 = -384

Ofcourse, if you did something like this:
FF80 * 3 = 2FE80
and filtered it to 16-bit,could likely work as well. Just make sure there's no overflowing issues.

---
It might be best to plot the points on a line graph... but yeah, this is Relative power (left), being converted to a value that is a Denominator of 256 (right)... (Ofcourse, Physical further divides it by 2, if I recall correctly,...  etc.)

It's how a Relative Power of 200 would turn out to be 1 when using the equation posted above:
Quote(power-resistance)/200
And since we start out with 100% (1) add one to that 1, you get 2.. So x2 damage would be the highest you could do without other bonuses. Most likely. (x1 from regular attack, plus x1 from Relative Power.)

Quotewhat does each value you've changed represent?
Editing each of the brackets... I guess you could think of it as a tax system with 4 groups taxed the same percentage.

Before:      After:
00C8 0100    00C8 0300    Group 1: Relative Power from 100 - 200 is linear with 0x0080 - 0x0100
0064 0080    0064 0180    Group 2: 0 - 100 is linear with 0x0000 - 0x0080
0000 0000    0000 0000    Group 3: -100 - 0 is linear with 0xFF80 - 0x0000
FF9C FF80    FF9C FE80    Group 4: -200 - -100 is linear with 0xFF00 - 0xFF80
FF38 FF00    FF38 FD00


I think I got the groups right... When I say "linear", I mean to think of a line on a line graph. , After the line graph is plotted, it should appear to be a straight line with five points...

---
I should probably also note that I was once confused when studying this stuff too, but then it eventually became clear to me. Although, finding the best way to explain might be a little harder.

---
Now that I think about it, I think it would be pretty cool if the Elemental attribute for items, abilities, and stuff was switched to percent-based values for each element.




Edit again: This is the way I see it, I guess: (Could be wrong?)
Physical is 50% ability power + 25% attack + 25% elemental.
Elemental is 50% ability power + 50% elemental.

If that should explain the /2 difference between the two? ; This makes it easy to tell that abilities using these weren't really meant to do more than x2 damage... or at least, that's the way it seems.
Using a Multiplier type probably is of 50% attack + 50% elemental, but dunno. (Can't remember if I looked it up or not, even.)

Tripling the elemental side might look something like this: (Might be wrong?)
Physical is 41.6667% ability power + 20.8333% attack + 37.5% elemental.
Elemental is 25% ability power + 75% elemental.
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! :)

Mion Sonozaki

I think I'm understanding a bit more. I still don't know what each value in the table represents, since I'm just a stupid leyman. But at least now i know what to modify, and by how much, as well as them negative values.

Thanks! :)

(Huge help for Golden Sun ReDux...)

Daddy Poi's Oily Gorillas

#7
Exactly what's missing?:

00C8 = 200, high-end of Relative Power.
0100 = 100% , Converts Relative Power (above), so that a Relative Power of 200 gets converted to 1 (That's where /200 comes from in the equation.), but with a denominator of 256. (256 = 0x100)
0064 = 100, upper-midpoint of Relative Power.
0080 = 50% , same as before, but 100 (above) converts to .5 (denominator of 256.)
0000 = 0, midpoint of Relative Power.
0000 = 0% , same as before...
FF9C = -100, lower-midpoint of Relative Power.
FF80 = -50% , same as before...
FF38 = -200, low-end of Relative Power.
FF00 = -100% , same as before...
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

Yeah, that's why I didn't tell you how - I didn't know.  I gave what suggestions and advice I could, giving you data that could be helpful, but I've long since abandoned the editor as a tool in favor of just making an entirely new system.  Fox is easily more equipped to help you with the technical stuffs.

Mion Sonozaki

#9
Ohhh, now I understand the summon issue... You meant the elemental power they grant after a summon?

Any way to reduce that?

This is actually pretty important, otherwise Golden Sun ReDux wont be possible...

Rolina

No no no - I mean they're affected by element power.  It's part of the damage formula.  If you make the influence of elemental power stronger, you multiply the power of summons as well - and they're already a bit OP as is.

Mion Sonozaki

#11
Quote from: Rolina on 14, October, 2014, 11:18:13 PM
No no no - I mean they're affected by element power.  It's part of the damage formula.  If you make the influence of elemental power stronger, you multiply the power of summons as well - and they're already a bit OP as is.
Ah, well I'm nerfing % damage multipliers, thanks to Salanewt's Simple Summon patch.

However, we need info on how to reduce the elemental power given after summoning.

Daddy Poi's Oily Gorillas

#12
QuoteHowever, we need info on how to reduce the elemental power given after summoning.
I think I might have posted some info on that somewhere in this forum, I forget where, though, but I think it was to help jjppof with his game. (Which is made with an RPG Maker, rather than being a hack.)

I think it was something like
+10
+30
+60
+100

Depending on the elemental djinn of the summon... and that they aren't stackable...  (So if you do one with 1 mercury you get +10, and then if you do one with 4 mercury, you get +90, on top of the first bonus... totalling +100.) but maybe we should find that topic! (Assuming it wasn't one of the ones that were deleted.)
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

#13
Funny thing, but the calculation that actually adds it is pretty tiny; I just don't know how one value is generated.

#080AD946:
- Grab relevant ePow;
- Quadruple Tier;
- Add normal Tier to quadrupled;
- Add to ePow and stored around #02035F7C, to then be loaded elsewhere most likely;

Where "relevant ePow" is dependent element+character, and "Tier" is a value that varies based on how many djinn you use in a summon. One djinni = 2, two djinn = 6, three = 12, and four = 20. I also think higher Tiers can replace lower ones, but not the other way around. Still looking into it though, since I haven't quite figured out when the Tier value is actually loaded (probably uses the code right before this, but still).


Edit: Wait, figuring it out now. Jenna used Judgement, and a value of 4 was written to #02000CC8 (each element gets its own byte, and each byte is read by the function using  loop). This value is multiplied by itself (becomes 16) and then the original value is added to the multiplied version (becomes 20). This is how the Tier value is generated. Pretty sure the 4 is also the strength of the summon, since I just tried it again with Cybele and that value was 3. So yeah, now we know how this stuff is calculated. I have no idea how I missed this, so don't you dare ask! :P

Example, let's say with Cybele:

Venus = 3
3 x 3 = 9
9 + 3 = 12
12 x 4 = 48 (this is technically done through an LSL instruction, but whatever)
48 + 12 = 60

This is basically how it works, but explained through simple math rather than code. By changing the "multiply by 4" bit, I was able to make it so the summon boosted my ePow by 36 rather than 60.



Since this is an idea I have had myself and I'm sure others have too, changing this to do something else wouldn't be terribly hard. In fact, it would actually require less space to do something like "multiply Tier by 10" to make it so the ePow boosts are 10-20-30-40 rather than 10-30-60-100.

LDRB Tier (loads tier byte, pre-calculation)
LSL+LSR code to make it signed (this is in the original code too)
MOV 10 (move)
Tier x 10

And there you go. Might have to relocate some of the code to make it more complicated though.
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

#14
Yeah, the formula is this:  5(x2+x)
I think I might have posted that once, too...? but haven't found the topic yet. I think the highest you could go was a +100, if I recall correctly.

So, the question is how does Lishy want to modify this formula? (Lower the 5?)
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! :)

Mion Sonozaki

Quote from: Fox on 15, October, 2014, 10:07:50 AM
So, the question is how does Lishy want to modify this formula? (Lower the 5?)

Possibly to where a 4-Djinn summon (Meteor, Thor, etc...) only give about 10 Elemental Power instead of 90.

Yeah, I know, that might seem a big low, but what that is actually doing is increasing damage by 50%, according to my calculations in the context of this rom hack.

Could we possibly see an example?

Daddy Poi's Oily Gorillas

(Well, actually, 4-djinn of one type gives +100, currently... The +90 is what you would see if you already have +10. That's why they're not stackable, they're just overrideables...)

So this?

+1 = 1 djinn
+3 = 2 djinn
+6 = 3 djinn
+10 = 4 djinn
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

Well technically, you can go a bit higher than +100 if you change the formula; I just made Judgment buff my ePow by about 220, and that was just by changing the "LSL x2" to "LSL x3". It helps that I raised the cap and lowered the base values though.

As for the calculation, you could do a simple "multiply by 2" to get a cap of about +8 and keep the boosts between tiers consistent, but you could also do a "tier x 2 + 2" for 4-6-8-10 rather than 2-4-6-8. Either that or you can relocate a small chunk of the code and link it to the division function to give the 1-3-6-10 boosts Teawater is asking about.
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

#18
@+100: I meant without changing the code... as in, 5+ djinn would default to 4.

@"division function" = Why not just remove the 5, and  LSR by 1? (Divide by 2.)

(x2+x)/2

Unless I'm mistaken, you would replace these two instructions: 080AD966
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 yeah, that would work too. Sleepy brain here. That is definitely the best way to do it if you want to maintain the 1-3-6-10 part of it.
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?