Stuttering every 10-15s

Avatar
  • Views 39,398
  • updated
  • Completed - Resolved

Hi, i have these like frame skips/stutters every 10-15s and in mission 3 (HoG) they get more severe. What i mean is they are longer more like a second long which makes it very annoying and distracting. It happens regardless of the settings and what happens in the game. I can start a mission and move camera in circles around my core and it will still stutter every 10-15s. Although, in skirmish when the map is small and nothing much happening on it the stutters are so brief it is hard to notice them. On big maps with units etc. already on them (like HoG lvl 3) the stutters are longer and are a real pain.


Windows 7 x64

12gb RAM

i5 2500k @ 4.2

gtx 970

game version 1.4.0f4

output_log.txt

Game Version:
Steam Public
Platform:
Windows
Duplicates 4
Stuttering during play
I haven't played this in a while so with the release of the new DLC I decided to give it another bash, I've never completed it since low fps on later levels caused the game to become unplayable for me, less than 1fps.


I've built a completely new system since last time, wasn't expecting any issues but I've just completed the level to Defile Uthors Tomb and the last half of the level I kept stuttering every few seconds, I wouldn't think this should be an issue on my system at all but perhaps there is a fix?

My System:
i7-5820K
24GB DDR4 2666MHz
AMD R9 Fury-X

Windows 10

output_log.txt

error.log

Please fix the constant stuttering

I have a really powerful computer, i5, Gtx 970, 32 GB RAM and the game constantly stutters for a fraction of a second. This is really annoying and also often causes miss-clicks, or clicks not working, and is really immesion breaking.

I read that this is due to the engine you use and the garbage collection of that engine. I also read that you are wrapping up extra content for this game in the next patch. I bought this game twice. Once on steam and once from GOG because I really loved DK2 and I really love this game. You guys have done an amazing job and I wanted to support you. I also like my games DRM free. However please don't leave this game with such an annoying bug on an otherwise amazing game. This bug literally affects all campaign levels, skirmish, multiplayer etc.

Please fix this issue soon.

second to last mission unplayable due extreme lag

Every second or so the game just freezes/lags a bit. Its unpossible to finish the campaing. Im running I7-4770K @ 3.5GHz and GTX970 and 16GB ram.

Freezes after 5-10min each 5-10 seconds getting worse overtime
  • Specify your platform
    • OS Windows
    • Version 10
    • 64bit
      • Ram 16GB
      • CPU FX8350
      • GPU GTX 760
  • Specify the build you are using (there will be a timestamp visible on the main menu)

        1.6.4

  • Include as much information as possible (what map you were on, screenshots, videos, etc)

        After about 5 to 10 minutes, a small freeze starts appearing every 5 or so seconds. This freeze gets progressively worse the longer you play. I have no issues in between those time frames, the game runs smooth.
There seems to be little to no effect if I change the graphical options from the highest to the lowest possible settings (while keeping it 1080p though). The map size does seem to matter on how fast the freezes start appearing, under 100x100 it can take up to 10minutes. On the larger ones, it'll start after ~5 minutes.


I feel like the main thread or game ticks are not getting enough resources. I see 2 cores basically at a 100% while the other 6 are mainly idling.


I've been struggling with the performance since for ever now. In the past I was able to play the smaller maps decently, now I can't comfortably play this game at all.



  • Search the Bug Tracker for any similar or identical open reports, if one exists comment there instead of opening a new ticket

       I did a search, didn't seem to find anything related to this.

Avatar
Lee "Noontide" Moon Designer & Community Manager
  • Completed - Resolved
Avatar
anonymous
  • Completed - Next Patch

There should be an improvement next patch, please let us know

Avatar
anonymous

Hey Rohaq,


Unfortunately no improvements have yet been made to the Unity GC. We are still monitoring the situation.


WFTO is built in 5.4.6f1. You can always check the output_log after playing to double check that, it should be on the first line.

Avatar
Rohaq

