Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guild wars 2 cursor remains on screen and blocks turning camera #66

Closed
Mel34 opened this issue May 4, 2019 · 68 comments
Closed

Guild wars 2 cursor remains on screen and blocks turning camera #66

Mel34 opened this issue May 4, 2019 · 68 comments

Comments

@Mel34
Copy link

Mel34 commented May 4, 2019

Guild wars 2 uses right click to start turning the camera. Typically cursor disappears and you are free to rotate the camera as many degrees as you want. If d9vk is used, cursor remains on screen and rotation is limited by cursor hitting the screen left or right edges. Game also has action camera mode in which cursor also disappears, again not the case when d9vk is used. Cursor remains on screen and limits the turning by bumping into screen edge and staying there. Is this the relative cursor/absolute cursor issue? I didn't provide any logs because this isn't a crash. I'll be happy to provide them for you should you need them.

Sometimes the bug only manifests when a map change happens (works on the initial map, breaks when you change zones)

Software information

Running Guild Wars 2 64 bit on Archlinux

System information

  • GPU: AMD Rx580
  • Driver: vulkan-radeon 19.0.3-1
  • Wine version: 4.7-1 or 3.18-esync-pba or 4.6-tkg
  • DXVK version: git master 6f9a3e6
@Joshua-Ashton
Copy link
Owner

Log would be helpful here

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

logs
Gw2-64_dxgi.log and Gw2-64_d3d11.log are empty

@yaomtc
Copy link

yaomtc commented May 4, 2019

I had this issue with Wine if I had "emulate a virtual desktop" enabled in winecfg. Do you have this option enabled? If so, try enabling "Automatically capture mouse in full-screen windows".

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

@yaomtc I don't have virtual desktop enabled. Enabling Automatically capture mouse didn't help either.

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

btw @Joshua-Ashton 6f9a3e6 causes text corruption in GW2. Check it out here.
a63208b seems fine.

@Joshua-Ashton
Copy link
Owner

btw @Joshua-Ashton 6f9a3e6 causes text corruption in GW2. Check it out here.
a63208b seems fine.

Can you see if 1626606 corrects that issue?

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

Sure, just waiting for froggi.es to build it.

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

No luck. Result

@logan001
Copy link

logan001 commented May 4, 2019

for me on 0c3c570 it happens like this
on 1st character that i start to play the mouse behave as it should - disapear when drag with left or right click
if i select another character the mouse will stay on when drag it around. but i have no issue with being unable to rotate the camera. even if the mouse hits the edge of the screen, i'll still be able to rotate th camera. only "glitch" is that after releasing the button (stop rotate) the mouse will move back to initial position where it was before rotating camera.
text looks good on that window for me

@Joshua-Ashton
Copy link
Owner

No luck. Result

I mean, it doesnt look like garbage anymore -- that's a start. Lemme take another look into it

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

@logan001 mouse moving back shouldn't be a glitch, glitch is mouse cursor not disappearing in the first place. Have you tried loading another map? This manifests for me when I change map (e.g. go into fractals lobby)

@logan001
Copy link

logan001 commented May 4, 2019

yes, after changing maps the mouse does not disappear anymore. except on one occasion when the mouse had no issue
but i can still rotate camera without any other problems.

@Joshua-Ashton
Copy link
Owner

@logan001 mouse moving back shouldn't be a glitch, glitch is mouse cursor not disappearing in the first place. Have you tried loading another map? This manifests for me when I change map (e.g. go into fractals lobby)

Can you see if this dll rectifies the issue?
d3d9.zip

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

d3d9.zip

Sadly, no. I tried it and mouse stays on screen.

@Joshua-Ashton
Copy link
Owner

its not meant to be for the mouse, its meant to be for the text

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

Just tried it with 1626606 + that dll replacement. It works! See here

@logan001
Copy link

logan001 commented May 4, 2019

@Joshua-Ashton it doens't fix it.
the mouse still stays on the screen after changing maps.

@Joshua-Ashton
Copy link
Owner

its not meant to be for the mouse, its meant to be for the text

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

I should've filed another bug report for the text 😆

@logan001
Copy link

logan001 commented May 4, 2019

also 1626606 does not fix the text issue.
the behavior is random.
on some tries the 1st panel had right side with no text plus the text below was missing (even on buttons)
on 2nd try the text as rendered as vertical lines.
on 3rd try was like this
gw001

if you reopen that window the text seems to be ok
also i think there is a need to delete the cache file. i had some strange artifacts on first run that disapear after i've deleted the cache

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

Yeah it doesn't fix it on it's own, you're supposed to combine it with the d3d9.zip posted in #66 (comment)

@logan001
Copy link

logan001 commented May 4, 2019

@Joshua-Ashton yes text seems to be ok

@Mel34
Copy link
Author

Mel34 commented May 4, 2019

a026a42 fixes text issue.

@marcelomendes
Copy link

marcelomendes commented May 5, 2019

