thunder rune piece

A forum to ask questions if you are stuck in the The Gate Rune Wars; or wish for more clarity on the gameplay systems.
Julian
Posts: 87
Joined: Wed Jan 29, 2014 9:17 pm

Re: thunder rune piece

Post by Julian »

There are multiple inconsistencies like that.

Scream: Heals 300 hp, not 400

Yell:
In battle: heals 33% hp, regardless if dead or alive
In field: can only be used if character is dead, heals 33% hp

In the field, nothing else seems to check on the 0 hp. You can use a potion and *poof* you're revived. A 0 hp character can even use their own rune to heal themselves.
like2h
Posts: 70
Joined: Fri Oct 09, 2015 12:09 am

Re: thunder rune piece

Post by like2h »

Good to know that. I wouldn't have found that out since I hadn't considered using the resurrection rune before.

Edit:33% seems a bit odd; why not just say 1/3? So, I ran a quick test, and indeed, it is 1/3.
User avatar
wataru14
Guide Writer
Posts: 724
Joined: Thu Aug 05, 2010 10:37 am
Location: Las Vegas

Re: thunder rune piece

Post by wataru14 »

Raww Le Klueze wrote: Thu Dec 14, 2023 10:08 am Fog of Deception is supposed to lower enemies hit rate by 20% not half.

Though importantly it doesn't actually do anything because all buff/debuff spells are bugged because they apply the effect to a value that will always be 0.
Does this apply to the Hazy Rune as well?
Julian
Posts: 87
Joined: Wed Jan 29, 2014 9:17 pm

Re: thunder rune piece

Post by Julian »

No, that rune works. The game checks if it's equipped when checking if an attack connects.
like2h
Posts: 70
Joined: Fri Oct 09, 2015 12:09 am

Re: thunder rune piece

Post by like2h »

I guess that almost all of the enemies' special physical attacks, the ones opposite to normal physical attacks with 1x damage and no additional effects, don't consider hit rates. In other words, they always land a hit.
like2h
Posts: 70
Joined: Fri Oct 09, 2015 12:09 am

Re: thunder rune piece

Post by like2h »

Quick question before I start S2 - in S1, physical rune attacks and unite attacks always hit and never crit, correct? Want to make sure I have the S1 mechanics right. Let me know what you guys think!
Julian
Posts: 87
Joined: Wed Jan 29, 2014 9:17 pm

Re: thunder rune piece

Post by Julian »

Yeah, like with enemies, the accuracy/evasion/critical/etc checks are only done on regular attacks. The various AI functions and rune/unite just access the damage formulas directly.
Julian wrote: Sat Dec 09, 2023 8:08 am This formula applies to both player and enemy, as far as I can tell.

Damage = ATK-DEF
If Damage < 10: Damage += (1 - rand(4))
Example: Damage=5: 5 += (1 - [0..3]), range of 3-6. Damage < 10 just adds a range of -2 to +1.
If Damage >= 10: Damage += ((Damage/2 - Rand(Damage) / 5)
Example: Damage=100: 100 += ((50 - [0..99]) / 5), giving a range of 90-110, so basically +/- 10%

If target is a party member and used defend:
Damage = Damage / 2

If attacker is a party member:
If target is weak to rune piece element* embedded in your weapon: Damage = Damage * 1.5

If rune piece is fire or wind**: Damage = Damage * (1+(.05*number of pieces))
(Straight 5% for one piece, 10% for two, 15% for three, etc. I suck at writing formulas.)

If final damage is lower than 0, its set to 1.

*wind does earth damage, earth does wind damage
**the incorrectly labeled wind that does earth damage

Edit: Critical is set elsewhere, it's 3x as stated.

For unites, it looks like it just runs the above formula for each character in the unite, sums the values, and then multiplies by the multiplier. (x2, x1.5, etc.)

Like magic, each unite has a set of functions that does graphical stuff, and also calculates damage. They all seem to call some shared functions to calculate damage for multiple characters, but, it's possible some unites are using a different formula or function to calculate damage. Those would all need to be checked one by one.
Before that check is done, the game is setting the weapon element like this:

If Valid Rune Piece equipped (5 elements)
Weapon Element = Rune Piece Element
Else
Weapon Element = Base Weapon Element (see: https://suikosource.com/games/gs1/guides/initial.php)

However, before checking for enemy resistance to apply the damage bonus, it checks if your Weapon Element is 0 to 4, the 5 base elements. Holy elemental weapons get filtered out on this check and thus never get a bonus. Fixing it is literally just changing that 4 to 5 so it checks for holy.
like2h
Posts: 70
Joined: Fri Oct 09, 2015 12:09 am

Re: thunder rune piece

Post by like2h »

Many thanks, Julian.
To make this physical damage formula complete, I want to know exactly when and where flooring is applied in the game's damage formula.

For example, with:

Base damage: 99
1.5x weakness multiplier
1.05x rune bonus
Does the game:

A) Apply all multipliers first, then floor only once at the end?
(99 x 1.5 x 1.05 = 155.925, floored to 155 at the end)

Or

B) Floor after each step?
(99 x 1.5 = 148.5 (floored), 148.5 x 1.05 = 155.4 (floored))

