R-Vaccari / bannerlord-banner-kings

BSD 3-Clause "New" or "Revised" License
65 stars 1.04k forks source link

Crashes after several hours that corrupts all saves #137

Open ataniphor opened 1 year ago

ataniphor commented 1 year ago

I am using the Bannerkings at war collection (https://next.nexusmods.com/mountandblade2bannerlord/collections/pnzkoo?tab=mods) and constantly getting this crash after several hours of game play. (often crashes around 20 days). Afterwards, earlier saves of that campaign are also corrupted regardless if the saves were from before the crash happened. Had a few extra save files and it did not help.

After disabling a bunch of other mods, disabling bannerkings actually gets a different crash report but its likely due to the save being incompatible. (mscorlib null value sorta thing)

The current callstack is:

Exception information Type: System.NullReferenceException Message: Object reference not set to an instance of an object. Source: TaleWorlds.CampaignSystem CallStack:

at Hero TaleWorlds.CampaignSystem.Party.PartyComponents.BanditPartyComponent.get_PartyOwner()
at Hero TaleWorlds.CampaignSystem.Party.PartyBase.get_Owner()
at IFaction TaleWorlds.CampaignSystem.Party.MobileParty.get_MapFaction()
at void TaleWorlds.CampaignSystem.MapEvents.MapEvent.Update()
at void TaleWorlds.CampaignSystem.MapEvents.MapEventManager.Tick()
at void TaleWorlds.CampaignSystem.Campaign.Tick()
at void TaleWorlds.CampaignSystem.GameState.MapState.OnMapModeTick(float dt)
at void TaleWorlds.CampaignSystem.GameState.MapState.OnTick(float dt)
at void TaleWorlds.Core.GameStateManager.OnTick(float dt)
at void TaleWorlds.Core.Game.OnTick(float dt)
at void TaleWorlds.Core.GameManagerBase.OnTick_Patch9(GameManagerBase this, float dt)
at void TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch2(Module this, float dt)

enhanced stacktrace:

Frame: Hero TaleWorlds.CampaignSystem.Party.PartyComponents.BanditPartyComponent.get_PartyOwner() (IL Offset: 0)

Module: UNKNOWN
Method: virtual TaleWorlds.CampaignSystem.Hero TaleWorlds.CampaignSystem.Party.PartyComponents.BanditPartyComponent::get_PartyOwner()
Method From Stackframe Issue: False

Frame: Hero TaleWorlds.CampaignSystem.Party.PartyBase.get_Owner() (IL Offset: 0)

Module: UNKNOWN
Method: TaleWorlds.CampaignSystem.Hero TaleWorlds.CampaignSystem.Party.PartyBase::get_Owner()
Method From Stackframe Issue: False

Frame: IFaction TaleWorlds.CampaignSystem.Party.MobileParty.get_MapFaction() (IL Offset: 0)

Module: UNKNOWN
Method: virtual TaleWorlds.CampaignSystem.IFaction TaleWorlds.CampaignSystem.Party.MobileParty::get_MapFaction()
Method From Stackframe Issue: False

Frame: void TaleWorlds.CampaignSystem.MapEvents.MapEvent.Update() (IL Offset: 41)

Module: UNKNOWN
Method: System.Void TaleWorlds.CampaignSystem.MapEvents.MapEvent::Update()
Method From Stackframe Issue: False

Frame: void TaleWorlds.CampaignSystem.MapEvents.MapEventManager.Tick() (IL Offset: 92)

Module: UNKNOWN
Method: System.Void TaleWorlds.CampaignSystem.MapEvents.MapEventManager::Tick()
Method From Stackframe Issue: False

Frame: void TaleWorlds.CampaignSystem.Campaign.Tick() (IL Offset: 68)

Module: UNKNOWN
Method: System.Void TaleWorlds.CampaignSystem.Campaign::Tick()
Method From Stackframe Issue: False

Frame: void TaleWorlds.CampaignSystem.GameState.MapState.OnMapModeTick(float dt) (IL Offset: 140)

Module: UNKNOWN
Method: System.Void TaleWorlds.CampaignSystem.GameState.MapState::OnMapModeTick(System.Single dt)
Method From Stackframe Issue: False

Frame: void TaleWorlds.CampaignSystem.GameState.MapState.OnTick(float dt) (IL Offset: 77)

Module: UNKNOWN
Method: virtual System.Void TaleWorlds.CampaignSystem.GameState.MapState::OnTick(System.Single dt)
Method From Stackframe Issue: False

Frame: void TaleWorlds.Core.GameStateManager.OnTick(float dt) (IL Offset: 47)

Module: UNKNOWN
Method: System.Void TaleWorlds.Core.GameStateManager::OnTick(System.Single dt)
Method From Stackframe Issue: False

Frame: void TaleWorlds.Core.Game.OnTick(float dt) (IL Offset: 0)

Module: UNKNOWN
Method: System.Void TaleWorlds.Core.Game::OnTick(System.Single dt)
Method From Stackframe Issue: False

Frame: void TaleWorlds.Core.GameManagerBase.OnTick_Patch9(GameManagerBase this, float dt) (IL Offset: -1)

Module: UNKNOWN
Method: static System.Void TaleWorlds.Core.GameManagerBase.OnTick_Patch9(TaleWorlds.Core.GameManagerBase this, System.Single dt)
Method From Stackframe Issue: False

Frame: void TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch2(Module this, float dt) (IL Offset: -1)

Module: UNKNOWN
Method: static System.Void TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch2(TaleWorlds.MountAndBlade.Module this, System.Single dt)
Method From Stackframe Issue: False

Mod Version tested on vers 1.14, modlist is the Bannerkings at war collection Installed Modules

[+ Harmony (Bannerlord.Harmony, v2.3.0.0)](javascript:;)
[+ ButterLib (Bannerlord.ButterLib, v2.8.0.0)](javascript:;)
[+ UIExtenderEx (Bannerlord.UIExtenderEx, v2.8.0.0)](javascript:;)
[+ Mod Configuration Menu v5 (Bannerlord.MBOptionScreen, v5.7.1.0)](javascript:;)
[+ Native (Native, v1.1.4.0)](javascript:;)
[+ SandBox Core (SandBoxCore, v1.1.4.0)](javascript:;)
[+ Sandbox (Sandbox, v1.1.4.0)](javascript:;)
[+ Achievement Unblocker (AchievementUnblocker, v1.0.4.0)](javascript:;)
[+ StoryMode (StoryMode, v1.1.4.0)](javascript:;)
[+ CustomBattle (CustomBattle, v1.1.4.0)](javascript:;)
[+ Birth and Death Options (BirthAndDeath, v1.1.4.0)](javascript:;)
[+ Arena Overhaul (ArenaOverhaul, v1.3.5.0)](javascript:;)
[+ BannerLib (BannerLib, v1.0.0.0)](javascript:;)
[+ Banner Fix (BannerFix, v2.0.0.0)](javascript:;)
[+ Better HUD (BetterHUD, v1.9.0.0)](javascript:;)
[+ Better Time (BetterTime, v1.2.9.0)](javascript:;)
[+ Character Manager (CharacterManager, v3.3.1.0)](javascript:;)
[+ Character Reload (CharacterReload, e1.1.0.0)](javascript:;)
[+ Cheats (Cheats, v3.0.1.0)](javascript:;)
[+ Raise your Torch (RaiseYourTorch, v5.2.0.0)](javascript:;)
[+ CustomizableTroopWages (CustomizableTroopWages, v0.4.0.0)](javascript:;)
[+ EquipBestItem (EquipBestItem, v1.10.0.0)](javascript:;)
[+ Fourberie (Fourberie, v12.2.3.0)](javascript:;)
[+ HoldCourt (HoldCourt, v1.0.13.0)](javascript:;)
[+ Diplomacy (Bannerlord.Diplomacy, v1.2.5.0)](javascript:;)
[+ Improved Garrisons (ImprovedGarrisons, v4.1.2.9)](javascript:;)
[+ KillBanditsRaiseRelations (KillBanditsRaiseRelations, v2.1.3.0)](javascript:;)
[+ Realistic Weather (RealisticWeather, v1.3.5.0)](javascript:;)
[+ MBFastDialogue (MBFastDialogue, v2.5.7.0)](javascript:;)
[+ Dismemberment (Plus) for v1.1.3 (DismembermentPlus, v2.0.6.4)](javascript:;)
[+ (RBM) Realistic Battle Mod (RBM, v3.5.8.0)](javascript:;)
[+ Open Source Armory (OpenSourceArmory, v1.15.0.0)](javascript:;)
[+ Open Source Armory: RBM Patch (OpenSourceArmoryRBM, v1.15.0.0)](javascript:;)
[+ Adonnay's Troop Changer (AdonnaysTroopChanger, v1.9.1.0)](javascript:;)
[+ Tier 7 Troop Unlocker Harmony (T7TroopUnlocker, v1.0.2.0)](javascript:;)
[+ Banner Editor (BannerEditor, v1.0.5.0)](javascript:;)
[+ Hot Butter (hotbutter, v2.0.4.0)](javascript:;)
[+ Random Events (RandomEvents, v1.1.4.0)](javascript:;)
[+ Aggregated Income (SortedIncome, v4.2.5.0)](javascript:;)
[+ Tournaments XPanded (TournamentsXPanded, v4.1.13.0)](javascript:;)
[+ UnlimitedCAP (UnlimitedCAP, v1.3.0.0)](javascript:;)
[+ UnlimitedWS (UnlimitedWS, v1.1.0.0)](javascript:;)
[+ Surrender Tweaks (SurrenderTweaks, v1.6.0.0)](javascript:;)
[+ Immersive Battlefields (ImmersiveBattlefields, v2.7.0.0)](javascript:;)
[+ Baby Growth Mod (BabyGrowthMod, v1.0.3.0)](javascript:;)
[+ You Keep What You Kill (YouKeepWhatYouKill, v1.0.18.0)](javascript:;)
[+ KnowEveryone (KnowEveryone, v1.0.3.0)](javascript:;)
[+ Women in Calradia (WomeninCalradia, v5.6.0.0)](javascript:;)
[+ CheyronMod (CheyronMod, v2.1.21.0)](javascript:;)
[+ Detailed Character Creation (zzCharacterCreation, v1.5.1.78)](javascript:;)
[+ My Little Warband (MyLittleWarband, v1.1.0.0)](javascript:;)
[+ No More Clones (NoMoreClones, v1.0.0.0)](javascript:;)
[+ SandBox Siblings (SandBoxSiblings, v1.0.0.0)](javascript:;)
[+ POC Color Randomizer mod (PocColor, v1.1.4.0)](javascript:;)
[+ Settlement Icons Redesign (SettlementIconRedesign, v1.1.0.0)](javascript:;)
[+ The Color of Profits (TheColorOfProfits, v1.0.0.0)](javascript:;)
[+ Workshops Completed (WorkshopsCompleted, v1.1.1.10)](javascript:;)
[+ Better Smithing Continued (BetterSmithingContinued, v1.1.0.8)](javascript:;)
[+ Primae Noctis (PrimaeNoctisBLord, v1.1.0.0)](javascript:;)
[+ WarlordsBattlefield (WarlordsBattlefield, e1.1.1.0)](javascript:;)
[+ Xorberax's Legacy for v1.1.3 (XorberaxLegacy, v1.0.5.4)](javascript:;)
[+ RTS Camera (RTSCamera, v4.1.23.0)](javascript:;)
[+ BannerKings (BannerKings, v1.2.7.4)](javascript:;)
Botolan commented 1 year ago

This happened to me as well. Did a bit of debugging with dnSpy and it seems a party object has some invalid fields, these will be the values in my case. Modified the code to remove the event from the queue and I finally managed to get past the exception. Maybe this will help developers image

Tageshan commented 1 year ago

Hi, I have an error just like this blocking my campaign (with the same version, and pretty much same mods). I'm ready to try using dnSpy to solve this, is it manageable without any coding experience ?

jointhecreed commented 1 year ago

There a bin file patch for Calradia Expanded on the Banner Kings discord server #test-version. You'll find the file on the Dec 8, 2022 post. Had to copy over the bin in the CE module. I could even load my old corrupted save after.