背景

  1. 做了 10 年的骑马与砍杀 2 终于发售了,买一个回来尝试一下
  2. 在家里玩游戏一般是通过 Remote Desktop 玩的,一方面是主机散热比较大而且太吵,单独放在一个地方,通过远程来玩。另一方面是远程的话不用正襟危坐,可以放在任何地方,方便一些
  3. 以前尝试过使用 Steam Link ,但效果上感觉除了操作 Steam 外不能操作其他,所以一直用的 Remote Desktop 适用性强,
  4. 最终「骑马与砍杀 2」+「Remote Desktop」出现了无法启动的情况,以下进行跟踪,解决

最终解决方案

  1. 按照作者提示的安装依赖文件
  2. 直接连接到主机上开启 steam(其他的或许可以,至少当前尝试过 Remote Desktop 不行)
  3. 使用 Steam Link 连接进行远程游戏

跟踪过程(TLDR)

这里实在是有点坑。从之前的故障以及报错的异常上来看,的确是没想到这个问题可能是使用 Remote Desktop 开启的原因。也正是这个原因多花了 2 个小时的游戏时间来排查该问题,但这个问题很特别,对类似问题的思考方式,在后续处理其他事情有帮助,在此记录

直接运行游戏(退出)

直接运行 TaleWorlds.MountAndBlade.Launcher.exe 进程启动了大概 5s 后自动退出。

尝试按照作者提供的依赖,安装依赖解决

Game Failing/Crashing at Launch

均安装后还是有问题

浏览论坛确认相似问题

从论坛中看到有些人尝试使用 Bannerlord.Native.exe 进行确认,尝试运行了一下(这里占用了比较多的时间,但其实无用。后续与 @Murat Türe 沟通,这个操作打印出错误的加载日志是正常的,因为主要是用来进行测试的)

确认 log 文件

日志目录

1
C:\ProgramData\Mount and Blade II Bannerlord\logs

日志记录

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Starting new log file...
05 Apr 2020 Sunday 15:49 ?D1ú±ê×?ê±??
Computer: DESKTOP-J8G94Q5 User: HenryHou
Build Version: 223799
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.

Could not load file or assembly 'TaleWorlds.MountAndBlade.ViewModelCollection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

  at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)

  at System.Reflection.Assembly.GetTypes () [0x00000] in <f9a20586108e4249b7275ba8971ca7ee>:0 

  at TaleWorlds.MountAndBlade.Module.CollectModuleAssemblyTypes (System.Reflection.Assembly moduleAssembly) [0x00006] in <6de2fb9dcbfd4e57b15d7d0cf628df00>:0 

  at TaleWorlds.MountAndBlade.Module.AddSubModule (System.Reflection.Assembly subModuleAssembly, System.String name) [0x00015] in <6de2fb9dcbfd4e57b15d7d0cf628df00>:0 

  at TaleWorlds.MountAndBlade.Module.LoadSubModules () [0x00198] in <6de2fb9dcbfd4e57b15d7d0cf628df00>:0 

  at TaleWorlds.MountAndBlade.Module.Initialize () [0x00033] in <6de2fb9dcbfd4e57b15d7d0cf628df00>:0 

  at ManagedCallbacks.CoreCallbacksGenerated.Module_Initialize (System.Int32 thisPointer) [0x00006] in <ceca20c21e0b49e9b627f2e1f6b47b3f>:0 

  at (wrapper native-to-managed) ManagedCallbacks.CoreCallbacksGenerated.Module_Initialize(int)

System.IO.FileNotFoundException: Could not load file or assembly 'TaleWorlds.MountAndBlade.ViewModelCollection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

File name: 'TaleWorlds.MountAndBlade.ViewModelCollection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

当时认为是由于子模块 ViewModelCollection 无法加载导致

确认子模块问题

确认子模块文件路径

1
2
3
4
5
6
7
8
9
[19:04:07.7961912] Loading submodules...

[19:04:08.5820575] opening ../../Modules/Native/ModuleData/banner_icons.xml

[19:04:08.5930250] loading banner_icons.xml:

[19:04:09.3894028] Loading GauntletUI Extra Custom Widgets

[19:04:09.3913972] Loading GauntletUI Bannerlord Custom Widgets

子模块定位文件位置

1
D:\Stream\steamapps\common\Mount & Blade II Bannerlord\Modules\SandBox