In this specific case, A and B output the same value. But that is only because we applied the 1.5x weakness multiplier before the 1.05x rune bonus. If applied in the reverse order, intermediate flooring in option B would cause unintended damage loss.

So to summarize - does this game floor damage only once, at the very end of the calculation (option A)? Or does it floor after applying each multiplier individually (option B)?

I guess this may be more of a potential issue in S2 though.
Julian
Posts: 87
Joined: Wed Jan 29, 2014 9:17 pm

Re: thunder rune piece

Post by Julian »

The game is using integers and no decimals or floating point numbers. It's going to floor with each step.
like2h
Posts: 70
Joined: Fri Oct 09, 2015 12:09 am

Re: thunder rune piece

Post by like2h »

So, check order matters in the game. Apologies for asking, but just to clarify: is the weapon element check done before the rune piece bonus check?
User avatar
Raww Le Klueze
Global Admin
Posts: 1916
Joined: Sat Jun 26, 2004 1:38 am

Re: thunder rune piece

Post by Raww Le Klueze »

It only checks the weapon element if there's no rune piece attached.
Doctorum Non Urina Singulus.
Julian
Posts: 87
Joined: Wed Jan 29, 2014 9:17 pm

Re: thunder rune piece

Post by Julian »

Weakness 1.5 is done before Rune Pieces 1.05x.
like2h
Posts: 70
Joined: Fri Oct 09, 2015 12:09 am

Re: thunder rune piece

Post by like2h »

If Damage >= 10: Damage += ((Damage/2 - Rand(Damage) / 5)
Example: Damage=100: 100 += ((50 - [0..99]) / 5), giving a range of 90-110, so basically +/- 10%
Does the expression
'Damage += ((Damage/2 - Rand(Damage))/ 5)'
always yield the same range as
'[0.9×Damage, 1.1×Damage]' ?
I've tested it with some numbers, but I'm unsure how to prove it universally. The latter seems simpler, and most of the time, we're just concerned about the range. No need to do math proof, though. Any thoughts or insights?

Edit: Unfortunately, it seems there is occasionally a slight difference on the lower cap.
Antimatzist
Posts: 2784
Joined: Sat Apr 19, 2008 9:48 am
Location: Germany, yeah baby
Contact:

Re: thunder rune piece

Post by Antimatzist »

Code: Select all

Damage += ((Damage/2 - Rand(Damage))/ 5)
Is the same as

Code: Select all

Damage += Damage/10 - Rand(Damage)/ 5
The +10% is trivial. (Rand = 0)
As for the lower bound, it's no flat -10%, as it depends on the relative difference between damage and the random number. The higher the Damage, the higher the lower bound.
like2h
Posts: 70
Joined: Fri Oct 09, 2015 12:09 am

Re: thunder rune piece

Post by like2h »

Well, I don't know. As the game does flooring every step, I guess it's better to calculate step-by-step.

For lower cap:

Rand = Damage - 1 (almost = Damage)

So lower cap is:

Damage + (Damage/2 - (Damage - 1))/5

Let's assume Damage = 82

Lower cap is:

82 + (41 - 81)/5 = 82 - 8 = 74

While 82 × 0.9 = 73.8

Damage = 86

Lower cap is:

86 + (43 - 85)/5 = 86 - 9 = 77

While 86 × 0.9 = 77.4

The difference (if there is one) is only 1 between the actual lower cap and 0.9 × Damage (floor this or not).
Anyway, it is the flooring that is annoying.
Post Reply