NoneGiven/MphRead

Room renderer not working properly when launching MphRead with command line arguments

Closed this issue · 2 comments

Hi, I am on Windows 11 and I downloaded the 0.23.1.0 win version of MphRead.
I drag-and-dropped the AMHE1 version of Metroid Prime Hunters into the program to extract the game files.

When I run the program without command line arguments, it works as intended.
When I run the program with the -room argument, things are different.

One thing I noticed is that no matter what value I pass to the -players argument, no players will spawn.
Another thing I noticed is that if I pass the room id of a landing site (45, for example) to the -room argument, the program will open the renderer showing the room, then close it and crash with this error:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at MphRead.Entities.PlayerEntity.ShowDialogOverlay(Int32 messageId, Int32 duration, Boolean warning) in D:\mph_build\MphRead\Entities\Players\PlayerDialog.cs:line 206
   at MphRead.Entities.PlayerEntity.ShowDialog(DialogType type, Int32 messageId, Int32 param1, Int32 param2, String value1, String value2) in D:\mph_build\MphRead\Entities\Players\PlayerDialog.cs:line 100
   at MphRead.GameState.UpdateFrame(Scene scene) in D:\mph_build\MphRead\GameState.cs:line 736
   at MphRead.Scene.UpdateScene() in D:\mph_build\MphRead\Renderer.cs:line 2619
   at MphRead.Scene.OnUpdateFrame() in D:\mph_build\MphRead\Renderer.cs:line 1144
   at MphRead.RenderWindow.OnRenderFrame(FrameEventArgs args) in D:\mph_build\MphRead\Renderer.cs:line 4741
   at OpenTK.Windowing.Desktop.GameWindow.Run()
   at MphRead.Program.Main(String[] args) in D:\mph_build\MphRead\Program.cs:line 106

The -players argument isn't meant for spawning players, it's just to control which version of a room is loaded. For example, MPH loads multiplayer rooms with simplified geometry when there are more than two players in the match. Like most of the command line arguments, this is kind of a holdover from when MphRead was conceptualized as just a model viewer. I added a note to the wiki for this.

As for the crash, I already know about that and have a fix. I can push that later today.

The crash is fixed in 0.23.2.0.