Golden Sun Hacking Community

Golden Sun Resources => Misc. GS Hacking => Topic started by: Mion Sonozaki on 17, August, 2013, 04:40:27 PM

Title: Summon damage
Post by: Mion Sonozaki on 17, August, 2013, 04:40:27 PM
As it stands, summons seek to take away a % of boss health no matter what. It's pretty game-breaking being able to summon-rush the bosses.

Has anyone found a solution to this?
Title: Re: Summon damage
Post by: VanishMantle on 19, August, 2013, 08:46:22 PM
In my Difficult patches I just hit summons with the nerf bat. Lowered the amount of damage they do and upped the cost. So it wasn't as practical. Level 1 and 2 stayed the same cost wise. However Level 1 got a power buff and level 2 saw a minor nerf. Level 3 and 4 got the worst end as they both got big nerfs and cost more. It helped funnel players into casting psynergy more as summon rushing is viable for end game at all.
Title: Re: Summon damage
Post by: Misery on 20, August, 2013, 06:57:16 AM
Unless I'm mistaken, the HP% damage is tied directly to the amount of djinn used to summon, so increasing the cost would also increase the damage. It's not a part of the ability data for summons, and if a summon was used via the psynergy menu, the added HP% damage would not occur.

You could take away the base damage, but that would make summons useless against normal enemies and still somewhat broken against bosses.

You could make them cause non-damaging effects, such as Coatlique's regeneration effect, but there are only so many different effects you can come up with that would be worth using a summon for.

You can make any summon unavailable by raising the requirements to something you will never have. For example, a if Judgment required 20 djinn of every element, it would never show up in the list (I think).

Without changing the actual code used for sumoning, I don't think there's any good way to balance them. For now, I guess take them out if you don't like them.
Title: Re: Summon damage
Post by: Rolina on 20, August, 2013, 12:25:02 PM
No, it's tied to the ability itself.  Enemy summons like Meteor Blow and Cruel Ruin don't use djinn, and Iris goes off-formula.
Title: Re: Summon damage
Post by: Misery on 20, August, 2013, 01:30:55 PM
I did some quick and dirty testing with this, and it seems you are correct. I tested summoning against an enemy with 15,000 HP to really see the HP% effect, and the summon did the same damage when it required 4 djinn as when it required 15.

No idea where the game grabs those values from then, they may be tied to the ability, but I still don't believe they're part of the actual ability data.
Title: Re: Summon damage
Post by: Rolina on 21, August, 2013, 12:04:13 PM
Yeah, I just found out by trying to make Coaticlue (or however you spell her name) an offensive summon.  I threw in a value I thought worked for the djinn used compared to similar cost summons, and... bam, it only did that damage.  As in, no HP percentile damage at all.  Was all... Huh.
Title: Re: Summon damage
Post by: Mion Sonozaki on 22, August, 2013, 04:58:04 PM
So as of yet, there has not yet been discovered a way to reduce summon damage on bosses?

Would a band-aid fix be simply to point it to other psynergy slots which do not use percentage damage?
Title: Re: Summon damage
Post by: Rolina on 23, August, 2013, 08:12:23 AM
That'd defeat the point of summons, though.  I'm sure there is a way, but not with the current editor.  The generally agreed on standard here seems to be to nerf it to 2% per djinn instead of the usual 3%, though.  So if you find a way to do that, give it a shot.
Title: Re: Summon damage
Post by: Misery on 23, August, 2013, 09:46:29 AM
Depends on how you define the purpose of a summon. Anyway, I would expect the percentual damage is tied to which summon you use rather than which ability the summon uses, i.e. if you change the Venus summon to Judgment it would still do 3% HP damage, but I haven't been able to test this.

