Wizardry 8

Wizardry 8

peddroelm Apr 22, 2020 @ 6:00am
BASE ATTACK RATING FORMULA (updated)
Attack rating (is extremely likely but not tested/ formula for it yet) the main statistic a character uses in the melee and ranged to hit dice rolls.
The actual base attack rating stat is not show anywhere in the game UI. The game displays as Base: in UI when hovering over the number next to Attack Rating floor(actual_baseAR/5).

Due to my previous tests (altering the other stats using a savegame editor) - the formula I had for UI BASE AR WHEN USING A SINGLE WEAPON in my guide was:
UI BAR SINGLE WEAPON = Floor(dex/30 + (2/45) * (CC_RC + 2 * WPN) + (ProfessionLvLUpMul * 2 * Lvl) / 30) + 12

Now we know the real value is actually ~5 times higher and that the game doesn't use floating point math for (most) combat calculations (the game engine does make use of floats for coordinates on the map, portal spell's location, combat camera work, aiming.. ). Which means integer math with lots of rounding errors (divisions by powers of 2) ... So after spending a few hours with the disassembler:

BAR SINGLE WEAPON = Floor( Floor(( CC_RC + 2 * WPN ) / 3 ) * 2 + Floor(DEX/2) + SUM(ProfessionLvLUpMul * Lvl) ) / 3) + 60

BAR DUAL WIELD MH = floor((floor((floor((CC_RC + 2*WPN1)/1.5) + floor(WPN1/2) + DW) * 10/35)*2 - 10 - floor((100-DW)/4 ) + floor(DEX/2) + SUM(ProfessionLvLUpMul * Lvl))/3) + 60.
BAR DUAL WIELD OH = floor((floor((floor((CC_RC + 2*WPN2)/1.5) + floor(WPN2/2) + DW) * 10/35)*2 - 20 - floor((100-DW)/4 ) + floor(DEX/2) + SUM(ProfessionLvLUpMul * Lvl))/3) + 60.

Many of the terms in those formulas appeared in silicod's formulas for # attacks and swings but I could't divine them without a code dive ..

whiped out a basic BAR calculator here (Attack rating sheet)
https://docs.google.com/spreadsheets/d/1yNkklKuxwGQro4Zne13GtjF4Z4LYmaHJjZNXnkcJg6c/edit#gid=572099265

should be able to make a copy and play with the numbers ..

As a quick observation - all (offensive) combat skills roll most skill level dices when their swings hit.. Dual wielding ( becomes eventually) a great to add extra swings to trains skills, do damage and trigger apply effect dice rolls .. But at very low dual wield level it penalizes BOTH hads CTH/CTP heavily .. Also it doesn't seem to roll to level up as often as weapon skills (senses as a controlling attribute bit of an issue for STR/DEX meta ..), If you gonna use this pump points at level up !! highest priority (only 'trick' I can thing of for it - use dual throw as your ranged option to also train it while ranged attacking, sadly the amount of throwing weapons ammo in the game doesn't support multiple weapon throwers in an un-modded game without excessive vendor camping ) ... Try to get weapons with + to hit bonuses if you can (easier said than done :) ) ..


Example calculation:


Fighter lvl 20 (profmul 4)
DEX = 105 ; CC = 100 ; Mace 90 ; DW 81 .

Single weapon (mace):
BAR =floor ((floor(floor(( 100 +2 * 90 )/3)) *2 + floor(105/2) + 4 * 20 )/3) + 60 = 166 // UI shows 33