具体配置如下

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?xml version="1.0" encoding="utf-8"?>
<Module>
    <Name value = "Sandbox"/>
    <Id value = "Sandbox"/>
    <Version value = "e1.0.5"/>
    <DefaultModule value="true"/>
    <SingleplayerModule value="true"/>
  <Official value ="true" />
  <DependedModules>
        <DependedModule Id="Native"/>
        <DependedModule Id="SandBoxCore"/>
    </DependedModules>
    <SubModules>
        <SubModule>
            <Name value = "SandBox"/>
            <DLLName value = "SandBox.dll"/>
            <SubModuleClassType value = "SandBox.SandBoxSubModule"/>            
            <Tags>
                <Tag key="DedicatedServerType" value ="none" />
                <Tag key="IsNoRenderModeElement" value ="false" />
            </Tags>
        </SubModule>
        <SubModule>
            <Name value = "SandBox.View"/>
            <DLLName value = "SandBox.View.dll"/>
            <Assemblies>
                <Assembly value="SandBox.ViewModelCollection.dll"/>
            </Assemblies>
            <SubModuleClassType value = "SandBox.View.SandBoxViewSubModule"/>
            <Tags>
                <Tag key="DedicatedServerType" value ="none" />
                <Tag key="IsNoRenderModeElement" value ="false" />
            </Tags>
        </SubModule>        
        <SubModule>
            <Name value = "SandBox.GauntletUI"/>
            <DLLName value = "SandBox.GauntletUI.dll"/>
            <SubModuleClassType value = "SandBox.GauntletUI.SandBoxGauntletUISubModule"/>
            <Tags>
                <Tag key="DedicatedServerType" value ="none" />
                <Tag key="IsNoRenderModeElement" value ="false" />
            </Tags>
        </SubModule>
    </SubModules>

    <Xmls>
        <XmlNode>                
            <XmlName id="Items" path="spitems"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>  
        <XmlNode>                
            <XmlName id="SPCultures" path="spcultures"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>             
        <XmlNode>                
            <XmlName id="NPCCharacters" path="spnpccharacters"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>           
        <XmlNode>
            <XmlName id="partyTemplates" path="partyTemplates"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>  
        <XmlNode>               
            <XmlName id="NPCCharacters" path="lords"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="NPCCharacters" path="companions"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="NPCCharacters" path="bandits"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode> 
        <XmlNode>                
            <XmlName id="Heroes" path="heroes"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="NPCCharacters" path="caravans"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>                       
        <XmlNode>                
            <XmlName id="NPCCharacters" path="spspecialcharacters"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="Kingdoms" path="spkingdoms"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="Factions" path="spclans"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="WorkshopTypes" path="spworkshops"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="LocationComplexTemplates" path="location_complex_templates"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="Concepts" path="concept_strings"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>               
        <XmlNode>                
            <XmlName id="Settlements" path="settlements"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>
    </Xmls>
</Module>

具体 DLL 文件目录

1
D:\Stream\steamapps\common\Mount & Blade II Bannerlord\Modules\SandBox\bin\Win64_Shipping_Client

阶段结论(其实不正确)

认为虽然配置和 dll 库的文件正确,但是仍不能正常加载,决定在论坛里咨询(其实后来发现不正确,该 exe 文件只是检测能否运行的,不能加载子模块是正常的情况)

论坛中提问咨询

具体问题

In Progress Game wont start

首先说明了上面的猜想

与 @Murat Türe 沟通后,该猜想不正确,执行的 Bannerlord.Native.exe 只是用于测试。直接看 Launcher 的日志

Launcher 运行时的错误日志

1
2
3
4
5
6
7
8
[19:10:47.0860681] Checking if any managed object still lives... 

[19:10:47.0860681] There are no living managed objects. 

Managed Interface deleted.

Error: Non-Zero Device Reference Count! (ERC1406)
Closing log file...

在论坛下与 @Murat Türe 沟通后,怀疑是 Launcher 某些情况的 bug,采用了直接运行

1
2
3
4
5
# 到游戏目录
cd steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client

# 直接通过命令启动
Bannerlord.exe /singleplayer _MODULES_*Native*SandBoxCore*CustomBattle*Sandbox*StoryMode*_MODULES_ /anticheat

运行成功,并可以直接打开游戏,但是发现其中的按钮无法点击

http://img.henryhou.com/img/20200405200838.png

游戏可以正常启动,但是其中的按键无法点击。@Murat Türe 提示是否使用了远程桌面,尝试直接连接试试。

最终解决

直接连接后,点击正常,同时 Launcher 也是可以正常执行的。问题应该都出现在使用 Remote Desktop 才出现的。同时发现以下几点:

  1. 直接连接到机器上使用 Launcher 运行游戏是正常的
  2. 如果使用 Remote Desktop,再运行 Launcher
  3. Steam Link 链接到远程运行游戏是正常的
  4. 但是使用 Remote Desktop,通过 CMD 启动有些,游戏展示是正常的,点击是异常的。从点击的情况看起来,应该是展示的区域和点击的区域不等大。点击的区域的像素位置应该都向右下偏移

http://img.henryhou.com/img/20200405220545.png

http://img.henryhou.com/img/20200405220613.png