fgo-docs

Miscellaneous information on FGO gameplay

Discord server invite

↥Top

Below is a collection of small posts about FGO mechanics. Most are originally discussed in the Atlas Academy discord server. Some more techy information such as the damage formula can be found in the deeper folder.

Range of randomModifier in the damage formula

An integer in the range [900, 1100):

C# method reference.

Arash and Chen Gong NP OC effect randomModifier

Because Arash and Chen Gong NP OC effect is an extra deal damage function, they use a different randomModifier, independent from the main damage function's randomModifier.

Maximum value of total powerMod

1000%.

Lower and upper bounds of buffs

Damage formula term Buff Action Default Value Lower Bound Upper Bound
atkMod atk 100% 0 500%
defMod defence 100% 0 N/A
cardMod commandAtk 100% 0 500%
cardMod commandDef 100% N/A 500%
powerMod damage 0% N/A 1000%
critDamageMod criticalDamage 0% N/A 500%
npDamageMod npdamage 0% N/A 500%
specialDefMod specialdefence 0% -100% 500%
NP gain formula term Buff Action Default Value Lower Bound Upper Bound
cardMod commandNpAtk 100% 0 500%
cardMod commandNpDef 100% N/A 500%
npChargeRateMod dropNp 100% 0 500%
Crit stars formula term Buff Action Default Value Lower Bound Upper Bound
cardMod commandStarAtk 100% 0 500%
cardMod commandStarDef 100% N/A 500%
starDropMod criticalPoint 100% 0 500%
enemyStarDropMod criticalPoint 100% 0 500%

Here's how the buff values are collected and summed up in the game code:

num = buffAction.baseParam + (total plusTypes buffs values) - (total minusTypes buff values)

if buffAction.limit in (normal, lower):
    if num < 0:
        num = 0

num = num - buffAction.baseValue;

if buffAction.limit in (normal, upper):
    if maxRate < num:
        num = maxRate

return num

Notes:

Unstackable buffs

Buffs which have the same non-zero buff group are unstackable. For example:

enemyServerMod in the NP gain formula

The NP gain formula.

The enemyServerMods in the attacking and defending formulas refer to two different variables in the enemy data: tdRate for attacking NP gain and tdAttackRate for defending NP gain. They are usually the same but there's no code requirement for them to be identical.

How MISS and GUARD are determined

The status effect proc check is still as described in Kyte's post. MISS and GUARD are only for display. Here's how they are determined:

As a result of this, a failed 100% chance status effect can only display GUARD.

For example, with Shuten's first skill (60% chance Charm, 100% chance DEF down) against shadow Medusa in the X-E FQ with 17.5% resistance:

How enemy's Critical Miss is determined

The critical miss sign appears if the enemy has a crit chance down debuff and would have crit without the debuff assuming the rng roll is the same.

How the special summoning effects work

Reddit post about gold orbs, rainbow orbs and silver to gold conversions.

How hit damage is distributed

The following formula applies to all hits' damage except for the last one:

Hit damage = Card damage × Hit Percentage / Sum of hits percentage (Note that / is integer division)

The last hit's damage is calculated by subtracting the previous hits' damage from the card damage.

Therefore, the last hit's damage can be different from a prior hit's even with the same hit percentage. For example, Musashi's Buser card has [33, 67] damage distribution. With her first skill active, the damage distribution array becomes [33, 33, 67, 67]. With card damage of 15,228, the hits damage are [2512, 2512, 5101, 5103]:

>>> 15228 * 33 // 200 # Hit 1; "//" is integer division
2512
>>> 15228 * 33 // 200 # Hit 2; 33+33+67+67=200
2512
>>> 15228 * 67 // 200 # Hit 3
5101
>>> 15228 - 2512 - 2512 - 5101 # Hit 4
5103

How the Overkill bug happens

What is the Overkill bug?

In various circumstances, face cards (not NPs) can get 1.5x NP gain similar to the overkilling effect, despite the card not killing the enemy.

To determine which hit should have the overkill effect, the game keeps track of provisional damage between hits and compares it with the target's HP value. The target's HP is updated between cards while the provisional damage counter is not reset between cards. This leads to double counting of damage dealt and "overkilling" when the target is still alive.

