The Witcher 3
0 of 0

File information

Last updated

Original upload

Created by

Maciej Polanski

Uploaded by

User_53059011

Virus scan

Safe to use

Tags for this mod

About this mod

It seems, that ability to abuse base Quen in fight is not by design, but is a defect in Quen implementation. Because of call to "MaxF" instead of "MinF", Quen can reduce more damage than its own health is, preventing penetration. This mod fixes this, so powerful hits may penetrate Quen, even without destroying it.

Permissions and credits
Changelogs
Abstract

It seems, that ability to abuse base Quen in fight is not by design, but is a defect in Quen implementation. Because of call to "MaxF" instead of "MinF", Quen can reduce more damage than its own health is, preventing penetration. This mod fixes this, so powerful hits may penetrate Quen, even without destroying it.

I can not guarantee, that game is still balanced with this fix, but no any spare changes included. I expect some boss fight to be much harder, as Quen abuse won't work any more. But I did some smoke tests and I found game better.

Exact defect

Problem lays in file "scripts\game\gameplay\items\spells\quenEntity.ws", where we can read:

542 if(incomingDamage < parent.shieldHealth)
543  reducedDamage = incomingDamage;
544 else
545  reducedDamage = MaxF(incomingDamage, parent.shieldHealth);


The vanilla logic is as follows:
  • If incomingDamage is smaller than shieldHealth, then reducedDamage is whole incomingDamage.
  • if incomingDamage is bigger than shieldHealth, then reducedDamage is chosen as maximum from (incomingDamage, shieldHealth), so again whole incomingDamage !

Such code does not make any sense, always whole incomingDamage is reduced. If such reduction is developers intention, they would use only single line "reducedDamage = incomingDamage;", not "if" clause.

Example vanilla damage processing

Having this problem, example vanilla damage processing that I logged was:

  • "1Hand" hits "Witcher" with SlashingDamage=1294.89 and SilverDamage=38.8716, so after armor resistances vitalityDamage=453.994.
  • With vitalityDamage=453.994 and Quen shieldHealth=200,  Quen reduces... whole 453.994, more than shieldHealth is! This is because of incorrect comparison. Instead, Quen should reduce 200 and Witcher should suffer a 253.994 vitality loss.
  • Then shieldHealth is drained, not by whole reducedDamage (as some players expect), but spellPower (about 1..3 times) reduction is applied. So reducedDamage=453.994 divided by spellPower=1.98 produced drainedHealth=228. Quen health (200) is drained to... -28 !
  • It seems that original Quen should withstand numerous penetrating attacks on higher spellPower. But cannot due to bug.

Fix

I fixed "MaxF" to "MinF", so if incomingDamage is bigger than shieldHealth, then reducedDamage is limited to shieldHealth only.

I also found that, with now correctly working Quen health reduction, it is needed to define threshold that ends Quen and eventually triggers Exploding Shield. If not, it makes infinite sequence (like 100%, 33%, 11%, 3.6%, 1.22%, 0.41%, 0.136%) of useless Quen health.
I used 40 - 20% of max Quen health in my logs.

Merge

This mod changes "scripts\game\gameplay\items\spells\quenEntity.ws" and may require merge. Merge with FCR3 was trivial (automated).
There is one multiline logging in this mod and two oneline fixes:

  • reducedDamage = MaxF(incomingDamage, parent.shieldHealth);     ->     reducedDamage = MinF(incomingDamage, parent.shieldHealth);
  • if( parent.shieldHealth <= 0 )     ->     if( parent.shieldHealth <= 40 /*is 20%*/)

Examples

I took some test with three test cases, so you can see how does it work. I attached videos and logs are below.

Example 1: Drowner is weak enemy, Quen reduces most of damage at first hit. Witcher has low spellPower, so Quen destroyed in every second attack, Exploding Shield activates [https://youtu.be/4UlqkKM6U8Q]

Conjuring Quen
vitalityDamage: 310 - 200 [Quen reduction] = 110; Quen shieldHealth: 200 - (200 / 1.39 [spellPower]) = 56;
vitalityDamage: 314 -  56 [Quen reduction] = 258; Quen shieldHealth:  56 - ( 56 / 1.39 [spellPower]) = 15;
Conjuring Quen
vitalityDamage: 307 - 200 [Quen reduction] = 107; Quen shieldHealth: 200 - (200 / 1.39 [spellPower]) = 56;
vitalityDamage: 360 -  56 [Quen reduction] = 304; Quen shieldHealth:  56 - ( 56 / 1.39 [spellPower]) = 15;
Conjuring Quen
vitalityDamage: 351 - 200 [Quen reduction] = 151; Quen shieldHealth: 200 - (200 / 1.39 [spellPower]) = 56;
vitalityDamage: 368 -  56 [Quen reduction] = 312; Quen shieldHealth:  56 - ( 56 / 1.39 [spellPower]) = 15;


Example 2: Light armor, so hudge Quen penetration. Better spellPower, so Quen stays for three hits. At the end, 1Hand kills Witcher with Quen still active - this is consequence of spell penetration [https://youtu.be/N5AsfccumhA]

Conjuring Quen
vitalityDamage: 1115  - 200 [Quen reduction] =  915; Quen shieldHealth: 200 - (200 / 2.081 [spellPower]) = 104;
vitalityDamage:  978  - 104 [Quen reduction] =  874; Quen shieldHealth: 104 - (104 / 2.081 [spellPower]) = 54;
vitalityDamage: 1092  -  54 [Quen reduction] = 1038; Quen shieldHealth:  54 - ( 54 / 2.081 [spellPower]) = 28;
Conjuring Quen
vitalityDamage: 1079  - 200 [Quen reduction] =  879; Quen shieldHealth: 200 - (200 / 2.081 [spellPower]) = 104;
vitalityDamage: 1032  - 104 [Quen reduction] =  928; Quen shieldHealth: 104 - (104 / 2.081 [spellPower]) = 54;
vitalityDamage: 1214  -  54 [Quen reduction] = 1160; Quen shieldHealth:  54 - ( 54 / 2.081 [spellPower]) = 28;
Conjuring Quen
vitalityDamage: 1089  - 200 [Quen reduction] =  889; Quen shieldHealth: 200 - (200 / 2.081 [spellPower]) = 104;
Witcher dies


Example 3: Heavy armor and beefed Quen with Discharge, poor Axe2h kills himself [https://youtu.be/_JJqD8A8wwo]

Conjuring Quen
vitalityDamage: 692 - 200 [Quen reduction] = 492; Quen shieldHealth: 200 - (200 / 2.131 [spellPower]) = 106;
vitalityDamage: 598 - 106 [Quen reduction] = 492; Quen shieldHealth: 106 - (106 / 2.131 [spellPower]) = 56;
vitalityDamage: 618 -  56 [Quen reduction] = 561; Quen shieldHealth:  56 - ( 56 / 2.131 [spellPower]) = 29;
Conjuring Quen
vitalityDamage: 687 - 200 [Quen reduction] = 487; Quen shieldHealth: 200 - (200 / 2.131 [spellPower]) = 106;
vitalityDamage: 577 - 106 [Quen reduction] = 471; Quen shieldHealth: 106 - (106 / 2.131 [spellPower]) = 56;
vitalityDamage: 605 -  56 [Quen reduction] = 549; Quen shieldHealth:  56 - ( 56 / 2.131 [spellPower]) = 29;
Axe2h dies.

Last Quen health below 40 always ends Quen.

Sometimes penetrated Quen may be drained whole-at-once to prevent staggering. This seems to be a feature in TW3, producing log:
[Buffs] EffectManager.InternalAddEffect: Geralt has active quen so it breaks and we don't stagger.