Stutter when loading detailed LODs

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

user1679
Posts: 852
Joined: Fri, 20. Jul 18, 23:20

Stutter when loading detailed LODs

Post by user1679 » Wed, 22. May 24, 05:32

Currently running with an RTX 3060 and an i5-7600 with X4 installed on a crucial MX500 SSD.

I have a 13600k waiting for a new motherboard but in the meantime, I noticed some strange hitching / stutter when the game loads LODs. After the 6.20 update, my FPS stabilized even with the older i5 and my upgrade to the RTX. I've been playing with graphics options in game and in the nvidia driver but this problem still exists. It's mostly noticeable as I approach an asteroid field but it is also apparent when ships fly toward me. I might be flying along at 40 FPS and suddenly it will drop to 12 FPS for literally one or two frames, not seconds but frames. Typically this drop happens as whatever model I'm looking at loads in the more detailed LODs.

I have tried LODs 100 and LODs 10 but this hitching still happens. Sometimes it also does it if I stand on a station and look from side to side quickly. Is there any trick that can sort this out? Thanks.

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30574
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Stutter when loading detailed LODs

Post by Alan Phipps » Wed, 22. May 24, 09:46

If it is literally just one or two frames as you say then it might be vsync preventing screen tearing - that theory is somewhat supported in your looking around quickly comment. Do you have vsync on or off, and does the issue change if you toggle it?
A dog has a master; a cat has domestic staff.

Imperial Good
Moderator (English)
Moderator (English)
Posts: 4787
Joined: Fri, 21. Dec 18, 18:23
x4

Re: Stutter when loading detailed LODs

Post by Imperial Good » Wed, 22. May 24, 16:17

Check if 7.00 beta improves this at all, there might be optimisations and bug fixes in that which could help.

Otherwise this is likely the result of the aging i5-7600. Given your already quite low frame rate, it just might not have the compute capabilities to stream assets without causing noticeable stutter.

Daemonjax
Posts: 145
Joined: Tue, 27. May 14, 01:54
x4

Re: Stutter when loading detailed LODs

Post by Daemonjax » Wed, 22. May 24, 17:22

user1679 wrote:
Wed, 22. May 24, 05:32
apparent when ships fly toward me
That happens to me, too, on a 10700k on 7.0 b5. Not sure if it's a LOD thing or an audio thing, though because if a ship is coming at me it's because I'm shooting it. I might have fixed it, not sure yet... Yesterday I swapped out my soundblaster z to use my onboard realtek device again -- to be honest I prefer the sound quality of the realtek, because the soundblaster z doesn't have an option for setting the amount of amplification it does for headphones (while the realtek does) and it's WAYY over-amped which causes some very noticeable distortion around 6000hz which is very annoying (it's in the range for the "click" mouth-sound taylor swift makes in that Blank Space song -- I'm not a swiftie, but it's one of the songs I use to test audio). It's possible the soundblaster z was ignoring my attempts to pin it to a specific core (I want it on a core the rendering threads aren't using), and maybe it was sticking on core 1 (which will causes problems). It's a bit hard to test to 100% know for sure which core your audio drivers are using.

user1679
Posts: 852
Joined: Fri, 20. Jul 18, 23:20

Re: Stutter when loading detailed LODs

Post by user1679 » Thu, 23. May 24, 03:06

Thanks for the suggestions.

@Alan Philips

I usually use triple buffering v-sync in X4 because I read that the nvidia driver interprets that as "no vsync" for Vulkan in X4. I did try other options per your suggestion but I didn't notice any change.

@Imperial Good

I would tend to agree the CPU is struggling but this happens when I'm in empty space too. For example, I sit with my fleet and see around 50 fps. I order one of my ships to fly away and back. As the ship approaches and the different levels of LOD are loaded, there's a momentary dip in FPS and the LOD sort of pops into view. If I put LOD at 100, there is a point when the ship is far enough away that the LOD changes anyway and the hitching happens. I find it strange that "streaming" an LOD from a SSD to an RTX 3060 would cause that much stress when the fps is stable at 50. Yes, the CPU is simulating the entire uinverse but that should also make the fps unstable and it doesn't.

@Daemonjax