Here are some examples of how the game determines when the overkill effect applies and the overkill bug in action.

Scathach's quick card and first hit of the arts card experience overkill effect before she kills the target. Because the hp value is updated after the first card (14409 to 7300) while reducedhp is carried over from the first card, the overkill bug happens.

reducedhp is properly reset for Lancelot's NP card so the bug doesn't happen here. NP gain value is also shown in the table.

A video of the bug in action: https://www.bilibili.com/video/av34113229 @ 1:42. MHXA Arts card 2nd hit has the overkill bug.

Enemy behavior after killing taunt servant

With the 2.0 update*, DW fixed this enemy behavior to be mostly consistent. Enemy will stop attacking after killing the taunt servant except for the following case:

If an enemy kills the taunt servant in the first attack action and the taunt servant has guts, the second attack action will not happen but the third attack action will.

You can see this scenario in this gif. Lalter attacked and killed Spartacus with guts. Tesla didn't attack and Siegfried attacked instead.

Note: With the 2.0 update, I'm quite sure the behavior is the same even with enemy NP attack or attack with on-hit effects (e.g. Hokusai 3rd skill).

You can see in the following image the reasons for the enemy behavior.

In all scenarios, even after the taunt servant is killed with or without guts, narrowDownHate returns the taunt servant, [1]. In scenarios 1, 2, 4-6, getTargetBase still considers 1 to be "dead" so it returns no eligible servant, -1, and there's no attack.

In scenario 3, the flag isAlive is switched to True in the 3rd attack as the guts servant hp value is updated. getTargetBase found an eligible servant and the 3rd attack happens (For the 2nd attack, isAlive is still False).

Pre 2.0 update behavior

The table below details the enemy behavior before the 2.0 update. The cells that changed with the 2.0 update are highlighted.

Generally, if the enemy deals more than 50% starting hp of damage and kills in the 2nd attack, there will be a 3rd attack.

Note: This doesn't apply to enemy NP attack or attack with on-hit effects (e.g. Hokusai 3rd skill).

The above conditions sound familiar? Yes, the overkill bug rears its head again. Because of the overkill bug, checkDeadTurn is set to False and wreaks havoc on the downstream functions:

Note: I don't track the game code closely enough to know for sure that this behavior changes with the 2.0 update but the NA game code is definitely different between version 1.35.1 and 2.1.0. There's still this pre-2.0 video that I haven't been able to explain.

What affects whether a card procs critical hit

Skills with random chance like imperial privilege can have different outcomes if you savescum and use additional skills beforehand. In the same vein, critical hits can also be tampered with, and anything that affects skills will also affect critical proc rng. However, unlike skills, critical hits only enter the scene after the player selects their cards and starts their turn. Nevertheless, the player still has options to change whether cards crit or not.

Let us consider King Hassan, whose deck is described below:

Card Hits
Arts (A)3
Buster (B)1
Quick (Q)5
Extra (E)6

Let's assume we have a hand of his 5 cards (A-B-B-B-Q), and each card has a non-zero and non-100% chance to crit.

Example scenario: B-B-Q chain and we are interested in whether the third card crits or not. Different inputs from the player can change whether it crits or not. These inputs will "advance" or "change" the rng. If the card has a 50% change to crit, a dice with 100 faces is rolled and it will crit if the number is above 50. This exact dice will always land with the same number — this is why you can't savescum while not using any skills and get a different result. When you push the rng by "1", you're going to the next dice which will give a completely dice roll. Despite getting a different dice roll, it's still possible to not crit or get the desired outcome, you're just getting another chance at it.

This description was focused for one of the cards to crit. However, most random events in battle use the same aforementioned dice. For example, the damage on the cards and the AI of the enemy is also different based on that dice. The only exception is guts calculation. Whether a servant comes back to life using guts is calculated using a separate dice so advancing the main dice counter won't affect whether Necromancy CE procs guts and vice versa.

Lists of Mystic Code skills that have 500% chance in JP but 100% in NA

UPDATE: All MC skills' chances were fixed on 2021-03-12