On a somewhat related topic, I've found out that the elemental power bonus you get from summons IS directly tied to the amount of djinn used for the summon - 10 for 1, 30 for 2, 60 for 3, and 100 for 4+
So if a summon needed 4 or more djinn of every element (even if it's a bad idea to have more than 2 elements per summon), you would get +100 power in every element. But I don't know if this is old news.
Title: Re: Summon damage
Post by: Rolina on 23, August, 2013, 01:30:01 PM
Yeah, that's how it works.  It's tied to the actual ability, but it's not a value you can change with the editor.

As for the element boost, that kind of makes sense, too.  IIRC, if you put summons in a class as spells, it doesn't actually boost anything.  You have to use the summon command itself.
Title: Re: Summon damage
Post by: Aile~♥ on 23, August, 2013, 04:07:21 PM
The elemental boost from using summons applies regardless of the type of ability that happens to be in that summon slot. Just as long as you use the "Summon" command to access it, and it has a Djinn cost.
Title: Re: Summon damage
Post by: Misery on 23, August, 2013, 04:10:27 PM
It might not have been directly obvious, but I consider anything that you access with the "Summon" command to be a summon, regardless of what it does.
Title: Re: Summon damage
Post by: Daddy Poi's Oily Gorillas on 31, August, 2013, 08:39:09 AM
QuoteIt's tied to the actual ability, but it's not a value you can change with the editor.
We have a winner!

And guess what else? It's all hard-coded.

For reference see 08120FB4~08121106.
Title: Re: Summon damage
Post by: Mion Sonozaki on 31, August, 2013, 12:02:41 PM
Quote from: Teawater on 31, August, 2013, 08:39:09 AM
QuoteIt's tied to the actual ability, but it's not a value you can change with the editor.
We have a winner!

And guess what else? It's all hard-coded.

For reference see 08120FB4~08121106.

Oh for sake of Alchemy!

:(
Title: Re: Summon damage
Post by: Rolina on 03, September, 2013, 04:52:08 PM
If we can find a way to change it, that'd be awesome.  I understand it'd be hard to do, though.
Title: Re: Summon damage
Post by: Salanewt on 19, May, 2014, 01:33:10 AM
Uh, yeah. I guess I can try explaining how the formula works very quickly.

08120F70 = Base Damage, Base Damage (Diminishing), Summon Formula

So basically, they all share the same formula for base damage. What makes summons different is that this formula also tacks on some additional HP%-based damage for certain abilities, as noted by Teawater. I'm sure you are all aware of this fact.

How it's organized in the formula is that it does a check for each summon; enemy-exclusives seem to be first (Cruel Ruin, Meteor Blow, etc.), and then it checks each damaging summon in a disorganized mess of code. This part of the formula then adds the appropriate added damage to each summon, as checked in the code. One should be able to follow the function by studying it enough though, and doing so will lead them to the individual values used for additional summon damage. For example:

081210F0 - Daedalus turn 1, default at 7% damage.

But it might just be easier to list them all by added percentage rather than by name, seeing as values are shared among summons. Please keep in mind that each value is held in r2, so just be careful about changing the register(s) they are held in.

081210DC - 3%
081210E0 - 12%
081210E4 - 35%
081210E8 - 6%
081210EC - 9%
081210F0 - 7%
081210F4 - 15%
081210F8 - 21%
081210FC - 24%
08121100 - 30%
08121104 - 40%


Now, if you're fine with the game's current summons (enemy ones and locations included), then all you would have to do is open up a hex editor and change these. Otherwise, you'd have to change the formula to make it work for every new ability you want to add. Heck, it might just be simple enough to remove this part of the function altogether and add a table somewhere in the ROM that reads an individual byte for each and every ability without actually changing a single one. Downside being that it would take up slightly more room than the current function.

Hope this helps!
Title: Re: Summon damage
Post by: Salanewt on 24, June, 2014, 12:29:08 PM
All right! I wasn't sure what I wanted to do last night, so I decided to sort out this disorganized mess of code. It starts with a series of checks for the three enemy summons that tack on %-based damage, then it performs a couple other checks that I will research later (with values of x066 and x0A/10/. After that, it performs a long series of checks starting with Tiamat:

Summon Check (for grabbing % damage):
Earlier code (will research someday)... :
683 - Meteor Blow...
673 - Star Mine...
724 - Cruel Ruin...
x06 check...
x0A check...
Branch past damage% list (the previous checks all branch to the Tiamat check at 08120FE2).

398 - Tiamat; 9% if equal, branch to [407 - Atalanta] if greater... -x0A/10
388 - Mercury; 3% if equal, branch to [392 - Moloch] if greater... -x05
383 - Judgment; 12% if equal, branch to [385 - Haures] if greater... -x02
381 - Ramses; 6% if equal, 9% if greater (382 - Cybele)... -x01
380 - Venus; 3% if equal, branch to end of damage% list otherwise

407 - Atalanta; 6% if equal, branch to [441 - Eclipse] if greater... -x05
402 - Daedalus (1); 7% if equal, branch to [404 - Iris] if greater... -x02
400 - Megaera; 6% if equal, branch *12%* if greater (401 - Ulysses);
Branch to end of damage% list if greater than (401 - Ulysses), 12% otherwise (399 - Meteor)
404 - Iris; 40% if equal, 15% if less (403 - Daedalus (2))
406 - Jupiter; 3%

411 - Eclipse; 15% if equal, branch to [673 - Star Mine] if greater... -x02
409 - Thor; 12% if equal, branch to 9% otherwise (408 - Procne, 410 - Flora)
673 - Star Mine; 30% if equal, branch to [683 - Meteor Blow] if greater
412 - Catastrophe; 24% if equal, branch to end of damage% list otherwise
683 - Meteor Blow; 35% if equal
724 - Cruel Ruin; 40% if equal, branch to end of damage% list otherwise

392 - Moloch; 9% if equal, branch to [394 - Azul] if greater... -x02
390 - Neptune; 9% if equal, 12% if greater (391 - Boreas)
389 - Nereid; 6%
394 - Azul; 21% if equal, branch to end of damage% list if less than (393 - Coatlicue)
396 - Mars; 3% if equal
397 - Kirin; 6% if equal, branch to end of damage% list otherwise

385 - Haures; 15% if equal, 6% if less (Zagan)
386 - Charon; 30%

*12%*: Unique value, not in the same collection as the rest of the damage% values (401 - Ulysses);

[spoiler=damage% list]0812107E - 12% (Ulysses)

081210DC - 3%
081210E0 - 12%
081210E4 - 35%
081210E8 - 6%
081210EC - 9%
081210F0 - 7%
081210F4 - 15%
081210F8 - 21%
081210FC - 24%
08121100 - 30%
08121104 - 40%
08121106 - End of damage% list[/spoiler]

I'm also not sure why they didn't just save some space and do every check starting at [380 - Venus] and adding +1/+2 for every following check (save for the enemy summons). But oh well, it is Camelot after all.
Title: Re: Summon damage
Post by: Rolina on 24, June, 2014, 07:22:00 PM
Wait, I'm confused - what is this "branch to" stuff?  Is it actually calling up other summons in certain circumstances?
Title: Re: Summon damage
Post by: leaf on 24, June, 2014, 07:44:00 PM
In layman's terms, it basically says:

Player command = X

If X = "summon ID 1"
Activate "summon ID 1"

Else If X = "summon ID 2"
Activate "summon ID 2"

Else If X = "summon ID 3"
Activate "summon ID 3"

Else If... etc


It just does so in a confusing way. It seems to first identify primary element and number of djinn for that primary element, then determines which summon to use from there (since with multielemental summons, there can be more than one hp% value for a given primary element/djinn count combination).
Title: Re: Summon damage
Post by: Salanewt on 24, June, 2014, 11:01:10 PM
Basically what leaf said, although djinni count and percentage values are independent from one another and it also accounts for enemy abilities.
Title: Re: Summon damage
Post by: leaf on 24, June, 2014, 11:13:41 PM
Yeah, it seems like a really jumbled way to code it =3c

I also realized my secondary explanation was wrong just now when I looked at tiamat branching to atlanta >_>
I saw a bunch of same element stuff branching to each other so I thought that it worked based on that, but I guess it was really just coincidence.
Title: Re: Summon damage
Post by: Rolina on 26, June, 2014, 07:08:44 AM
...Is there a particular reason it has to do it like that, or is it just plain sloppy code?  Wouldn't it be easier just to assign the HP Percentile damage value the same way you would a spell's power?
Title: Re: Summon damage
Post by: Salanewt on 26, June, 2014, 10:27:37 AM
Haha, it is pretty confusing. I had to go through the whole thing again because I initially missed three of the summons when I looked through it, and even then Teawater mentioned that I messed up horribly for Ramses (which does actually branch to the 6% part like the others).

As for the code, I like the theory that the programmers were on an hourly wage rather than contractual. :happy: I'm not sure why their compilers would jumble it up this much when other areas of the game are somewhat more organized, but I can see why they didn't use a bank to assign %-based damage.

While it would be super easy to set it up in the same way as ability power, type, or so forth, it would also take up more space than it does now. Especially when you only have 33 summons (including three enemy summons and two Daedalus parts). You would have to set aside a minimum of 353 bytes (if there are no summons before [380 - Venus]), and then have some code that reads that data. Kind of like this:

If ability ID is < 380 (CMP 380)
Skip section (BLT, or branch if less than)
Subtract 380 so the first ability is equal to 0 (SUB 380)
Grab bank address (LDR Address)
Read byte (LDRB from Address + modified ID)
Branch to calculation code

Looking at the earlier code again, it kind of looks like it checks for the three enemy summons and branches to Tiamat if they match rather than just branching to the added % damage. The other two checks are for "action types," which are similar to battle commands and include using items, fleeing, counterattacking, enemy flavour text, and so forth. The checks are for x06 (summon) and x0A*. Those first few duplicate checks are basically a way to bypass this summon check, but I'm also not sure how an ability is decided to be a summon action type.

I would imagine that they could be left out if there were a bank at any rate.

*I don't think we have actually pinpointed how that one is used, but it looks like it's for general use. It is also the default placeholder action type.


To make a long story short, they did it this way to save a little space in the code because they only have 33 summons that add %-based damage, and a large majority of these are generally exclusive to the player.


Edit: Just double checked, and it turns out that the first enemy summon checks are too far away from the added damage portion of the code to be able to branch to them directly. However, they are still close enough that the second checks could have been branches instead.