for me on 0c3c570 it happens like this
on 1st character that i start to play the mouse behave as it should - disapear when drag with left or right click
if i select another character the mouse will stay on when drag it around. but i have no issue with being unable to rotate the camera. even if the mouse hits the edge of the screen, i'll still be able to rotate th camera. only "glitch" is that after releasing the button (stop rotate) the mouse will move back to initial position where it was before rotating camera.
text looks good on that window for me

I can confirm this exact same behavior, first character works as it should, but if you change it the mouse cursor won't go away.

Edit: It seems that the issue is related to the map/zone change, not necessarily character change. So, if you change zone/map, the mouse issue begins.

@jrugia
Copy link

jrugia commented May 5, 2019

Rotating the camera for me doesn't block at the screen's edge for me either. the cursor issue is present as everyone else.

@Mel34
Copy link
Author

Mel34 commented May 7, 2019

@garpu have you tried changing maps?

@garpu
Copy link

garpu commented May 7, 2019

I take that back. It was fine when I loaded a map, then when I zoned elsewhere, it's back. :/

@TheDaftRick
Copy link

TheDaftRick commented May 8, 2019

Issue:
Mouse cursor remains on screen when it should be hidden.
Normally holding left or right click or going into Action Camera will hide the mouse cursor when rotating the camera.

Issue only happens after a loading screen after initially loading in the game.

Issue does not happen if you have the mouse cursor hidden when initializing the loading screen (ex: If you have action camera enabled which hides the mouse cursor or if you hold down the left or right click and you walk through a portal)

Attempted fixes:

  • Windowed mode
  • Full screen windowed
  • Full screen
  • All settings to highest
  • All settings to lowest

System:

  • Ubuntu 19.04 (Gnome 3.32.1)
  • Intel i5-4460
  • Nvidia GT-1030 (driver 430.09)
  • Wine tkg-4.6-x86_64
  • d9vk 0.10

GW2-64_d3d9.log

Edit: This does not limit the camera rotation for me

@Mel34
Copy link
Author

Mel34 commented May 10, 2019

Issue does not happen if you have the mouse cursor hidden when initializing the loading screen

Good catch. If the bug triggers even once then this trick doesn't help anymore.

@Mel34
Copy link
Author

Mel34 commented May 12, 2019

Update: camera turning blocking in my case is caused by sway (the wayland window manager). It constrains the cursor to a screen with the game. Running the game under kwin leads to cursor remaining on screen during camera turning, allowing more than one rotation around the character axis and it does warp back to where it was when the drag option was initiated.

@Mel34
Copy link
Author

Mel34 commented May 16, 2019

I'm tracking @Joshua-Ashton's commits every day and testing every build. He's making huge progress and hopefully his work enables d9vk on more games. A cursor glitch in one game isn't really a priority when there are so many reports about games not working or crashing.
That being said, that cursor glitch is the only thing that's missing from 100% perfect experience of playing GW2 under d9vk. Let's hope he finds some time to look into the cursor code soon.

@DxCx
Copy link

DxCx commented May 16, 2019

well, i have alot of technical knowledge/experience, not in 3d or gaming, but in programing in general. (both low level (c/asm (not only x86)) and high level)
if i get some hints on stuff worth checking / debugging i would really like to help.
especially since this is the ONLY game i play hehe

@Mel34
Copy link
Author

Mel34 commented May 16, 2019

Just tried KDE 5.15.90 (5.16 beta) wayland session. Mouse blocking issue is present with kwin_wayland as compositor as well.

@DxCx
Copy link

DxCx commented May 17, 2019

Ok since i really want to make GW2 works good with d9vk i started to read abit around and get into how d9 and graphic works. (still very young tough XD).

anyway, as first step i've dumped an API trace file that should reproduce the problem:

  1. Log-in into charcter
  2. Change map
  3. Rotate camera

Next using WINEPREFIX=~/lutris_Games/guild-wars-2/ wine ./apitrace/bin/apitrace.exe replay gw2.trace
i am able to see the trace i've created.
Next i assume i'll need to replay it using d9vk dlls just not sure how to do that just yet..

Edit:
I've uploaded the trace into my drive (zip - 400MB) - https://drive.google.com/open?id=1crCsO5IKPhBruZPxeUSq7G72DLEApTvU

@Mel34
Copy link
Author

Mel34 commented May 17, 2019

@DxCx When opening an issue here, this is printed out in the template:

Important: When reporting an issue with a specific game or application, such as crashes or rendering issues, please include log files and a D3D11 Apitrace (see https://github.com/apitrace/apitrace) so that the issue can be reproduced. In order to create a trace, run wine apitrace.exe trace -a dxgi YOURGAME.exe. DO NOT use DXVK together with apitrace!

@DxCx
Copy link

DxCx commented May 17, 2019

Exactly what i did, this is raw apitrace with no DXVK
I had to call it a day, so ill continue only tommorow
But i thought about it and i think that next i should be able to replay with DXVK loaded and attach a debugger

@jrugia
Copy link

jrugia commented May 17, 2019

From my experience with D9VK so far, this isn't just a GW2 issue, I've encountered the issue with a few other games too, and some issue reports mention it too. Fixing this will probably fix other games too.

@Mel34
Copy link
Author

Mel34 commented May 17, 2019

@jrugia can you list those other games?

@DxCx
Copy link

DxCx commented May 17, 2019

If @Joshua-Ashton or anyone else who is more familiar with d9vk can throw me some hints i would be glad to help fix it out.

@AlexeyProkhin
Copy link

@DxCx try to apply this patch to wine. Basically, there is a check in wine to rate limit applying fullscreen mouse clipping. This patch partially removes the check.
You could also try to modify d9vk/dxvk to call ChangeDisplaySettingsExW() less. WineD3D checks if the resolution is actually changed before calling the function. See this line for inspiration.

@DxCx
Copy link

DxCx commented May 18, 2019

Awsome! Thanks for the tips @AlexeyProkhin :)
Will try it soon and update back what ive learned

@DxCx
Copy link

DxCx commented May 18, 2019

I dont have a windows system myself so i cant confirm it,
Is this bug happens on windows too?

I mean, wine rate limit makes sense to blame, but if it is the culprit then the bug shouldnt happen on windows

@logan001
Copy link

@logan001 which window manager/compositor are you using?

sorry for late response. just for info i've tried both Cinnamon and KDE and both allow me to rotate the camera even thought the mouse will stay at the edge of the screen.

@logan001
Copy link

I dont have a windows system myself so i cant confirm it,
Is this bug happens on windows too?

I mean, wine rate limit makes sense to blame, but if it is the culprit then the bug shouldnt happen on windows

this "bug" does not happen in windows.

i think this bug use to be present a long time ago in wine (before x64 version of GW). but i'm not sure if its the same bug as we have now.
Here is something related to cursor problem on winehq
maybe its the same issue. maybe not. i have no clue. but maybe someone can figure it out.

@jrugia
Copy link

jrugia commented May 18, 2019

@jrugia can you list those other games?

Aside from GW2 there are:

Crysis
GTA IV
Colin McRae Dirt

@DxCx
Copy link

DxCx commented May 19, 2019

Ok so thanks @AlexeyProkhin.

I've never compiled wine before so it took me abit to get it working, but i was able to clone and compile wine-tkg 4.6 (and make sure game works the same before the patch)

after that, i've ported the patch and placed it with .mypatch extention under wine-tkg-userpatches folder.
patch file can be found here: wine4.6-winex11-ignore-clip_reset-when-trying-to-clip-the-mo.txt (Don't forget to rename to .mypatch extention if you try to reproduce)

However, after applying the patch the problem still exists.
i'll try to think how to tackle this better, but having the ability to compile and run my own wine is already a step forward i believe =)

@AlexeyProkhin
Copy link

@DxCx Sorry to hear the patch did not help. You could also try to apply another proton patch as well.

@DxCx
Copy link

DxCx commented May 19, 2019

@AlexeyProkhin ive added this patch as well, nope, still doesnt work..
Do you maybe know any wine debug prints worth enabling for understanding this better?

@AlexeyProkhin
Copy link

@DxCx cursor and x11drv probably. But it does not seem to be an issue I had in mind. So maybe it is in totally different place. I don't know the wine (and d9vk) codebase well enough to make another guess.

@logan001
Copy link

@AlexeyProkhin do you have amd card?

@AlexeyProkhin
Copy link

@logan001 , no. Why do you ask?

@logan001
Copy link

i was curios if it that fix it for you then maybe its a problem of drivers.

@Mel34
Copy link
Author

Mel34 commented May 19, 2019

Just FYI: Playing the new map without d9vk caused OOM killer to kill gw2 twice tonight, it's leaking memory it seems (filled my 16gb and I have no swap). Under d9vk it doesn't leak and overall seems memory usage is lower.

@Joshua-Ashton
Copy link
Owner

Is this fixed in latest master?

@yaomtc
Copy link

yaomtc commented May 20, 2019

It is now fixed for me. Thanks, @Joshua-Ashton!

@sypher7
Copy link

sypher7 commented May 20, 2019

It is also fixed for me in master, thank you @Joshua-Ashton!

@DxCx
Copy link

DxCx commented May 20, 2019

Awsome news @Joshua-Ashton
https://git.froggi.es/joshua/d9vk/commit/35a9423648153ecb08e195e5f0c400aa4f4ddc97
fixes this issue.
THANKS ALOT!

Edit:
I've sent a request to update lutris script to use this version. =)
One step closer for best experience ;)

@Joshua-Ashton
Copy link
Owner

cool

@Mel34
Copy link
Author

Mel34 commented May 20, 2019

Oh my God it works. Thank you so much! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests