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

Guardian Ball

Started by Plexa, 08, January, 2017, 05:22:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Plexa

So I'm experimenting with Star Magician and I'm having trouble manipulating the Guardian Ball into not using Guard Aura. I've advanced the BRN 11 times from 0 and it's using Guard Aura inconsistently. Changing the GRN changes whether or not the Guardian Ball uses Guard Aura - the resulting turn order from a seed where Guard Aura is used is the same as one where Guard Aura is not used.

This is a very unusual thing, I don't know of anything else that behaves this way. I was curious if there's any special coding for Guard Aura or whether I'm missing something and it actually does behave according to usual battle rules.

Rolina

Guardian Ball has a 5/8 chance of using Guard Aura, and a 3/8 chance to defend.  It might be a better idea to be rid of it ASAP and manipulate RPG to try and guarantee a better replacement.

Daddy Poi's Oily Gorillas

#2
That is interesting... Here's a quick image of my /early/ studies... Do you think that the 7th BRN generated thingy has anything at all to do with it? (Maybe in combination with something else.) I'll be checking... Also, Agility gets modified... Apparently... So there could be something, but I just don't know what it is, yet...
(Also, note that these breakpoints come before the ability used for this enemy is applied, I think...)
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! :)

Caledor

Agility being modified couldn't be just how the game handles priority moves like Guard Aura?

Plexa

#4
I would be surprised if its the 11th BRN advance that is causing this - although it certainly could be. I can't seem to reproduce the behavior with 0 BRN. I experienced some randomness with a previous BRN seed that I was working with (but later abandoned it due to better strats). I did just notice that you get +7 BRN when the game decides to use Guard Aura after the PC attacks are confirmed (3 Starmagician, 4 balls), and +6 BRN when the Guardian Ball chooses to defend. Seems like the decision is made prior to the balls turn coming up, unlike other enemies which decide their action when their turn comes up.

Caledor is probably right about the agility stuff being related to Guard Aura being a priority move.
Quote from: Rolina on 08, January, 2017, 01:25:42 PM
Guardian Ball has a 5/8 chance of using Guard Aura, and a 3/8 chance to defend.  It might be a better idea to be rid of it ASAP and manipulate RPG to try and guarantee a better replacement.
Star Magician is a one turn fight :) Even if we can't make progress here there's still good odds that guard aura doesn't happen (and is likely faster than an alternate strat)

Daddy Poi's Oily Gorillas

Well, both BRN 6 and BRN 7 are used for getting an ability... so I found that a bit confusing ish...
But it's possible Guard Aura is a priority move... (Is that Guard Aura, or the Ability Effect? Just to make sure.)
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! :)

Plexa

#6
Yeah all I'm trying to say is that guardian ball only has "one action" if it does not defend (guard aura) and that decision is made after all the pc commands are given (not really surprising in any way). The more I test this the more it seems like either i) BRN determines a % chance for guard aura, and then uses the GRN to determine success or ii) it's use is solely determined by GRN. This is based off of the fact that I can't manipulate a defend with 0BRN (trying >10 seeds), but with 11BRN attack cancelling is giving about 50% success.

I pull all my information from: http://goldensunwiki.net/wiki/Ball_enemy_line#Guardian_Ball which says that its an enemy ability and that is has increased priority

Daddy Poi's Oily Gorillas

#7
@one action:  Well, yes, I noticed that... (In my image.)
So I'm planning to figure out the code flow from the 6th to the 7th BRN.... (and beyond).... hopefully.

@Priority... = Yeah... I think it's the Ability Effect.... (My test: See [080B9DF8 + 3], and change the 0x58 to something else.)

The ability effect adds 0x2710 (10000 in dec.) to the agility... in the Enemy AI code, it seems. (Not sure how often, as there is this conditional before it gets added. Conditional separates Start of Round from Start of Turn.)

@7 BRN = Nevermind! I think I didn't realize the Start of Round/Turn thing... so got confused... I'm still looking this up, though....
At least I do usually find the answer in the end, at least. :)




How are you checking the random number for abilities? (Or were you not doing any fancy equations? And instead only looking for RN counts that give you a result... Ermm...)
RNG & 0xFF ? And then comparing... (0x20,0x20,0x20.... 8 times for Guardian Ball) (As in... It's not (RNG * 8) >> 16)
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! :)

Plexa

RNG results are trial and error, + I have RN counters in my routing scripts. I've attached an image which illustrates the problem I'm having. In the first image (BRN 11, 0 GRN (0 is relative due to how my script counts)) the Guardian Ball will use Guard aura, while in the second image (BRN 11, 295 GRN (relative to previous image, i.e. this state is 295 GRNs further along than the first one)) the Guardian Ball defends. 


Plexa

#9
Found a second seed which gives defend, and I'm thinking my first hypothesis is correct - i.e. that the BRN determines the chance for Guard Aura to work based off the GRN. So far I've been working with BRN11, but turns out BRN7 works as well. I did some manual sampling (51 samples) and BRN7 had a 70% defend rate while BRN11 had a 35% defend rate.

This is very unusual.

Edit: If you want to manually test this, save before star magician [battery file enclosed] enter the fight and do anything with your party. Guardian ball should use guard aura and immediately soft reset when you see this text come up. This will have advanced the BRN by 7. Load back into the star magician fight and enter the battle; you're now fighting star magician at BRN7. You can test the defend/guard aura rate with this.

Alternatively, use my battery file, load gabomba catacombs and enter the mud fight - do atk/def/diamond dust/blitz and soft reset. Now load into the Star Magician fight - you'll be at BRN11. You can test defend/guard aura rate here and compare it to BRN7.

Daddy Poi's Oily Gorillas

#10
So... I was looking at @ 0811CFFA , Weird... But enemies are listed in a stack, and the GRN seems to swap them around a bunch of times. Is this based on evaluating turns in a certain order? (Before actually putting them in the order they'll go?)
Hypothetical... But let's look at these numbers for a moment to support the theory.
0x00000000 = Ability 0
0x00003039 = Ability 1
0xD3DC167E = Ability 0
0xA70427DF = Ability 1
0xD6651C2C = Ability 0
0x0DAA96F5 = Ability 4
0xC21F1C8A = Ability 0

(00, 20, 40, 60, 80, A0, C0, E0 sections is what I'm looking at.)

No room for Guardian Ball to ever "Defend" in that case.... (Where BRN count is 0.) ...
Hmmm..... I may want to look further into this theory, though.


EDIT: Although, 00000000 is probably not the first one /skipped.  Since I forgot that a number is generated first... XD (Was just an oversight.)
I am not sure if that Ability 7 one works or not for BRN 0, though....  So yeah, I'll need to think of something.
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! :)

Plexa

#11
That looks like a promising theory and would explain the behavior I'm seeing. Shuffling the order in which moves are determined would mean the guardian ball is using a variety of different BRN seeds instead of one seed every time. BRN11 would have about 2-3 good seeds and 5-4 bad seeds, while BRN7 would have about 5 good seeds and 2 bad ones.

Star Magician actually doesn't advance the RNG by one with BRN 0, so your calculations were valid actually you're right. This lines up experimentally with what I observe where Gball always guard auras on 0BRN.

EDIT: If you could check BRNs 8-14 and 12-18 and see how many seeds will make Gball use guard aura? If the ratio of guard aura/defend lines up experimentally this is probably the reason.

EDIT2: I did 8-14 myself and got 4 defends, 3 guards giving me a theoretical ~57% chance of defend. But since Star Magician eats 3 RNs at once, and 80% of the time will consume at least one of the guard seeds I imagine the real probability is nudged higher.

BRN7 = 3EAD 62 FB - 62 -> 3
BRN8 = AF5A AD 71 - AD -> 5
BRN9 = 20DA 77 56 - 77 -> 3
BRN10= AFE5 33 D7 - 33 -> 1
BRN11= 69AC C4 C4 - C4 -> 6
BRN12= 961B AF AD - AF -> 5
BRN13= 261E B2 E2 - B2 -> 5
BRN14= 525F 36 73 - 36 -> 1


EDIT3: just saw your post below xD somehow I missed a seed

Daddy Poi's Oily Gorillas

Well... I messed up my rand numbers... So instead of calculating them myself... I'm letting the game do it.... (Just target an enemy/back up/target... while looking at GRN... from 0, since both GRN and BRN work the same/generate the same numbers.)

0 = 0x00000000 = Ability 0
1 = 0x00003039 = Ability 1
2 = 0xD3DC167E = Ability 0
3 = 0xA70427DF = Ability 1
4 = 0xD6651C2C = Ability 0
5 = 0x0DAA96F5 = Ability 4
6 = 0xC21F1C8A = Ability 0
7 = 0x3EAD62FB = Ability 3
8 = 0xCD1DCF18 = Ability 6 ***
9 = 0xAF5AAD71 = Ability 5 ***
10 = 0x20DA7756 = Ability 3
11 = 0xAFE533D7 = Ability 1
12 = 0x69ACC4C4 = Ability 6 ***
13 = 0x961BAFAD = Ability 5 ***
14 = 0x261EB2E2 = Ability 5 ***
15 = 0x525F3673 = Ability 1
16 = 0x65136930 = Ability 3
17 = 0x7E7099A9 = Ability 4
18 = 0xE6791B2E = Ability 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! :)

Plexa

#13
And just like that, 5/7 guards starting on BRN7 and 3/7 guards starting on BRN11. This is certainly what is going on.

Very curious behavior!

EDIT: the real probability (assuming the order in which the actions are assigned is random) should be 80%, so my sample calculations were a good 10% out

Daddy Poi's Oily Gorillas

#14
So I assume that you can make Guardian Ball Defend 100% of the time if you do the Break item trick... and such....?

As for random... well... I think it is about 0x20 random swaps... (So two random numbers generated for each swap b/c both random numbers represent the slots to swap.)

However, there are only 5 enemies, right? So that's five slots to swap around. (I think Star Magicians turns are one after another?)
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! :)

Plexa

Yeah it makes sense to me that SM has all 3 turns determined in one go. Because of that, with certain configurations the guardian ball will always defend.

In any case, 7BRN is very easy to get to and gives good odds. If it proves to be semi-inconsistent we can always manip the grn on the title screen for improved accuracy.