Fellow93 / RealisticBattleProject

Source files of Realistic Battle mod for Mount and Blade 2 Bannerlord
27 stars 14 forks source link

RBM does not work when the game is launched under Proton #4

Closed sklochkov closed 1 year ago

sklochkov commented 1 year ago

Proton is a tool that is used by Steam to launch Windows applications and games under Linux. I understand that this platform is not supported, but maybe you could take a look at the issue below if there is a quick way to fix it?

The game (version 1.1.0) runs good when no mods are enabled, with no errors or significant performance issues.

When loading the game with RBM 3.5.6.0 enabled, it works as intended and applies modifications to all in-game items. The problem happens once a battle is started. Encounters with bandits in town work properly; the issue happens only when an opposing party is engaged.

Once the 'Attack!' button has been clicked, the loading screen remains stuck forever; the following error appears in the steam log:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at TaleWorlds.MountAndBlade.MovementOrder.Tick (TaleWorlds.MountAndBlade.Formation formation) [0x00018] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.Formation.Tick (System.Single dt) [0x00095] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at (wrapper dynamic-method) TaleWorlds.MountAndBlade.Team.TaleWorlds.MountAndBlade.Team.Tick_Patch1(TaleWorlds.MountAndBlade.Team,single)
  at TaleWorlds.MountAndBlade.DeploymentMissionController.DeployFormationsOfTeam (TaleWorlds.MountAndBlade.Team team) [0x00080] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.DeploymentMissionController.OnSideDeploymentFinished (TaleWorlds.Core.BattleSideEnum side) [0x0003c] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.DeploymentMissionController.SetupTeams () [0x00037] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.DeploymentMissionController.OnMissionTick (System.Single dt) [0x0004f] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.Mission.OnTick (System.Single dt, System.Single realDt, System.Boolean updateCamera, System.Boolean doAsyncAITick) [0x000f7] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.MissionState.TickMissionAux (System.Single dt, System.Single realDt, System.Boolean updateCamera, System.Boolean asyncAITick) [0x0001b] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.MissionState.TickMission (System.Single realDt) [0x001dc] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.MissionState.OnTick (System.Single realDt) [0x00110] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.Core.GameStateManager.OnTick (System.Single dt) [0x00029] in <45cbcee3b3174b01b9c17ef41164ba00>:0 
  at TaleWorlds.Core.Game.OnTick (System.Single dt) [0x00013] in <45cbcee3b3174b01b9c17ef41164ba00>:0 
  at TaleWorlds.Core.GameManagerBase.OnTick (System.Single dt) [0x00046] in <45cbcee3b3174b01b9c17ef41164ba00>:0 
  at TaleWorlds.MountAndBlade.Module.OnApplicationTick (System.Single dt) [0x001d7] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.CoreManaged.TaleWorlds.DotNet.IManagedComponent.OnApplicationTick (System.Single dt) [0x00005] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.DotNet.Managed.ApplicationTick (System.Single dt) [0x0002d] in <28f8a6a19f574261a7e80639674296b1>:0 
  at ManagedCallbacks.LibraryCallbacksGenerated.Managed_ApplicationTick (System.Single dt) [0x00000] in <26f556e663ac433aa7f441bd685758c1>:0 
  at (wrapper native-to-managed) ManagedCallbacks.LibraryCallbacksGenerated.Managed_ApplicationTick(single)
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at TaleWorlds.MountAndBlade.MovementOrder.Tick (TaleWorlds.MountAndBlade.Formation formation) [0x00018] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.Formation.Tick (System.Single dt) [0x00095] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at (wrapper dynamic-method) TaleWorlds.MountAndBlade.Team.TaleWorlds.MountAndBlade.Team.Tick_Patch1(TaleWorlds.MountAndBlade.Team,single)
  at TaleWorlds.MountAndBlade.DeploymentMissionController.DeployFormationsOfTeam (TaleWorlds.MountAndBlade.Team team) [0x00080] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.DeploymentMissionController.OnSideDeploymentFinished (TaleWorlds.Core.BattleSideEnum side) [0x0003c] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.DeploymentMissionController.SetupTeams () [0x00037] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.DeploymentMissionController.OnMissionTick (System.Single dt) [0x0004f] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.Mission.OnTick (System.Single dt, System.Single realDt, System.Boolean updateCamera, System.Boolean doAsyncAITick) [0x000f7] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.MissionState.TickMissionAux (System.Single dt, System.Single realDt, System.Boolean updateCamera, System.Boolean asyncAITick) [0x0001b] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.MissionState.TickMission (System.Single realDt) [0x001dc] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.MissionState.OnTick (System.Single realDt) [0x00110] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.Core.GameStateManager.OnTick (System.Single dt) [0x00029] in <45cbcee3b3174b01b9c17ef41164ba00>:0 
  at TaleWorlds.Core.Game.OnTick (System.Single dt) [0x00013] in <45cbcee3b3174b01b9c17ef41164ba00>:0 
  at TaleWorlds.Core.GameManagerBase.OnTick (System.Single dt) [0x00046] in <45cbcee3b3174b01b9c17ef41164ba00>:0 
  at TaleWorlds.MountAndBlade.Module.OnApplicationTick (System.Single dt) [0x001d7] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.MountAndBlade.CoreManaged.TaleWorlds.DotNet.IManagedComponent.OnApplicationTick (System.Single dt) [0x00005] in <44ee31a414694234adc3c0a52096b7f2>:0 
  at TaleWorlds.DotNet.Managed.ApplicationTick (System.Single dt) [0x0002d] in <28f8a6a19f574261a7e80639674296b1>:0 
  at ManagedCallbacks.LibraryCallbacksGenerated.Managed_ApplicationTick (System.Single dt) [0x00000] in <26f556e663ac433aa7f441bd685758c1>:0

This error looks quite generic, but I could not find anything more specific in the logs; checking with strace showed that there are no conspicuous failures in the system calls (like trying to open a missing file) when the error happens.

sklochkov commented 1 year ago

I found how to fix this issue. You need to do the following.

  1. Install protontricks.
  2. Select Proton version as 4.11-13 in the Steam compatibility menu.
  3. Delete the wineprefix (steamapps/compatdata/261550). Note: your saved games will be synced back from steam cloud, assuming you've enabled it; otherwise, you'll need to backup the steamapps/compatdata/261550/pfx/drive_c/users/steamuser/My Documents BACKUP/Mount and Blade II Bannerlord/Game Saves directory and restore its contents once this operation is done.
  4. Make steam generate the wineprefix from scratch by asking it to launch the game, but do not go beyond the launcher.
  5. Run protontricks 261550 -q --force dotnet472. It will take a while.
  6. Select your preferred proton version in the Steam compatibility settings and enjoy the game with working mods!