Mount & Blade II: Bannerlord

Mount & Blade II: Bannerlord

DynaCulture
Lluid 21 Dec, 2022 @ 6:36am
Culture inconsistency after giving a town to a companion (but not always)
Hi, as a Vlandian king, I decided to give titles and towns to 4 of my companions with Vlandian culture :
Marunath, Seonon, Varcheg and Sibir (all these cities had the Vlandian culture when I gifted them).
Weirdly, Marunath was the only one to revert to its original Culture for a while (Battanian), but then it went back to Vlandian culture because of surrounding influences so I thought everything was fine.

However, I didn't notice that the loyalty calculations were still incorrect in Marunath (as if there was a culture mismatch), until a revolt occured.
In this save, you can see the wrong loyalty calculations and if you wait a bit they should revolt.

Link to save and mod config.[drive.google.com]

This looks like a complex issue because it only happened in 1 out of 4 towns. Do you know how to solve this so that loyalty is calculated correctly again ?

There are two other consequences that might not be related : if I'm defending a siege at the moment of a revolt (like in the save), I get a message stating that my clan is not at war anymore with my own Faction (???) and my party is suddenly outside the town I'm trying to defend (it's not the town that is revolting).
< >
Showing 1-11 of 11 comments
Manpapper  [developer] 21 Dec, 2022 @ 9:34am 
Hi,

Thanks for the save.
I think I know where the problem comes from.
It's an old problem, in the first version of the mod the game was crashing if there wasn't any settlement of a culture (because companion of a culture couldn't spawn.)
To fix this, Splintert the author of the mod, force that at least one of each culture has at least 1 settlement.

I didn't try to remove this "fix", and I never gone as far as you in any of my save, so I will remove it and pass the time to check if it's still a problem.

If it isn't a problem anymore, I will release a new version, in any case, I will keep you up to date.
Last edited by Manpapper; 21 Dec, 2022 @ 9:35am
Manpapper  [developer] 21 Dec, 2022 @ 9:40am 
Also, I don't know if you enable it but there is an option where governor culture affect the settlement culture
Manpapper  [developer] 21 Dec, 2022 @ 9:43am 
Nevermind, I won't have the time to test it and revert it if there is a problem in the following days.
So I will compile it and make it available on nexus since there can only have one version on steam
Last edited by Manpapper; 21 Dec, 2022 @ 9:43am
Manpapper  [developer] 21 Dec, 2022 @ 9:51am 
Last edited by Manpapper; 21 Dec, 2022 @ 9:51am
Lluid 21 Dec, 2022 @ 10:54am 
Thank you very much, I'm gonna try this version.
Good to know about the "one settlement" rule, it seems I'll have to spawn new companions until the new one happens to be in a culture that has no town.

I'd like to point out that the main issue is that the culture shown in the encyclopedia is wrong : it shows Vlandia in this case but shouldn't.
Lluid 21 Dec, 2022 @ 11:11am 
I'm getting an error message when starting the mod, "cannot load :
..\..\Modules\DynaCulture\bin\Win64_Shipping_Client\DynaCulture.dll"
yet that's the place where I put it.

I don't know if I did something wrong, at least I unsubscribed from the original mod so it doesn't interfere.
Manpapper  [developer] 21 Dec, 2022 @ 11:29am 
Did you try deleting the older folder before adding it ?

Also if you subscribe using steam you should unsubscribe and use the one of nexus only.
Maybe nexus and steam mods are in conflict
Lluid 21 Dec, 2022 @ 6:18pm 
I had not downloaded mods from nexusmods in a while so I had forgotten you have to unblock the dll, now it works.

So far I wasn't able to crash the game, however in my current situation I can't really test much because I don't have any battanian town to give and the "campaign.add_companion" forces the culture to match the player culture so I don't know how to spawn a battanian wanderer. (battania is the only culture with no town currently)


But the problem remains : in Marunath (encyclopedia), the Culture is shown as "Vlandia" just like the owner (former companion) but the loyalty tooltip still says Owner's Culture -3.

I realised that he put his empire wife as governor, leading to "governor's culture -1" as expected but that doesn't explain the -3 from the clan leader.
Lluid 21 Dec, 2022 @ 6:48pm 
I tried a bit more, it gets really weird but I think it has nothing to do with DynaCulture :
I gave Balgard (that was Vlandian) to a companion from the empire.
I was expecting the culture to be a problem, but this time there's no negative effect from the owner's culture !
I still see a "-1" from the governor as expected but the calculation for the owner seems wrong.

In the game code it seems this line has a problem but I don't know what :
if (town.Settlement.OwnerClan.Culture != town.Settlement.Culture)
{...
Lluid 22 Dec, 2022 @ 4:18am 
I tried to dig deeper with dnSpy, with my limited knowledge.
When a new clan is created (when a companion becomes noble), the clan culture is NOT the culture of the leader as I thought but rather the culture of the settlement at that moment.
In the class TaleWorlds.CampaignCystem.Clan :

clan.InitializeClan(clanName, clanName, settlement.Culture, ...

I'm afraid DynaCulture has to take this into account but I don't know how : should the owner clan culture switch when the town culture switches ? But then what if the clan has multiple towns ?
Or should you directly modify the new clan's culture to match the kingdom's by listening to this event OnCompanionClanCreated ?
Lluid 22 Dec, 2022 @ 7:01am 
Sorry for the number of posts, but I can confirm that the game code includes a solution in case there is no town of a given culture when spawning a new wanderer.
In TaleWorlds.CampaignSystem.CampaignBehaviors.CreateCompanionAndAddToSettlement they try to find "settlement2" with the companion culture but if it's null they pick a random Town.
So you're right, the fact of removing the old "fix" should not lead to crashes anymore.
< >
Showing 1-11 of 11 comments
Per page: 1530 50