Dependencies for Custom Kingdoms and Cultures

Users who are viewing this thread

fatrod

Recruit
Hi there,

I have been working on a basic historical mode, following the guides from the "Custom Kingdom Creation Guide" on Nexusmods, and the videos on Banner Lab's YouTube channel.

So far I have been experimenting with XML files for custom lords, heroes, factions, kingdoms, cultures, and settlements.

I can get lords, heroes and factions to work ok, but as soon as I add a custom kingdom and/or culture I start getting crashes about 10-20 days into a campaign. This seems to occur when the AI is in the process of assigning/changing governors. If I remove the custom cultures and kingdoms, this crash goes away.

Note I also get this crash, roughly the same timeframe, if I use the files from "Custom Kingdom Creation Guide" even without any further modifications. So there definitely seems to be additional dependencies missing from those guides.

Does anyone have a comprehensive list of what other XML files kingdoms and cultures have dependencies on?

FYI I am aware that my custom kingdom needs a settlement, and I have also tried the OnGovernorChanged workaround mod...that does not seem to stop this particular crash.

Any help would be appreciated.

Cheers
 

sh1ny4

Veteran
I had the same issue almost a month ago, didn't find the solution either
from what I have seen the only things I did'nt add to my new culture are an image for the choice of culture and equipments for the character creation but it shouldn't cause such issue
 

fatrod

Recruit
No I wouldn't think they matter, especially if its an AI faction.

I've now got XMLs for lords, heroes, spclans, settlements, spkingdoms, spspecialcharacters, spcultures, partyTemplates, and spnpccharacters...launches ok but get a crash eventually, like 20+ turns.

This was my latest one:

