[ISSUE] Strong attack damage is 35% lower than it should be. (script bug) (fix attached)

+
The current version of the game (1.31) has a bug in the damageManagerProcessor.ws script that causes strong attacks to do 35% less damage.

The attackpower multiplier for Geralds heavy attacks is reduced by 0.833 in the damageManagerProcessor.ws:1366 script to compensate values in XML files returned from attackAction.ws script as baseline values for attack power calculations.
if(playerAttacker && attackAction && playerAttacker.IsHeavyAttack(attackAction.GetAttackName()))
powerMod.valueMultiplicative -= 0.833;

The issue is these XML values were changed in recent patches, while the compensating value for player character was not. Therefore attackAction.ws:366 only returns +0.483 but -0.833 are added by damageManagerProcessor.ws:1366. So the baseline attackpower value for strong attacks is 0.65 while the baseline for fast attacks is 1.00.

<!-- Strong Attack -->
<ability name="sword_2">
<tags>sword_2,attack_heavy</tags>
<armor_reduction max="1000" min="1000" type="add"/>
<attack_power min="0.333" type="mult"/>
</ability>
<ability name="attack_heavy">
<tags>attack_heavy</tags>
<attack_power type="mult" always_random="false" min="0.15" max="0.15" />
<focus_gain type="base" min="0.1" />
<focus_hit_drain_mod type="mult" always_random="false" min="1.5" max="1.5" />
</ability>
243: public function GetPowerStatValue() : SAbilityAttributeValue
244: {
...
295: if(witcherAttacker.IsHeavyAttack(attackTypeName) && witcherAttacker.CanUseSkill(S_Sword_2))
296: result += witcherAttacker.GetSkillAttributeValue(S_Sword_2, PowerStatEnumToName(CPS_AttackPower), false, true);
...
// -> result += 0.333 (geralt_skills.xml)
...
354: if(PowerStatNameToEnum(attributes[i]) == powerStatType)
355: {
356: dm.GetAbilityAttributeValue(attackName, attributes[i], min, max);
357: result += GetAttributeRandomizedValue(min, max);
358: break;
359: }
...
// -> result += 0.15 (basic_attacks.xml)
...
366: return result; // 0.483 (for heavy attack only)
367: }

Logging the powermod values from combat can be done by adding the following lines to damageManagerProcessor.ws in line 1632 right before the return finalDamage;. After that you need to start the game with witcher3.exe -forcescriptcompilation -debugscripts. The logfile is located at C:\Users\%USERNAME%\Documents\The Witcher 3\scriptslog.txt
if(playerAttacker && attackAction && playerAttacker.IsHeavyAttack(attackAction.GetAttackName()))
{
LogChannel('HUD_CONSOLE',"DMG_LOG : STRONG ATTACK");
LogChannel('HUD_CONSOLE',"BaseDamae: "+dmgInfo.dmgVal);
LogChannel('HUD_CONSOLE',"powerMod base: "+powerMod.valueBase+" ; add: "+powerMod.valueAdditive+" ; multi: "+powerMod.valueMultiplicative);
LogChannel('HUD_CONSOLE',"FinalDamage: "+finalDamage);
}
else if(playerAttacker && attackAction)
{
LogChannel('HUD_CONSOLE',"DMG_LOG : ATTACK");
LogChannel('HUD_CONSOLE',"BaseDamae: "+dmgInfo.dmgVal);
LogChannel('HUD_CONSOLE',"powerMod base: "+powerMod.valueBase+" ; add: "+powerMod.valueAdditive+" ; multi: "+powerMod.valueMultiplicative);
LogChannel('HUD_CONSOLE',"FinalDamage: "+finalDamage);
}

How to fix

To fix this issue damageManagerProcessor.ws:1366 has to be modified and scripts recompiled with -forcescriptcompilation parameter.
if(playerAttacker && attackAction && playerAttacker.IsHeavyAttack(attackAction.GetAttackName()))
powerMod.valueMultiplicative -= 0.833;

if(playerAttacker && attackAction && playerAttacker.IsHeavyAttack(attackAction.GetAttackName()))
powerMod.valueMultiplicative -= 0.483;

The file is located unter : %path_to_your_installation%\content\content0\scripts\game\gameplay\damage\damageManagerProcessor.ws

I attached 2 files. One with the fix and one still broken with logging activated. witcher3.exe -forcescriptcompilation -debugscripts.
After the fix is applied your strong damage done should be equal to the values shown in your character screen.

Additional Info

Formula finalDamage - see damageManagerProcessor.ws:1560
finalDamage = MaxF(0, (dmgInfo.dmgVal + powerMod.valueBase) * powerMod.valueMultiplicative + powerMod.valueAdditive)

* dmgInfo.dmgVal --- initial damage value (rnd weapon value)
* powerMod.valueBase --- flat scaling bonus
* powerMod.valueMultiplicative --- sum of mulitpliers including critical mulitplier if critical hit
* powerMod.valueAdditive --- flat non-scaling attack power bonus per level from "geralt_stats.xml"


BASELINE ATTACK SPEED (Full Animation)
fast : 0.6 sec.
strong : 1.1 sec.
 

Attachments

  • damageManagerProcessor_fix.zip
    23.8 KB · Views: 82
  • damageManagerProcessor_logging.zip
    23.8 KB · Views: 73
Last edited:
Top Bottom