Fexty12573 / SharpPluginLoader

A C# plugin loader for Monster Hunter World
MIT License
32 stars 2 forks source link

Crashes when using AutoSteamApp with winmm.dll loaded #39

Closed Praedyth-Rey closed 3 months ago

Praedyth-Rey commented 4 months ago

I'm not 100% sure why it does, but I maintain a version of AutoSteamApp (Github) to keep it working with updates and nothing else, and how the 100% accuracy mode works and really the app as a whole is something I do not understand fully yet.

The best guess given has been due to it reading memory to get the correct sequence, and that causes problems with SharpPluginLoader and thusly causes the game to crash.

It was said as well the Cutscene Skip part of it does not work, but I don't have much info on that one yet, I will update this if/when I get that information and I don't wish for dev time to be used figuring this out when I don't know if it is because of this mod, or another mod.

Anyasol2251 commented 4 months ago

Seconding the Cutscene Skip issue, it does seem to be from SPL as far as I can tell. Causes a crash anytime a cutscene is skipped, even when not loading any of my SPL plugins. Crashes stop after removing winmm.dll from the game directory (but obviously that's not a solution).

Fexty12573 commented 4 months ago

Hmmm, I don't see anything in particular that should cause a crash. As for the cutscene skip, I have no idea since that isn't open source so I can't look at it easily.

If either of you could use the attached plugin (regular Stracker plugin, not SPL) and trigger such a crash that would be helpful. After the crash there should be a crash-dump.txt in your plugins directory, if you could upload that here it would make things a lot easier for me.

To install just put both files inside the zip archive into nativePC\plugins. mhw-crash-handler.zip

Anyasol2251 commented 4 months ago

Tried that out, but it isn't generating any crash-dump.txt on these crashes.

Repeatedly tried creating a new character and skipping the opening cutscene and found that the crashes are inconsistent, once in a while it won't crash but usually it does. Also found that the crashing doesn't seem to happen at all when playing fullscreen at 1080p (my monitor's native resolution). So for me this behavior is only when playing windowed/borderless and/or at any lower resolution.

All I had while testing was Stracker's + Perfomance Booster, SPL, and Cutscene Skip, so if this isn't just a personal hardware issue of mine it should be easy to recreate.

Fexty12573 commented 3 months ago

@Praedyth-Rey The issue lies in whatever library you're using for sending input events. It's sending invalid events on occasion which results in ImGui not being able to process them properly.

I implemented a (very hacky) fix in aedca7c02062fd40e049d4d045fcbdcaad8df458 which just disables the ImGui overlays entirely while Steamworks is active (will be part of next release). However, this is really something you should be fixing on your end, not mine.

Fexty12573 commented 3 months ago

Tried that out, but it isn't generating any crash-dump.txt on these crashes.

Repeatedly tried creating a new character and skipping the opening cutscene and found that the crashes are inconsistent, once in a while it won't crash but usually it does. Also found that the crashing doesn't seem to happen at all when playing fullscreen at 1080p (my monitor's native resolution). So for me this behavior is only when playing windowed/borderless and/or at any lower resolution.

All I had while testing was Stracker's + Perfomance Booster, SPL, and Cutscene Skip, so if this isn't just a personal hardware issue of mine it should be easy to recreate.

Is there any cutscenes in the game I can repeatedly trigger without having to create a new character? Otherwise I really don't feel like testing this.

Anyasol2251 commented 3 months ago

Is there any cutscenes in the game I can repeatedly trigger without having to create a new character? Otherwise I really don't feel like testing this.

Good point. Looks like all the repeatable cutscenes are already skippable without the cutscene skip plugin so they don't cause any crashes, even the gallery in the main menu. I guess it's not too big of a deal if it works consistently at fullscreen/native res, I'll just give people a disclaimer saying to try that if they have issues. Thanks anyways.

Praedyth-Rey commented 3 months ago

@Praedyth-Rey The issue lies in whatever library you're using for sending input events. It's sending invalid events on occasion which results in ImGui not being able to process them properly.

I implemented a (very hacky) fix in aedca7c which just disables the ImGui overlays entirely while Steamworks is active (will be part of next release). However, this is really something you should be fixing on your end, not mine.

I only maintain AutoSteamApp for updates, as the original dev has seemingly abandoned it and it's trivial to keep it working with the latest versions. I do however have plans to remake it as a SPL plugin as it's made in C# by itself, so I will keep it in mind to change what library it uses to send inputs.

One thing I've noticed is on my setup the game doesn't crash when using SPL and AutoSteamApp, which is very odd.

Fexty12573 commented 3 months ago

I have had better luck reproducing the crash if x10 mode is enabled in the steamworks. And sometimes I had to leave it running for quite a while until something happened.