That's interesting, I hadn't considered it could be an audio problem. I also have onboard Realtek which I currently have set at 5.0 by default. I wonder if changing it to 2.0 might help.

Daemonjax
Posts: 145
Joined: Tue, 27. May 14, 01:54
x4

Re: Stutter when loading detailed LODs

Post by Daemonjax » Wed, 29. May 24, 17:40

it seems better now for me, but I also needed to set the LOD settings to 33 to solve more general performance issues so maybe that helped with this. But it _seems_ better now. 99% of the time, 100% LOD and 1% LOD perform the same... but sometimes it matters, and when it does it really helps to lower it but I gotta go real low to make a difference. A save/reload (even without exiting the game) is more of an improvement, but it's not something I always want to do every time. 33% LOD looks fine I guess... it's mostly about the asteroids anyways. I think some sectors could use less asteroids. Maybe teleporting OOS and back would work too, no idea. Maybe it's just the random nature of the engine's asteroid placement.

Update: FINALLY I was able to solve my "seemingly audio" stutter issue by modifying alsoft.conf in the game's folder and add the line:

Code: Select all

periods = 6
So, I was able to devise a test that could be repeated: start a new game, Stranded start. Talk to axiom in his cell, after that save the game (so you can reload it at this point if you want to). Now you just have to run down the hallway until he contacts you remotely -- takes like 10 seconds. If his audio causes frame stutters when he contacts you remotely, then that's the same thing I was experiencing elsewhere (basically what the OP described here -- I zoom and boom, first landed hit causes huge frame drop)-- and the above fix does fix that. Just quit the game and reload to test -- it's repeatable, no need to reboot to clear the cache... Just alt-tabbing might be enough, dunno. I got that setting from here: https://github.com/kcat/openal-soft/blo ... trc.sample

Basically it's the number of buffers. Maybe the default is 3... who knows, afaict X4 uses an older version of that openal dll and default values change over time. If the default isn't 3, it's close to 3. I still get the stutter when manually set to 3. Up to around 8 is playable without really noticing the audio delay. Each increment of the value is another buffer that adds close to 20ms audio delay (depends on your audio frequency but it's close to 20ms). The max is 16, but that's causes really bad audio lag -- but it's cool that you can set the value high enough to be like "Yeah, that setting definitely has an effect." If the max was a sane value like 8, it would be hard to 100% Know if I'm wasting my time testing it. Anyways, 6 is totally fine -- can't tell there's additional audio lag. I tried all other relevant settings, and this is the one that fixes it.

Any OTHER stutters I have... maybe it's LOD loading. Maybe it's nvidia drivers changes (I can only go back so far with this newer video card, 4070ti super) with how vulkan over DXGI swapchain works. Maybe it's 7.0 performance regressions. But they're minor compared to this. This game does ignore when I try to pin my GPU driver to a specific core... seems to always use cores 1 and 5 (I have 8 cores, ht disabled) for the main loop and render thread (hard to know which is which, but I'm leaning towards 5 being the main loop -- 100% usage on that core with vsync off, and I don't think my GPU maxed out at the EXACT same time, but not 100% sure because I didn't actually check) no matter what. Maybe it's also ignoring which core I try to pin my audio drivers to (that's really hard to test). Tbh, I'm leaning toward changes in the newer nvidia drivers -- maybe anything newer than 537.58... but maybe older than that... maybe 527.xx ish. EDIT: I tested with no audio card whatsoever in my system (realtek disabled in bios), and I still get those "other" stutters... it's like the dxgi swapchain setting doesn't work very well compared to how well it fixed stuttering back on my 1070ti in 6.2 beta whatever (still way better than running this game native vulkan). Maybe stutter isn't the best way to describe it... frame drops... no... frame "skips" feels closer. Sidenote: newer drivers do set this game to automatically use the dxgi swapchain option by default (when set to auto)... older drivers didn't, at least on a 1070ti. I coded a test vulkan engine to help me test various settings... it gets slightly better fps over dxgi swapchain when in borderless instead of fullscreen for some weirdass reason... maybe I should try that -- on the other hand, this game doesn't actually have a fullscreen exclusive mode, so it's just borderless windowed all the time so it shouldn't matter.

Return to “X4: Foundations - Technical Support”