Dual wielding maces
MH BAR = floor((floor((floor((100 + 90 *2 ) /1.5) + floor(90/2) + 81) * 10/35 ) *2 -10 - floor((100 - 81)/4) + floor(105/2) + 4 * 20) /3 + 60 = 158 // UI Shows 32

OH BAR = floor((floor((floor((100 + 90 *2 ) /1.5) + floor(90/2) + 81) * 10/35 ) *2 -20 - floor((100 - 81)/4) + floor(105/2) + 4 * 20) /3 + 60) = 155 // UI shows 31



Final nail in the old Myth that Lord's 25% bonus to DW does nothing. Not only does make it easier to get going (enough AR to score the hits that train the skills) BUT at 125% makes both hands have better BAR than single weapon alone.. (unbalanced bonuses from STR to off hand will still off hand worse off (AR = BAR + to hit) than single weapon but, strictly BAR speaking, DW 25% is nothing to sneeze at )



EDIT: will need to investigate a bit further as I just noticed switching my diamond eyes in of hand with the serpent tooth lowered the BAR of the main hand .. According to this (as it is written now) , such things should not happen ...
Last edited by peddroelm; Apr 25, 2020 @ 1:18am
< >
Showing 1-9 of 9 comments
mpnorman10 Apr 22, 2020 @ 3:05pm 
Peddroelm, this is excellent but I am trying to understand. The the sub-expression:

SUM(ProfessionLvLUpMul * Lvl)

does not make sense to me. SUM implies multiple terms being added. The ProfessionLvLUpMul is just a constant, right? So is the summation over a range of levels? As written the SUM is a sum of only one entry. Are the parentheses right?
kaymarciy Apr 22, 2020 @ 4:15pm 
Originally posted by mpnorman10:
does not make sense to me. SUM implies multiple terms being added. The ProfessionLvLUpMul is just a constant, right?
It differs for various professions. It comes from DnD - full Base Attack Bonus progression classes, 2/3 BAB classes, 1/2 BAB classes...

Btw. An interestin thing which Peddroelm mentioned to me in a coversation, but didn't post here - apparently Encumberance doesn't affect modern weapons, because you simply pull the trigger of your gun.
peddroelm Apr 22, 2020 @ 7:03pm 
@mpnorman10

Not all professions gain BAR per level the same... Fighter gets 4 per level , Mage gets 2 ..
So considering multiclass (really multi profession in wizardry 8) one must sum this amount of AR gained per level up by every profession the character has leveled up in. This AR per level is also
an important factor in # of attacks and number of swings formulas.. (and why Fighters get 2 or 3 attacks much earlier level wise than say Mages)

for expedience I'll dump Silicoid's table
"
LevelByProfession - How many Character levels were in this profession
MultiplierByProfession - Multiplier for a particular profession (see table)
SUM - sum for all professions

Multiplier table for professions:
----- ----------------------
Profession - Multiplier
------------------------- -
Warrior - 4
Lord - 4
Valkyrie - 4
Ranger - 4
Samurai - 4
Ninja - 4
Monk - 4
Thief - 3
Gadgeteer - 3
Bard - 3
Priest - 2
Alchemist - 2
Bishop - 2
Psionic - 2
Mage - 2
"

So lvl 7 : 4 levels Bard 2 levels Bishop 1 lvl Valkyrie (is this the worst way one could multi-profession a char ? :P) would get this term as 4 * 3 + 2 * 2 + 1 * 4 = 20 .
A lvl 7 Ninja on the other hand would just gain 7 * 4 = 28 ..


This was covered in my game mechanics guide ...

About the encumbrance thing I religiosly avoid it ( max STR on all 8 chars, even if on some as a third priority ),.. Again Silicoid's table probably relevant : (this should be 'easy' ) for me to test now that I can see the true AR and the rest of the terms in the formula without having to dig through more assembly code..

"
Overload factor

IF White TO OVL = 0
IF Blue TO OVL = -15
IF Green TO OVL = -30
IF Yellow TO OVL = -60
IF Red TO OVL = -120
"
OVL would go in before the final /3 division in both cases...(notice how nicely those overload BAR / # attacks / # swings penalty numbers are all divisible by 3 ; 15 really if one considers the displayed BAC value -1 -2 -4 - 8)

On the Modern Weapon : I didn't mentioned because I haven't tested it yet.. Again not a fan of modern weapons in Wiz8 (no STR applied) -> just noticed a weapon type Modern Weapon check in assembly right after the encumbrance check .. Might mean they ignore encumbrance, might mean they suffer less from it .. It would take more tests/effort to get a definitive statement on it. (and atm I'm focusing on things that are higher priority to me) .. (again 'should' not a hard thing to test when the rest of the formula is known and true BAR 'visible' .. load a char up with weight check effect on BAR.. See then if the effect is the same if using modern weapons) ..
EDIT: ANOTHER IDEA , check if item used is bellow 7 (modern weapon) . Might've been simply a check to see if we USED A WEAPON !!







Last edited by peddroelm; Apr 22, 2020 @ 9:29pm
mpnorman10 Apr 22, 2020 @ 7:09pm 
Originally posted by kaymarciy:
It differs for various professions.

It is a constant in the mathematical sense, in the formula. What I was referring to is that sum implies there are multiple entries to add, if for example the SUM was actually a summation in this context over a range of levels each multiplied by whichever constant applies for that type of character to which the formula is applied. I was asking Peddroelm to clarify the formula in that place, whether there is some sort of summation, for example, or whether it applies differently to the terms in the formula.

Maybe it is obvious and I am just not seeing it :steamfacepalm:, that happens.

EDIT: Crosspost, I see Peddroelm (thank you) has just answered.

Ah, I stand corrected. Kaymarciy you were right and me wrong. It is a summation over the value per profession multipled by the number of levels in that profession. Thank you both for your patience with me.

Peddroelm I share your love of Strength in characters to, among other reasons, prevent encumbrance. Thank you for your further explanation.
Last edited by mpnorman10; Apr 22, 2020 @ 7:16pm
kaymarciy May 3, 2020 @ 2:10pm 
Originally posted by peddroelm:
On the Modern Weapon : I didn't mentioned because I haven't tested it yet.. Again not a fan of modern weapons in Wiz8 (no STR applied) -> just noticed a weapon type Modern Weapon check in assembly right after the encumbrance check .. Might mean they ignore encumbrance, might mean they suffer less from it .. It would take more tests/effort to get a definitive statement on it. (and atm I'm focusing on things that are higher priority to me) .. (again 'should' not a hard thing to test when the rest of the formula is known and true BAR 'visible' .. load a char up with weight check effect on BAR.. See then if the effect is the same if using modern weapons) ..
EDIT: ANOTHER IDEA , check if item used is bellow 7 (modern weapon) . Might've been simply a check to see if we USED A WEAPON !!
Just looked at that place (or at least what I think to be that place?) in the code myself. The game indeed checks if the weapon is governed by the Modern Weapon skills and if it is, it halves the penalty from fatigue.
kaymarciy May 3, 2020 @ 2:32pm 
Oh my god, I can't believe this is a thing... The game keeps track of how many times a character had to retarget (due to his previous target dying or running away) during the round. If this value is above 0, then this character gets an additional penalty to CTH when attacking:

Concentration_Penalty = 50 - (Speed + Base_AR - (50 + 25 * Retarget_Counter) ) ^ 0.75

The game actually calls the floating-point arithmetic here, this is an amazing attention to details.
Last edited by kaymarciy; May 3, 2020 @ 2:42pm
vysionier May 3, 2020 @ 3:12pm 
Oh my god. That’s crazy. So retargeting matters, but it seems as though it makes speed relevant at high levels as well!!
Zergs May 3, 2020 @ 6:46pm 
Originally posted by kaymarciy:
Just looked at that place (or at least what I think to be that place?) in the code myself. The game indeed checks if the weapon is governed by the Modern Weapon skills and if it is, it halves the penalty from fatigue.

Halves the penalty from low fatigue, or halves the stamina cost to fire?
kaymarciy May 4, 2020 @ 3:22am 
Originally posted by Zergs:
Halves the penalty from low fatigue, or halves the stamina cost to fire?
The Penalty from fatigue (a.k.a low stamina). It may or may not affect stamina cost, I didn't look there.
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Apr 22, 2020 @ 6:00am
Posts: 9