I remember hearing that garbage collection was improved in newer versions of Unity; what version is WFTO built in? The game still ends up freezing for a couple of seconds, every ten seconds or so, after an hour or so into a game.

Avatar
anonymous
Quote from shadowmajestic

Hey Andrew,


Thank you for your reply.

I do not experience similar issues in other Unity games though, like 7 Days to die(I had similar issues in the past though, very tiny stutters every 5-10 seconds or so, but they were hardly noticeable with the other stutters at the time), which at times, is a bit more demanding that WftO. But they are entirely different games, so it is hard to compare these of course. I do recall an issue with minor freezes a couple of patches ago(i think it was alpha 14), their PlayStation porting partners found a solution for it. Might be related, most likely is not. (I think Joel talked about it on his dev blog at one point). If it might be helpful, I can try and find this.


For now I'll just try and stick to the smaller maps with the lowest settings where the freezes are sort of tolerable(your own maps seem to do better than the community maps). And on other fronts, fantastic work on the optimizations. From 30FPS which dropped to 10FPS or less after <30minutes of gameplay, to a steady 60 FPS all around (If I ignore these garbage collecting freezes). Really enjoying the fact that my crappy GPU can easily draw all the pixels you can throw at it.


Of course I was looking for an solution, but the main reason to post it was to make sure you guys were aware of it. As I couldn't really find others with similar issues. But you guys are, which is awesome. Thanks for the explanation.

I'm glad to hear that your overall FPS is higher. We are always trying to make the game more performant, hopefully you will see that as we march forward with WFTO development


As for the stutter we cannot do too much at this time to correct it as we wait for Unity to improve their Garbage Collection solution, as Nutter said

Avatar
shadowmajestic

Hey Andrew,


Thank you for your reply.

I do not experience similar issues in other Unity games though, like 7 Days to die(I had similar issues in the past though, very tiny stutters every 5-10 seconds or so, but they were hardly noticeable with the other stutters at the time), which at times, is a bit more demanding that WftO. But they are entirely different games, so it is hard to compare these of course. I do recall an issue with minor freezes a couple of patches ago(i think it was alpha 14), their PlayStation porting partners found a solution for it. Might be related, most likely is not. (I think Joel talked about it on his dev blog at one point). If it might be helpful, I can try and find this.


For now I'll just try and stick to the smaller maps with the lowest settings where the freezes are sort of tolerable(your own maps seem to do better than the community maps). And on other fronts, fantastic work on the optimizations. From 30FPS which dropped to 10FPS or less after <30minutes of gameplay, to a steady 60 FPS all around (If I ignore these garbage collecting freezes). Really enjoying the fact that my crappy GPU can easily draw all the pixels you can throw at it.


Of course I was looking for an solution, but the main reason to post it was to make sure you guys were aware of it. As I couldn't really find others with similar issues. But you guys are, which is awesome. Thanks for the explanation.

Avatar
Andrew "Nutter" Jaggar
  • Pending Third Party

Hi ShadowMajestic,


Unfortunately the issue you are experiencing is a known issue and is due to Unity's own Garbage Collection algorithm (which is outdated and in all honesty kind of rubbish) rather than WFTO itself. Unity are "looking at it" and working on a new (and improved) algorithm which should fix/solve the issue but there is no known timelime for it to be finished/done.


In the mean time Brightrock themselves continually optimise the game as best as they can to squeeze every last drop of performance possible from the engine but ultimately this is an issue they can only put a bandage over. Unity themselves are the only ones who solve this issue.


The best thing I can suggest is playing the game on low settings, and when you start seeing the issue, save and reload the game (which clears all the garbage and will temporarily stop it happening for a while).


Sorry, because i'm sure that's not the answer you were looking for but I hope it helps a little and you can still enjoy the game whilst we wait for Unity to get their act together.

Avatar
Lee "Noontide" Moon Designer & Community Manager
  • Under Review

Hi Darkassassin98,