Outer exception callstack: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at TaleWorlds.CampaignSystem.CampaignBehaviors.AiBehaviors.AiMilitaryBehavior.CalculateMilitaryBehaviorForSettlement(Settlement settlement, ArmyTypes missionType, AiBehavior aiBehavior, PartyThinkParams p, Single ourStrength, Single partySizeScore, Int32 numberOfEnemyFactionSettlements, Single totalEnemyMobilePartyStrength, Single newArmyCreatingAdditionalConstant)
at TaleWorlds.CampaignSystem.CampaignBehaviors.AiBehaviors.AiMilitaryBehavior.CalculateMilitaryBehaviorForFactionSettlementsParallel(IFaction faction, PartyThinkParams p, ArmyTypes missionType, AiBehavior aiBehavior, Single ourStrength, Single partySizeScore, Single newArmyCreatingAdditionalConstant)
at TaleWorlds.CampaignSystem.CampaignBehaviors.AiBehaviors.AiMilitaryBehavior.FindBestTargetAndItsValueForFaction(ArmyTypes missionType, PartyThinkParams p, Single ourStrength, Single newArmyCreatingAdditionalConstant)
at TaleWorlds.CampaignSystem.CampaignBehaviors.AiBehaviors.AiMilitaryBehavior.AiHourlyTick(MobileParty mobileParty, PartyThinkParams p)
at TaleWorlds.CampaignSystem.MbEvent`2.InvokeList(EventHandlerRec`2 list, T1 t1, T2 t2)
at TaleWorlds.CampaignSystem.CampaignEvents.AiHourlyTick(MobileParty party, PartyThinkParams partyThinkParams)
at TaleWorlds.CampaignSystem.CampaignEventDispatcher.AiHourlyTick(MobileParty party, PartyThinkParams partyThinkParams)
at TaleWorlds.CampaignSystem.CampaignBehaviors.AiBehaviors.AiPartyThinkBehavior.PartyHourlyAiTick(MobileParty mobileParty)
at TaleWorlds.CampaignSystem.MbEvent`1.InvokeList(EventHandlerRec`1 list, T t)
at TaleWorlds.CampaignSystem.CampaignEvents.TickPartialHourlyAi(MobileParty party)
at TaleWorlds.CampaignSystem.CampaignEventDispatcher.TickPartialHourlyAi(MobileParty party)
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.PeriodicTicker`1.PeriodicTickSome(Double timeUnitsElapsed)
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.TickPartialHourlyAi()
at TaleWorlds.CampaignSystem.Campaign.Tick()
at TaleWorlds.CampaignSystem.GameState.MapState.OnMapModeTick(Single dt)
at TaleWorlds.CampaignSystem.GameState.MapState.OnTick(Single dt)
at TaleWorlds.Core.GameStateManager.OnTick(Single dt)
at TaleWorlds.Core.Game.OnTick(Single dt)
at TaleWorlds.Core.GameManagerBase.OnTick(Single dt)
at TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch1(Module this, Single dt)
 

NPC99

Baron
M&BWBWF&SVC
If your custom culture is major (not a minor faction), you need a custom culture version of every npc, notable, education_template etc. for it to work in game. Unfortunately, you can't build a culture in stages, it needs every dependancy. Use all the elements in spcultures.xml as a guide. Apart from stuff like mercenaries and forenames, your new culture needs new culture elements to be created for everything listed.
 

sh1ny4

Veteran
If your custom culture is major (not a minor faction), you need a custom culture version of every npc, notable, education_template etc. for it to work in game. Unfortunately, you can't build a culture in stages, it needs every dependancy. Use all the elements in spcultures.xml as a guide. Apart from stuff like mercenaries and forenames, your new culture needs new culture elements to be created for everything listed.
I do have everything done outside of what I mentionned earlier, including every npc to the new culture. Else I wouldn't be able to start a campaign, I'll have to take a look again but I don't see why the governor gives an issue
 

fatrod

Recruit
Yeh I also get this issue when only using a custom kingdom and not a culture. So there seems to be dependencies on kingdoms too.
 

NPC99

Baron
M&BWBWF&SVC
Yeh I also get this issue when only using a custom kingdom and not a culture. So there seems to be dependencies on kingdoms too.
They also need at least one town of that culture (settlements.xml) and populated clan (spclans.xml, heroes.xml, lord npcs etc) of that culture and kingdom, which owns it.
I don't see why the governor gives an issue
Hmm. Seems others are experiencing governor crashes as well: https://www.nexusmods.com/mountandblade2bannerlord/mods/4291?tab=description
Hopefully, the bug necessitating this workaround will be fixed ASAP
 
Last edited:

fatrod

Recruit
They also need at least one town of that culture (settlements.xml) and populated clan (spclans.xml, heroes.xml, lord npcs etc) of that culture and kingdom, which owns it.

Hmm. Seems others are experiencing governor crashes as well: https://www.nexusmods.com/mountandblade2bannerlord/mods/4291?tab=description
Hopefully, the bug necessitating this workaround will be fixed ASAP
Yeh definitely aware of the settlement dependency, which is why I think this bug is something else. Maybe its not even culture related.
 
Hi there,

I have been working on a basic historical mode, following the guides from the "Custom Kingdom Creation Guide" on Nexusmods, and the videos on Banner Lab's YouTube channel.

So far I have been experimenting with XML files for custom lords, heroes, factions, kingdoms, cultures, and settlements.

I can get lords, heroes and factions to work ok, but as soon as I add a custom kingdom and/or culture I start getting crashes about 10-20 days into a campaign. This seems to occur when the AI is in the process of assigning/changing governors. If I remove the custom cultures and kingdoms, this crash goes away.

Note I also get this crash, roughly the same timeframe, if I use the files from "Custom Kingdom Creation Guide" even without any further modifications. So there definitely seems to be additional dependencies missing from those guides.

Does anyone have a comprehensive list of what other XML files kingdoms and cultures have dependencies on?

FYI I am aware that my custom kingdom needs a settlement, and I have also tried the OnGovernorChanged workaround mod...that does not seem to stop this particular crash.

Any help would be appreciated.

Cheers
Hey I'm the author of the Kingdom Creation Guide. You came to my guide just as I'm rewriting it and including new code that wasn't present before. I imagine this is probably what was missing at the time. Only half of the new guide is currently available as I'm still in the process of writing the rest.
 

fatrod

Recruit
@TheREALHayster stupid question...how do I remove/stop the default clans and kingdoms from spawning? Is it at simple as moving my mode above sandbox in the load order?

I know that if I reuse the existing kingdom IDs then the default clans will still spawn. But if I try to remove / replace existing kingdom IDs then my mod won't load due to other dependencies (like settlements).
 
Last edited:

sh1ny4

Veteran
I do not know wether or not this has been fixed but I loaded my mod yesterday with no change done and didn't have a crash
I only waited 25 days so might not be accurate but the issue might have been solved
 

fatrod

Recruit
Yeh I have been able to run for a long time without a crash as well!
I do not know wether or not this has been fixed but I loaded my mod yesterday with no change done and didn't have a crash
I only waited 25 days so might not be accurate but the issue might have been solved
 
Top Bottom