Users who are viewing this thread

Version number
e1.7.0
Branch
Beta
Modded/unmodded
No, I didn't use any mods.

CptMuppet

Sergeant
Summary: Battanian cultural effect - "10% slower build rate for town projects in settlements" - cause incorrect calculations of construction points in settlements.

I didn't check the code, but from my in-game observations it seems like the implementation of the method that calculates construction bonus/effect from settlement's loyalty is messed up if the owner of the settlement is a Battanian.
For example, if settlement have loyalty below 25 and non-battanian owner, there will be 0 construction points because loyalty below 25 gives 100% penalty to settlement's construction points.
However, if the owner has battanian culture, then loyalty below 25 will give 90% penalty to the construction, and on top of that the battanian cultural effect will give 10% penalty to the remaining construction points. That will give you in total 91% penalty of base construction, and because of this you will end up incorrectly having some construction points while having loyalty below 25.
It also wrongly calculates loyalty penalties and bonuses for higher loyalty values if settlement's owner has battanian culture.


In order to show you what exactly is the issue with this battanian cultural effect, I must explain how construction points are calculated in a first place.

Instead of showing an efficient way of calculating construction points for an in-game use, I'll try to kind of reverse engineer the way of how the game calculates it. The goal of this is to show the logic behind the calculations and its flaws. I hope my guess is close enough to the actual code implemenation to be helpful for you.


Basically the formula for construction points looks like this:
TotalConstructionPoints = BaseConstruction + ConstructionFromLoyalty + BattanianConstructionPenalty

BaseConstruction
is a sum of construction points from various town effects like prosperity, governor, gold boost, buildings' effects, etc. Simply all the things that give construction points except Loyalty and battanian cultural penalty. Its details don't really matter in this post.

ConstructionFromLoyalty = BaseConstruction * LoyaltyBonus

BattanianConstructionPenalty
calculaton is based on BaseConstruction modified by ConstructionFromLoyalty first. This is the first part of the problem that is causing the bug. Here's a formula for battanian settlements' owners (for non-battanian ones it is just zero):
BattanianConstructionPenalty = (BaseConstruction + ConstructionFromLoyalty) * (-0.1)


The last thing needed for the calculations is LoyaltyBonus. It is calculated differently for four different ranges of the loyalty. It is also calculated differently for non-battanian and battanian settlements' owners, which is the second, the last, and the main part of the problem that is causing the bug. I will use a table to show formulas for Loyalty bonus:

for Loyalty from rangefrom 0 to 25from 25 to 50from 50 to 75from 75 to 100
non-battanian LoyaltyBonus =-1(Loyalty - 50) * 0.020(Loyalty - 75) * 0.008
battanian LoyaltyBonus =-1 * 0.9(Loyalty - 50) * 0.02 * 0.90 * 0.9(Loyalty - 75) * 0.008 * 0.9


It seems like the idea behind calculating LoyaltyBonus differently for battanian culture was to avoid having negative construction points for Loyalty below 25. If that is the case, then formula for BattanianConstructionPenalty is wrong because this penalty should be based on unmodified BaseConstruction to get 0 construction points at this Loyalty. This formula should look like this:
BattanianConstructionPenalty = BaseConstruction * (-0.1)
However, even the idea itself is bad here, because for Loyalty in ranges from 25 to 50, and from 75 to 100, calculations would be still wrong compared to other cultures.


Here are two ways of calculating construction points correctly I can think of:
For both of them you need to calculate LoyaltyBonus the same way for settlements owned by battanian heroes as you are currently calculating for that owned by non-battanian ones.

First way: If you are fine with having Battanian penalty based on construction points modified by Loyalty first, then you don't have to change anything more.

Second way: If you want to have Battanian penalty based on unmodified by Loyalty construction points, then there is one more thing to change. You need to just add something like "if" statement in LoyaltyBonus calculation for battanian heroes - if its value goes below -0.9 then it is treated as -0.9.


I have created a ticket with two save files.
In both of them my party is in my own town, and in both loyalty of the town is a little below 25. Waiting one in-game day will increase it to over 25 for towns from both saves. Important difference between them is the culture of my main hero. You can easly check there that Loyalty construction bonus/penalty is calculated incorrectly for battanian culture, and battanian penalty is 10% of construction points which remained after applying Loyalty bonus/penalty first.
In "battanian penalty bug Bcul.sav" the culture of main hero is battanian.
In "battanian penalty bug NBcul.sav" the culture of main hero is vladian.


How to Reproduce: Compare construction penalty from loyalty between both my saves and check battanian penalty value in "battanian penalty bug Bcul.sav". Specifically, compare percentage of this penalties to the sum of the construction points gains. You can wait one in-game day to change loyalty penalty to a different stage and compare penalties again.
Have you used cheats and if so which: No, I have not used any cheats.
Scene Name (if related): N/A
Media (Screenshots & Video): N/A
Computer Specs:
OS: Windows 10 Pro 64bit
GPU: NVIDIA Geforce RTX 2070 SUPER
GPU Driver Version: 472.12
CPU: AMD Ryzen 5 3600
RAM: 2 x 8GB DDR4 3200MHz
Motherboard: MSI B450-A PRO MAX
Storage Device (HDD/SSD): SSD 1TB M.2 PCIe NVMe
 

MArdA TaleWorlds

Community Support & Localization
Community Support
M&BWBWF&SNWVC
Forwarded to the QA team for further investigation. We will reach out again if we need more information. Thanks for reporting and sorry for any inconvenience!
 

MArdA TaleWorlds

Community Support & Localization
Community Support
M&BWBWF&SNWVC
I've been informed that this bug is fixed and the fix will be sent to the game with future patches. Thanks for reporting and sorry for any inconvenience!
 
Top Bottom