goatcorp / FFXIVQuickLauncher

Custom launcher for FFXIV
https://goatcorp.github.io/
GNU General Public License v3.0
2.79k stars 326 forks source link

[Flatpak] Game starts lagging after a while #1184

Open LordBrainless opened 2 years ago

LordBrainless commented 2 years ago

Update disclaimer

What did you do?

I switched to XIVLauncher a while ago, when the normal launcher wouldn't start any more after an update. Now when I'm playing, it runs normally but after a while, it suddenly enables "lag mode" and it starts lagging only while I move my cursor (everything runs fine while not moving my cursor). This keeps happening until I restart the game. Also, I don't know if this is a bug, but the game doesn't recognize mouse button releases sometimes (I release my mouse button but the game thinks I'm still holding it down). These problems didn't occur when I used the normal launcher.

Platform

Linux (native)

Wine/Proton runner version

XIVLauncher Standart

Relevant log output

No response

Blooym commented 2 years ago

Possible duplicate of #956 & https://github.com/goatcorp/Dalamud/issues/956

loleik commented 1 year ago

Hi, I also have the same issue with XIVLauncher causing the game to lag after around an hour. As LordBrainless mentioned, it is only when moving the camera with the mouse. All other aspects of the game run perfectly fine. It fixes itself when restarting the game, however this just "resets" the timer so to speak.

I am also using the flatpak version of XIVLauncher. Currently using the latest version available. However, I also had this issue a month or two ago on an older version, which I was never able to fix, the issues with the official launcher I was having just ended up stopping with newer versions of Proton GE.

I'm personally using Proton GE 38 for the game, however changing this doesn't seem to impact the issue at all.

One last thing I'd like to add is that previously this issue occurred for me regardless of whether Dalamud was enabled or not.

Circuitkun commented 1 year ago

Tried the flatpak one out, and even building it for RPM i noticed i only had the weird performance problems when i had steam overlay on, moment i turn it off i had proper performance.

Something with the launcher doesn't like the steam overlay in my case, but if others could try and see if they have similar issues that would be great.

rankynbass commented 1 year ago

Several people have reported in the #linux-and-deck channel that launching through steam would cause the issue after an hour or so, but launching outside of steam was safe. That would seem to line up with the overlay causing problems.

yaomtc commented 1 year ago

It's not just with the mouse. If you move the camera with the keyboard or with legacy type movement (automatically rotates smoothly around your character) I also see the choppiness. There may be less of it, not sure.

Also, with the Steam overlay completely disabled in Steam settings it still occurs, so I don't think it's related to the Steam overlay.

yaomtc commented 1 year ago

I have just reproduced my issue with another game, Half-Life 2: Episode Two. Specifically with the beta, and -vulkan in the launch options (to fix crashes I was having previously with HL2), I didn't experience this while I was using the standard togl translation. Though it might be a coincidence and -vulkan / DXVK may or may not have anything to do with it? Either way this is the exact same issue I was having, I'll try to get a screen capture of it occurring in FFXIV too.

Screen capture: https://youtu.be/_x1oeoW9AVA

yaomtc commented 1 year ago

FFXIV screen capture: https://youtu.be/XS4pSqDYM5M

EDIT: disabling the overlay still allows notifications for messages/achievements. Does having Steam running keep some layer active above the game, or does it use some other mechanism?

rankynbass commented 1 year ago

If you're willing to do some testing, you could try this build (requires manual install. Read the instructions): https://github.com/rankynbass/XIVLauncher.Core/releases/tag/rb-1.0.2-9

Try it with no changes to settings, and see if it's still a problem. If it is, go into settings and check the "Ignore Steam" and try again. There's also options to try different versions of DXVK, so you might try version 1.10.3 or 2.0 and see if the issue persists. Unfortunately, I've only encountered the problem twice, after 3+ hours of active playtime, so I can't really test if this fixes anything.

yaomtc commented 1 year ago

Thanks, I'll test this. By the way, those instructions should say flatpak install --user xivlauncher-rb-1.0.2-9.flatpak, it currently says 1.0.2-8

EDIT: also, it's not enough to swap out dev.goats.xivlauncher for dev.rankynbass.xivlauncher in Steam's launch options. I also had to swap out branch=stable for branch=master.

EDIT2: also I had to use flatseal to give it permission to access the drive FFXIV is installed on

yaomtc commented 1 year ago

Without changing any settings, the problem still cropped up. However, after playing for several hours with "Ignore Steam" checked, it hasn't happened. Normally it would have occurred some time ago. So Steam is the issue, it seems.

rankynbass commented 1 year ago

It seems this problem may be solved by this pull request on XIVLauncher.Core: PR 19

yaomtc commented 1 year ago

Ah, it cropped up again today with @rankynbass' patched xivlauncher. I'll continue to test, switching back and forth between the launchers for a while and see if it occurs more frequently one way or another.

yaomtc commented 1 year ago

Follow-up: none of those versions of DXVK make a difference for me. Have now reproduced the issue with 2.0 as well.

kentywang commented 1 year ago

@yaomtc did you find a way to resolve the issue? I am also experiencing this.

yaomtc commented 1 year ago

I just stopped using XIVLauncher since then. I still suspect it has something to do with Steam but since I own it on Steam, I'm not sure that I can completely avoid the problem otherwise

MuteObserver commented 1 year ago

I haven't got much of a chance as of yet to play around -but if disabling the Steam Overlay was fruitless my first thought goes to Dalamud -may be worthwhile turning off it's injection, and seeing the results. I'm also curious if this would appear in DX9 mode.. but anyway, seems you're just not using it for now, which is sensible.

kentywang commented 1 year ago

I first disabled Dalamud in the XIVLauncher's settings but still encountered the stutter after an hour or so of playing. Then I tried checking the "Ignore Steam" option, but that made it so XIVLauncher started prompting me again to install the FFXIV trial version on Steam, preventing me from launching FFXIV.

I am going to try installing XIVLauncher via Lutris now, as according to this ProtonDB comment it helped someone bypass the stutter.

My system is a Steam Deck, FWIW.

kentywang commented 1 year ago

So after installing XIVLauncher vla Lutris, I still encountered the stutter when playing FFXIV added as a Steam game (and in gaming mode). Then I tried adding Lutris itself as a Steam game but still encountered stutter once I launched FFXIV from Lutris there (again, in gaming mode).

I did not encounter the stutter when simply launching XIVLauncher from Lutris in desktop mode.

Famf commented 1 year ago

Posted this on #956 so I'll re-post here as well for visibility.

I was having this same issue and it seems to have been resolved. I'm not sure what fixed it exactly but here is what I have going on.

Edited dxvk.conf in ~/.xlcore/ffxiv/game with the following: dxgi.maxFrameLatency = 1 dxgi.syncInterval = 0 dxgi.maxFrameRate = 60

I am also launching xivlauncher from Steam with gamescope. My launch options are: XL_SECRET_PROVIDER=FILE gamescope -w 3840 -h 2160 -W 2560 -H 1440 -r 120 %command% run --parent-expose-pids --parent-share-pids --parent-pid=1 --branch=stable --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher

Replace the -w and -h numbers with what you want the game to render at. -W and -H are the parameters for the gamescope windows size. You can full screen with meta + F. -r sets the refresh rate.

I also had to switch from hardware cursor to software cursor in system configuration to prevent gamescope from randomly changing the camera when you left or right click.

moeraccoon commented 1 year ago

I'm sorry to bring this one up again but I am having a similar issue and I was hoping to fix it. I tried using the launch options with gamescope mentioned in the last post but the launcher fails to start when I use it.

I'm not on steamdeck, could that be the issue? I am still on linux though.

marzent commented 1 year ago

There is a new wine-xiv release which should help with an issue, which sounds extremely close to this one...

To test it just override the wine distribution shipped with xlcore with the new release (while keeping the old wine-xiv-staging-fsync-git-7.10.r3.g560db77dfolder name)

moeraccoon commented 1 year ago

There is a new wine-xiv release which should help with an issue, which sounds extremely close to this one...

To test it just override the wine distribution shipped with xlcore with the new release (while keeping the old wine-xiv-staging-fsync-git-7.10.r3.g560db77dfolder name)

Can you please explain like I'm five what I have to do?

rankynbass commented 1 year ago

Download the ubuntu version. Unzip it somewhere. You'll end up with a folder named wine-xiv-staging-fsync-git-8.5.r4.g4211bac7.

Method 1: Go into the folder, and select all, and copy. Then go to ~/.xlcore/compatibilitytool/beta/wine-xiv-staging-fsync-git-7.10.r3.g560db77d, and paste the folders in there, overwriting everything. If you can't see the .xlcore folder, enable "Show hidden files". Start XIVLauncher, and launch the game.

Method 2: Rename the folder to something easy to type, like wine-xiv. Then open XIVLauncher, go to settings, wine tab, and change Installation Type to "Custom". Type the full path to your custom wine folder and add /bin at the end, e.g. /home//Downloads/wine-xiv/bin`. Click the check mark, and then launch the game.

moeraccoon commented 1 year ago

Sadly still no luck. I wonder if my specific GPU has something to do with it.

yaomtc commented 1 year ago

Personally with wine-xiv-staging I no longer have lag/choppiness with camera movement in general. If the camera is moving only as a result of keyboard input or the "Legacy Type" movement settings, it's totally fine, unlike my previous experience.

However, I have noticed choppiness does still come back when it comes to the mouse controlling the camera. Here's a screen capture.

https://www.youtube.com/watch?v=IGEejrHJ16I

EDIT: It's a bit hard to tell in the capture but you can see one type of camera movement just doesn't move for some frames (use J and L to move frame-by-frame on Youtube) while on the legacy or keyboard-based camera movements it moves on every frame of the turn.

I primarily use Legacy Type, so this isn't a major issue for me anymore. Big improvement.

EDIT2: I've confirmed that a gamepad is unaffected. It's just the mouse controlling the camera, which only starts after some time in the game.

EDIT3: also my mouse sometimes thinks I'm holding down LMB when I've just clicked it, I have to click again to get it un-stuck. And the choppiness also occurs when rotating the character model with the mouse in the Fitting Room window

yaomtc commented 1 year ago

I've also now experienced camera choppiness with keyboard and legacy movement as well as just camera movement in dungeon cutscenes. So wine-xiv doesn't solve any issues for me unfortunately.

moeraccoon commented 1 year ago

I'm far from being a programmer so please keep that in mind while I ask my very ignorant question, but would it be impossible to make the default wine version a more recent one? Experimental maybe, or the latest eggroll? I'm playing flawlessly with those without the launcher. Also, again ignorant question, could it be that using it as a flatpak could be the issue? I install my steam from the official repo of my distro, maybe that's where the problem is?

rankynbass commented 1 year ago

There is a release you can download, posted above by marzent. Here's the link again: https://github.com/goatcorp/wine-xiv-git/releases/tag/8.5.r4.g4211bac7

I'd guess it will be made the default with the next release, but until then you can use it as a custom wine.

As for the stuttering issue, it has been reported in non flatpak versions as well, though less frequently. It seems to be caused by launching through steam. Most likely the gamoverlayrenderer.so library.

moeraccoon commented 1 year ago

There is a release you can download, posted above by marzent. Here's the link again: https://github.com/goatcorp/wine-xiv-git/releases/tag/8.5.r4.g4211bac7

Yeah I tried that one, it didn't solve my issue sadly, as it happened with others in this thread.

rankynbass commented 1 year ago

You could try adding LD_PRELOAD="" to the beginning of your Steam Launch Arguments; so it would look like this:

LD_PRELOAD="" %command% run --branch=master --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher

That would completely strip the gameoverlayrender.so library from XIVLauncher.Core as well. You'd lose steam input support (I think), but that shouldn't be an issue if you're not on the steam deck. FFXIV should still be able to detect your controller without it (assuming you use one).

yaomtc commented 1 year ago

Yes, it does appear to get rid of the camera/mouse stutter. The mouse button input does still get stuck sometimes, but that's much more minor of an issue I can tolerate.

moeraccoon commented 1 year ago

You could try adding LD_PRELOAD="" to the beginning of your Steam Launch Arguments; so it would look like this:

LD_PRELOAD="" %command% run --branch=master --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher

That would completely strip the gameoverlayrender.so library from XIVLauncher.Core as well. You'd lose steam input support (I think), but that shouldn't be an issue if you're not on the steam deck. FFXIV should still be able to detect your controller without it (assuming you use one).

Sadly with this change the launcher doesn't seem to start at all.

yaomtc commented 1 year ago

Here's my launch options, try this?

LD_PRELOAD="" XL_SECRET_PROVIDER=FILE %command% run --parent-expose-pids --parent-share-pids --parent-pid=1 --branch=stable --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher

moeraccoon commented 1 year ago

Here's my launch options, try this?

LD_PRELOAD="" XL_SECRET_PROVIDER=FILE %command% run --parent-expose-pids --parent-share-pids --parent-pid=1 --branch=stable --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher

This is what fixed it for me, apparently at least. I played for a good while without any problem. Would it be possible to reach the devs and let them know to add this one for non steamdeck users in the guide?

yaomtc commented 1 year ago

Would it be possible to reach the devs and let them know to add this one for non steamdeck users in the guide?

Yes, see the pull request I just created. (Are you on Deck?)

moeraccoon commented 1 year ago

Would it be possible to reach the devs and let them know to add this one for non steamdeck users in the guide?

Yes, see the pull request I just created. (Are you on Deck?)

Nope, pc, that change completely fixed everything for me and it might help many others so I reckon it should be in the default guide on how to get it to work on desktop. I was getting so severely frustrated I was starting to consider dual booting only for this single reason.

yaomtc commented 1 year ago

While the issues aren't severe anymore, there still is a noticeable stutter that I don't experience with the vanilla launcher / Proton.

yaomtc commented 1 year ago

Disregard the previous comment. Enabling the game's frame limiter (75fps on a 75 Hz monitor) fixed the stuttering issue. Don't know why the "none" setting would cause stutter but it does this with Proton and the vanilla launcher too.

MidoriKami commented 1 year ago

Does the stutter still occur if you disable the games framerate limiter and use ChillFrames as a framerate limiter instead?

yaomtc commented 1 year ago

Actually, with Proton-GE, the game runs seemingly perfectly smoothly, though I need to use LD_PRELOAD="" to completely disable the overlay feature as mentioned above. With wine-xiv, while I can use the overlay without that severe issue, there is some stutter still.

I just tried ChillFrames. If it makes any difference, it seems to be subtle enough that I'm just sticking with Proton-GE with the overlay disabled. Never used the overlay anyway.

EDIT: To clarify, while the frame limiting did fix some of the stuttering I was having in wine-xiv, it wasn't consistent and I could only completely get rid of it by switching to Proton

EDIT2: using Proton instead of the managed Wine has the side effect of XIVLauncher closing not being detected by Steam

LuxasXIV commented 1 year ago

There is a new wine-xiv release which should help with an issue, which sounds extremely close to this one...

To test it just override the wine distribution shipped with xlcore with the new release (while keeping the old wine-xiv-staging-fsync-git-7.10.r3.g560db77dfolder name)

Hi! How could I install this? Im experiencing similar stuttering issues. Whenever I frop 1 or 2 frames i stutter.

rbaker87 commented 8 months ago

Might as well chime in since it's been quite a few months since the last comment here. This still persists for me using the latest xivlauncher with the now-merged 8.5.r4.g4211bac7 version of wine-xiv-git. Steam overlay disabled/enabled. Ignore Steam checked/unchecked. The same launch options with LD_PRELOAD mentioned above.

The issue seems to occur faster during heavy gameplay if this helps to reproduce it in the future. I can pretty regularly recreate the issue after roughly 3 frontline queues. If I just sit in town and wait I can run the game basically indefinitely without any problems.

yaomtc commented 8 months ago

I would suggest trying Wine 9 with Wayland enabled. Here's a build you can try (see instructions) or you can use any other Wine 9 build compiled with Wayland support. Might help.

https://github.com/rankynbass/unofficial-wine-xiv-git/releases/tag/v9.1

Marfjeh commented 8 months ago

It seem to be happening on my steamdeck as well. But it only stutters with a usb mouse and keyboard after a while, restart it and its gone for some time. On the controller from the deck there is no problem.

I did notice while logging the kernel logs that a interrupt took too long and it was increasing something. Im not sure if it has todo with the stutters.