shupershuff / Diablo2RLoader

Diablo 2: Resurrected launcher for multi-boxing
MIT License
59 stars 11 forks source link

One of the game windows close after switching back and forth between window #33

Closed mbb3-mitch closed 7 months ago

mbb3-mitch commented 8 months ago

I followed setup procedure as follows:

  1. Before trying this script I followed the simple process explorer routine, without success.
  2. While trying to debug the issue:

The script continues to run and I can reopen the closed account. The error doesn't usually occur on the first switching of windows, it's usually when I try to bring the characters to the same place or interact. I didn't find any log files or uncaught exceptions.

Basically, I just want to give my HC sorc some BO. :P

Let me know if I can provide you with anymore details.

image

shupershuff commented 8 months ago

Firstly and most importantly, you mentioned you run the script from Visual Studio instead of PowerShell. Have you tried launching it from the desktop icon instead?

If that doesn't fix it, a few more questions:

  1. Does the script show any error message when this happens?
  2. When you say primary account closes, does the Window itself fully close (leaving only one instance running) OR do both instances stay open with one instance reverting to the single player screen?
  3. Have you placed handle.exe in the appropriate directory?
  4. Are you using any mods?
mbb3-mitch commented 8 months ago

@shupershuff Hi thanks for the quick response. This is a wonderful project btw.

I open the project with admin access using VS code and execute the script within a powershell terminal. The reason I open it with visual studio code is to be able to see and edit all the file.

  1. No error messages appear within the script or window powershell window.
  2. The D2 window that I switch away from closes when I switch to another window. Example, I open both instances at the same time. Select my Sorc on my primary account and create a game. Select my Barb and join the same game. Then go to wp. When I switch to my sorc again, the barb at the leaves the game and window closes. I have to press "a" to reopen D2 and connect again. It doesn't go to single player screen.
  3. handle64.exe is located in the handle directory. I didn't copy handle.exe. Should I copy the 3 that come when downloading handle?
  4. I am not using any mods.

I hope this clarifies everything. Let me know if you need any more details.

shupershuff commented 8 months ago
  1. Before trying this script I followed the simple process explorer routine, without success.

You mention you didn't get much success with old method. Did you experience the same behaviour here with one instance randomly shutting down?

It's certainly and odd issue but it's possible there isn't enough RAM and/or VRAM to run an additional instance and the extra instance is crashing. Can you please list your PC specs?

Something else to try too, try launching the games in windowed mode instead of full screen and switching between them to see if one still crashes.

mbb3-mitch commented 8 months ago

I did try the old method with process explorer and it did not work. Same behaviour I currently am experiencing.

I use full screen mode.

Here are my specs:

Processor 11th Gen Intel(R) Core(TM) i7-11700F @ 2.50GHz 2.50 GHz Installed RAM 16.0 GB (15.7 GB usable) System type 64-bit operating system, x64-based processor GPU NVIDIA GeForce RTX 3070 8GB OS Windows 11

image

I tried optimizing all my settings for performance. Making windows 1080p, ultra performance, low graphics settings.

I managed to BO and teleport, but then switching back to barb, it closed my other window.

mbb3-mitch commented 8 months ago

@shupershuff image

I commented out the lines that clear the host to keep track of the handles being killed. So I know that the script that handled killing check instances works.

shupershuff commented 8 months ago

What is your RAM utilisation with one instance running?

shupershuff commented 8 months ago

Have you had much luck with this since? It kind of seems like you're maxing out on memory usage and it's causing an instance to crash. What other apps are running that can be closed? Have you tried just running in PowerShell instead of Visual Studio (it might reduce some RAM usage).

Also have you set a frame rate cap within the games video settings? on that note, did you try changing the settings to that the game is in full screen (windowed) instead of full screen?

Some other thoughts, check that your GPU drivers are up to date and perhaps check if there is anything in Event Viewer that would suggest the cause of the crash.

mbb3-mitch commented 7 months ago

Hey @shupershuff Sorry for the delayed response. I think you might be right. I have not had any success getting my ram seems to alway be capped when I am playing with both windows. I have mostly given up at this point. I would think that 16gb would be more than enough ram, but it always appears to be at around 16gb of usage.

I had some success make even smaller windows and capping the frames at 30fps, I can manage to go for about a minute before it crashes. With this window size, it's unplayable. I have a 49 in ultra wide, not sure if the massive monitor is what causes such high ram usage.

Drivers, OS, and bios are all up to date.

shupershuff commented 7 months ago

I think RAM is possibly your issue, if you can close any memory hogging apps prior to running you might have better luck. I recently just upgraded from 32GB to 64GB as with 3 instances I would start maxing out. I could run 4 instances on 32GB but had similar issues where after a while a client would stutter or just crash. 16GB isn't much by today's standards so perhaps it's time for an upgrade :)

I don't believe larger resolution would impact RAM usage, but it will impact on VRAM (which can also cause crashes when it's maxed out).

mbb3-mitch commented 7 months ago

@shupershuff Just received some new ram. With 2 instances, it uses > 25gb of ram consistently.