Thanks for the praise for the game and for your support. I can say that we truly appreciate the frustration that comes from the GC Stuttering, for us as developers it's extremely irksome to watch the game struggle in later stages and we keep trying to look for ways to reduce it. We've made some changes internally which should improve the problem very slighty but as you may know the true solution lies with the planned new low latency & generational garbage collection algorithm that is planned by Unity.


Unfortunately we currently have no timeline for this feature and we've been waiting for some time on it, from our side there's sadly not a great deal we can do at the time being but that doesn't mean we'll stop looking for further optimisations. All I can say is that we do still plan for some sort of long term support of WFTO but I can't speak to the scope of support this might entail, it's certainly not something we want to leave unaddressed however and it's frustrating that a solution has thus far eluded us.

It is our hope that should the new GC be added in Unity that we'll do our best to bring the game up to that version simply to make use of it. However given this unknown time scale for the feature we can't say how likely it is to happen. Upgrading the engine is a time consuming task and can even be roadblocked by support issues with other middle-ware that exists in WFTO. We're looking at options to keep the game as up to date with the engine as possible and at the very least we'll be keeping our fans informed.


I'm sorry that I can't offer anything more concrete at this time but I hope that as we get closer to 2.0 we can at least have a more clear answer in sight.


I'll look to merge this with the lead topic on this matter.


Cheers,


Lee

Avatar
Kanakotka

2) That networking isn't on in singleplayer, is it? My own issues are in singleplayer, multiplayer matches generally don't last long enough for the issue to surface for me. UI i can understand, as a somewhat flimsily coded UI can produce mass garbage. If your bought frameworks are causing notable performance dips though, you should contact their developers.


3)

Unfortunately += and -= are notoriously garbage-filled because what they actually do behind the scenes, and i can totally understand the sweeping changes that would need to be done for. What i mean by "easy" is that when you know what to avoid, it's reasonably easy to just scroll through and replace certain things and that alone could be beneficial for performance. More invasive, "proper" optimization is always extremely hard and work heavy.


4)

It's essentially a memory leak being handled by GC automatically because the GC inclusively tracks what the code is doing at any given point in time. It would be the classical case of memory leak if it managed to get past Unity's GC, but i just prefer to use the term because as far as i know memory leaks as we knew them are things of the past outside of making your own engine or something.


5)

Having just 2 coders on a project of this scale is scary... and impressive. Hats off to you guys.


Unfortunately right now i'm full-time employed with a project for at least a month and i couldn't manage to concentrate well enough on an optimization pass. After that though? I can get back to you :)

Unfortunately the project i'm working at is 5.3x version and i don't have any experience of porting larger scale projects to newer versions (which unfortunately often isn't worth the trouble)

Avatar
[Dev] Nanorock

I appreciate the intent. But there are still a few point of miscommunication. 

2) We're using uLink framework for networking, it uses obfuscation and produces GCs on update. We're using CoherentUI for our UI, and isn't innocent either. And we have more frameworks. Those are the black boxes I meant, that we have no control over, like Unity.

3) Let's forget foreach, it's minor compared to the rest of the hurdles we encounter working on the old Mono version. My point was you make it sound as easy as hunting a few foreach, and caching variable (which we did). But when you realize a simple MyEvent += MyMethod (or -=) procudes GC, it does change your whole architecture, and since it is optimization, you generally realize that too late late in the process.  

4) You have a different conception of what memory leak is in a managed environment than me. GC can only collect what have been released. In my definition a leak is when the memory grows until OOM (so constant allocation never released unknowingly by the coder). I'm not contesting we have GC being produced.

5) Well to shed some light we have well over 300k+ loc, and ... 2 coders ;) I do like your suggestion of running in an isolated environment, but realistically it is not currently doable with the resources at hand.


And I also appreciate the wish to help. If you're really confident in your ability to fix the issue(s), with the constraint we have (we are stuck at 5.4 for the time being), you can always PM me for further discussion :)