sandboxie-plus / Sandboxie

Sandboxie Plus & Classic
https://Sandboxie-Plus.com
GNU General Public License v3.0
13.49k stars 1.51k forks source link

Escape from Tarkov mouse locked to middle issue #1410

Open nkm235 opened 2 years ago

nkm235 commented 2 years ago

Describe the bug

  1. Mouse locks to middle of screen in Escape from Tarkov (Unity game) whenever certain GUI is used (i.e. in-game inventory or some main menu sub-menu's) the cursor is locked in the middle and can't be moved (can move a bit but gets reset back to middle instantly).
  2. Game fails to utilize full screen exclusive and switches to another option.

To Reproduce

  1. Install and run Escape from Tarkov in Sandboxie-plus (edit: due to anti-cheat and how it would behave sandboxed, i recommend the sp mod which has all the functionality of online)
  2. Install Offline single player mod in Sandboxie-plus https://www.sp-tarkov.com/
  3. Launch the game / or launch using included by the mod: Server.exe (keep running in background) then Launcher.exe
  4. Results in failed fullscreen exclusive on launch and switches over to another option
  5. 3d works but mouse is locked in some GUI's (can be unlocked by alt+tab to another window and back every time it's locked)

Screenshots Attempting to move mouse in a tab of the main menu (same behavior as in-game menu's) tarkovmouse

Expected behavior Mouse behaving correctly and moving freely in GUI's. Full screen exclusive mode to function properly

System details and installed software

If you have a compatibility issue

Additional context The offline single player mod has no effect on the issue itself but wanted to mention it since it's in use and because of the anti-cheat being sandboxed that might cause issues. The game launches perfectly with the mod, all menu's appear normally, loads into gameplay normally with the exception of 2 things.

  1. Mouse locked to the middle of the screen in GUI's
  2. Game fails to use full screen exclusive (played other games which had no issue using full screen exclusive)
    Failed to change display to ExclusiveFullscreen...reverting to FullscreenWindow

Sandboxie configuration

My initial sandboxie.ini settings ```` [GlobalSettings] FileRootPath=D:\\%SANDBOX% the rest is default. ````
DavidXanatos commented 2 years ago

might be fixed in the next build with the mouse clip fix, please test 1.0.1 as soon as its out

nkm235 commented 2 years ago

v1.0.1 , same results as v0.9.5

gif 1 (main menu subsection), The part at the end is alt+tab 3B97ErrTlK gif 2 (in-game), only gui is the issue, aiming is fine cRJSVVWxlU

Edit:im not sure if this is useful but the mouse issue in the main menu subsection (hideout) might be because the menu transitions from 2d into a 3d scene and upon loading messes up the mouse which might be the same reason as in-game.

the fullscreen exclusive issue is no longer reported in the log file. so that seems fixed. (which now that im looking at it was probably caused by a .dll load error that seems to have been fixed since v0.9.5)

cem commented 2 years ago

Can you try adding OpenWinClass=* to your sandbox config? This fixes the same issue for other Unity games and it might work for Tarkov.

MuddyBleach commented 1 year ago

I suppose this topic must have been renamed to a more global title like “Unity games mouse locked to the middle issue” for better progress because it seems currently to be a common issue for all Unity-based games that the mouse pointer gets stuck in a small several pixels area when switching to menus. That might have been introduced with some Windows or Sandboxie updates (or both) since I do not remember having experienced such type of trouble back in the time of Windows 8.

Now I did a little tinkering with the workaround described above. It is functionable indeed but I wonder if anyone could suggest what executables and/or window classes exactly we have to give access (to) instead of disabling this part of Sandboxie protection completely. I tested both for the specific game executable and UnityWndClass for “all programs” but no luck. Only OpenWinClass= does the trick.

P.S.

I also tried some third party applications. The main downside of them is that the most of them are meant oppositely for locking and not for unlocking the mouse cursor in a window.

There is the SpecialK framework (“Unrestrict cursor” option needs to be enabled), still that piece of software might be too resource-expensive when being used just for the purpose of unconfining the mouse pointer.

Another one is Lock cursor tools (can be installed in the same sandbox). But it requires certain weird manual steps every time when a game is launched. The game window shall be selected/executable located in the application settings bar but the selection shall not be confirmed to produce the effect sought (i.e. OK shall not be pressed and this way Lock cursor tools settings shall be left open while playing). Therefore, not the optimal solution as well.

Taeyeonzpx commented 5 months ago

Can you try adding OpenWinClass=* to your sandbox config? This fixes the same issue for other Unity games and it might work for Tarkov.

I tried setting OpenWinClass=* which means not to change the window class name created by the program within the sandbox, and then launched the game; however, the issue of the mouse being locked to the center of the screen persists, with no difference from the previous illustration.