Jump to content

Serious answer to the stutter issue.


Recommended Posts

Re-posting my "developers are aware / have addressed" comment from the previous thread linked by Katateochi:

Background: GC stutter was really bad in .90, requiring frequent restarts. Today, I can see the GC problem happening in every play session... sometimes a mouse click is eaten and doesn't end up where I want it... but unless I was making a video... it's nothing compared to how bad it was.

It’s been an exciting week. The aero/thermal branch was finally merged into develop and brings with it a load of performance improvements. The VAB/SPH scenes no longer require reloads when you clear/load a vessel, PQS reset/startup has been smoothed - lowering the time required to transition scenes, and lots of little tweaks to reduce the game’s CPU load and garbage collection. The QA team and myself have also been working on improving and balancing the new physics systems.

So, Squad is aware that this problem exists, has written about it at least once, and in my experience, the problem is less noticeable in v1.0. Expect another round of optimization, in the final weeks of v1.1 development.

Edited by basic.syntax
Link to comment
Share on other sites

This issue will occur in a pure stock install, BUT not in a fresh save. Even with a large craft it won't be very noticeable if that's all you have in the save.

It becomes more noticeable with lots of craft in flight.

Basically you need to push the game a bit in order to see it (more craft in flight is just one way to push it). I can't say exactly at what point to expect to see it, but in a pure stock career with 40 in flight craft the game became completely unplayable because of this. To start with the game ran nicely, but gradually as I put more craft in flight it because gradually more and more noticeable and less and less tolerable.

Do you know if this goes off currently active flights or flights ever? Ie will terminating/recovering craft reduced the stutter issues or is "the damage done" no matter what? If it's the former that's a partial workaround at least, and would also very well explain why some players are badly affected by it and others are not especially when you consider the debris count setting.
Link to comment
Share on other sites

I have noticed this issue in stock, modded, large, and small games. Rather than impede piloting or building, it breaks our willing suspension of disbelief by frequently reminding us that Kerbal Space Program is only a game. Panning around one's orbiting craft, be holding its beauty and that of the planet below, is hard when the game catches every few seconds.

-Duxwing

Link to comment
Share on other sites

Is this something that once I see, I won't be able to unsee it?

Maybe. A little.

The effect we're talking about is the game taking a short break every five seconds or so. As you run out of memory, these breaks get ever longer, from barely noticable to maybe half a second. For me, this has improved greatly with the 1.0 release -- presumably because quite a few memory leaks have been fixed. But I can still run into it if I do a lot of VAB/Launchpad reverts. If someone has lots of mods consuming memory, they start from a higher baseline and presumably experience this sooner.

When it becomes noticeable, I tend to restart KSP. If I don't, the game will crash after a few more reverts.

Link to comment
Share on other sites

My game runs just fine up to a pretty high part count, what is your specs?

mine:

i7-3770

GTX 660 video card

8gb ram

windows 7

Edit: my post is not meant to belittle anything, I am just unfamiliar with the problem. Since .90 performance has gone up for me greatly.

Edit II: also my game runs great 100% stock, good point Canadianvendingmachine.

i have:

intel core i7-4790k

16 GB RAM

GTX 980 Video Card

Windows 8

And I get the stutter problem.

Link to comment
Share on other sites

I used to experience a bit of a stutter, but only in the VAB, and even then only after loooong building sessions with extremely large ships. Very, very occasionally it would occur in the flight scene under similar circumstances, but restarting the game always fixed it. It seems to have disappeared a version or two ago, though. And it's hardly on every video about KSP. In fact, most Youtube videos that I've seen seem to more or less be devoid of the stutter. Maybe I just haven't seen enough videos, though.

Link to comment
Share on other sites

Do you know if this goes off currently active flights or flights ever? Ie will terminating/recovering craft reduced the stutter issues or is "the damage done" no matter what? If it's the former that's a partial workaround at least, and would also very well explain why some players are badly affected by it and others are not especially when you consider the debris count setting.

I think that No. active flights isn't the cause, it's just one way of pushing the game. You could also get this issue to crop up with few active flights but with several mods that result in lots of objects being created/deleted (:. making the GC work harder).

I have not actually tried clearing out craft from one of my larger saves, I really should though. I am fairly sure that would reduce the problem. I just get to a point where my space program is nice and space programy (lots of stuff happening all over the place) and then it gets unplayable and I've walked away from it in frustration. I need to try clearing it out and seeing what happens.

On the bright side, most people here seem to have no idea what this issue is, so thats good. must not affect too many users.

I think it affects quite a few people. The thread I linked to earlier is one of the longer running threads in unmodded support.

I wonder what makes it happen to some people and not others. most strange.

I'm fairly sure this is down to how much load they put on their game. I think some people will also be more tolerant of it, and some won't even notice it until it's clearly pointed out (I really annoyed a mate of mine who thought he didn't have it until I pointed it out).

If you are the sort who runs one mission at a time to completion and then brings everything back and tries to minimize debris or spend time in sandbox designing/test craft without really doing missions (what I'm currently doing) then you're much less likely to notice it. But if you try to send missions everywhere all at once, have tons of satellites and debris all over the place then I think you'll experience the problem much sooner.

I have noticed this issue in stock, modded, large, and small games. Rather than impede piloting or building, it breaks our willing suspension of disbelief by frequently reminding us that Kerbal Space Program is only a game. Panning around one's orbiting craft, be holding its beauty and that of the planet below, is hard when the game catches every few seconds.

-Duxwing

This is part of what has greatly detracted from my enjoyment of KSP; the break in immersion that this causes. But it does also get in the way of some piloting, or at least some craft actions. For example you've selected a couple of fuel tanks to transfer fuel from and as you go to select one more the stutter happens just as you're about to click. That causes the click to be registered on another part and you've got to start all over again. I've also had it cause catastrophic mission failures when it's happened just as I was about to land.

When it comes to trying to make youtubes, especially the more cinematic ones, it becomes a real pain (resulted in me pretty much giving up that passtime). If you get a stutter as you're trying to gently pan the camera around then suddenly you'll find yourself right round the other side.

The big problem is that for a lot of the time I think this issue will be ignored by most. If people are running with lots of mods then they'll probably put it down to the mods being the problem and it's "just one of those things" you cope with if you roll with mods. In quite a lot of general flight you may not notice it happening, or when you do notice it happening you just think "oh, computer hic-up, maybe windows just decided to download something".

Or if you do notice it you set about trying to eliminate mods that might be causing it and after removing each one you think "ah fixed it", only some while later to find that it's crept back it. It took me months of trying to find the "cause mod" before realising that it was a stock game problem, and then to realise that it had something to do with the level of activity in a save. It is an extremely hard issue to quantify.

I really hope that I'm wasting my breath on this and in fact Squad have plans to tackle this problem and we just have to wait for the Unity5 upgrade, UI improvements etc. But the cynic (and programmer) in me is really kinda worried; This is a foundation level problem, and you don't fix the foundation after you've installed all the fixtures! In agile/lean practices this is a "stop everything and focus on the problem" situation (you don't keep feeding raw materials into a broken machine on the factory line, you shut it down and fix it).

My fear is that the planned updates do not directly address this issue, but they will more than likely do things to improve the situation. So Kat, you should be happy about that! No!! That simply means the problem will be masked but will still be there only now it will take a bit more load before becoming apparent. Those who dream of building massive space programs will still run into it, only now as even less people are aware of it, the chances of it getting addressed properly get further reduced.

We know what the problem is, we know how the implementation needs to change to solve it. Unity updates and UI improvements are not the solution. They'll be good additions, and reduce other load on the GC, but they don't actually fix the problem at it's core. Squad needs to take a hard look at the game cycle processes and find the places where objects are being created/deleted on the fly and those actions need to be unified and objects should be collected in a resource pool.

There are lots of posts by other unity developers on places like stackoverflow talking about this same issue. All agree that unity's GC is limited, but they also all say that the limitation can be worked around with more careful asset management. The intuitive implementation of creating something as required may work, but it doesn't scale, the real solution is less intuitive (but isn't that just classic programming?).

Link to comment
Share on other sites

The amount of time spent on garbage collection depends not only on the efficiency of GC (which is down to Unity/Mono) but also on the amount of garbage that is produced, which is down to KSP. One factor causing more CG is is memory leaks, which we know KSP has.

Some quotes from the Unity forum on the issue if what they call "CG spikes":

If you see GC spikes its out of my experience to 90-95% due to one of 3 reasons:

1. OnGUI usage without proper event code and event consumption especially

2. heavy string usage with embedded strings in code, at worst tag comparision which is a fat no go for 'general usage'

3. Incorrect usage of arrays that get constantly replaced instead of following the "pow2" expand-shrink rules

http://forum.unity3d.com/threads/is-garbage-collection-in-unity-fixed.110992/#post-736549

I suspect CG spikes are simply less noticeable on PCs that are well over recommended spec.

Link to comment
Share on other sites

I suspect CG spikes are simply less noticeable on PCs that are well over recommended spec.

I have a higher end PC and I notice it all the time when building complex craft. I get half second freezes every so often which means leaving the VAB or restarting KSP. I haven't even dared to make a big space program with lots of flights simply because the game is so damn unstable and becomes unplayable.

Link to comment
Share on other sites

I am very glad to see this thread attracting so much attention and really communicating to the community that this problem exists and why it exists. I would still very much like a reaponse from the dev team on their progress with this issue. For the success of the game, this issue cannot be ignored or quieted away.

Link to comment
Share on other sites

OP, you may be interested in this post if you haven't already seen it:

http://forum.kerbalspaceprogram.com/content/345-KSP-and-Unity-5

A glimpse into what the dev's are working on, including talk of their work to migrate to Unity 5 (which has better physics multithreading)

"Better physics multithreading" is totally unrelated to this issue. This thread (and numerous others) is about the garbage collector related pauses that can occur at intervals anywhere from 60 seconds or more to as often as every second (but usually between 5 and 10 seconds). The length of the pauses can also vary from approx 80ms to 600+ms (and probably even longer for very large saves in very heavily modded installs).

The UI rewrite that is happening for Unity 5 may reduce the creation of garbage but there are various other parts of KSP (e.g. this) that can create a lot more garbage than the UI APIs do.

There is lots to do here and, given the Unity 5 update is likely to both create numerous new bugs and invalidate numerous existing ones, I would hope for a significant period of testing and bug fixing without any more new code being developed before it is released and that some of the more serious existing bugs also get addressed during this period.

Link to comment
Share on other sites

This is a foundation level problem, and you don't fix the foundation after you've installed all the fixtures! In agile/lean practices this is a "stop everything and focus on the problem" situation (you don't keep feeding raw materials into a broken machine on the factory line, you shut it down and fix it).

This. This x1000.

We know what the problem is, we know how the implementation needs to change to solve it. Unity updates and UI improvements are not the solution. They'll be good additions, and reduce other load on the GC, but they don't actually fix the problem at it's core. Squad needs to take a hard look at the game cycle processes and find the places where objects are being created/deleted on the fly and those actions need to be unified and objects should be collected in a resource pool.

There are lots of posts by other unity developers on places like stackoverflow talking about this same issue. All agree that unity's GC is limited, but they also all say that the limitation can be worked around with more careful asset management.

Yeah, I'm pretty confident that I know the cause... and the solution.

I'd be really surprised if Squad didn't know it too.

The real question is: Why hasn't it been fixed yet?

[rant]

I'm not Unitys customer, I'm Squads customer. And I'm not happy with the state of the product.

It's not up to us to complain to Unity, Squad made the decision to license that particular engine, Squad is responsible for the "finished" (yeah, right) product.

End-users hassle Squad, Squad hassles Unity. Same as any other industry.

If Unity cannot be moved, work around it - the methods are well documented.

There seems to be an awful lot of head-in-sand attitude here.

Guess why I'm whining on the forum: Because I can't play the frigging game with this rubbish performance and stuttering.

Enough. Stop. No more "features". Fix the damn foundations first.

[/rant]

I am very glad to see this thread attracting so much attention and really communicating to the community that this problem exists and why it exists. I would still very much like a reaponse from the dev team on their progress with this issue. For the success of the game, this issue cannot be ignored or quieted away.

A response from the team is all I'm after at this point also. It will not be ignored, and neither will this glaring issue.

As Padishar rightly points out, there are areas of Squads code that create huge amounts of garbage thrash, I suspect this particular example is just the tip of the iceberg.

So, again I ask: Any news on a code-cleanup and optimisation to address this?

I'd really like to get to playing the game, without all the frustration this brings.

I'd love to do some profiling, to attempt to find the worst offenders and contribute to a solution. But I don't have the source, or the tools. Squad does.

Edited by steve_v
Link to comment
Share on other sites

I ask again for the dev team to officially comment on this problem. Continuing to blame Unity as the cause of the issue is no longer a legitimate excuse, no is it professional for a game developer to blame the engine they chose for bugs present in their game.

Link to comment
Share on other sites

I ask again for the dev team to officially comment on this problem. Continuing to blame Unity as the cause of the issue is no longer a legitimate excuse, no is it professional for a game developer to blame the engine they chose for bugs present in their game.

Perhaps you should PM one of the devs about this issue if you want an official comment. Chances are that they will not just stumble upon this thread, and your request for one.

Link to comment
Share on other sites

This just isn't the time, I wouldn't expect a dev reply at this stage of the cycle, they are still rewriting major sections of the game code for v1.1, it's not even a playable game for them, yet. As I wrote a few posts back, they're aware the problem happens, and performance optimization comes toward the end of the cycle.

Link to comment
Share on other sites

This just isn't the time, I wouldn't expect a dev reply at this stage of the cycle, they are still rewriting major sections of the game code for v1.1, it's not even a playable game for them, yet. As I wrote a few posts back, they're aware the problem happens, and performance optimization comes toward the end of the cycle.

I understand what you are saying and you are right, however, the point i was trying to make a few pages back was that 1.1 is not the time to make these fixes or changes. The time for that was between 0.9 and 1.0. Therein lies the problen, and that is where I take issue.

Link to comment
Share on other sites

Perhaps you should PM one of the devs about this issue if you want an official comment. Chances are that they will not just stumble upon this thread, and your request for one.

You'd think that the "Suggestions and Development" sub-forum would be the one place the development team would look.

Link to comment
Share on other sites

I understand what you are saying and you are right, however, the point i was trying to make a few pages back was that 1.1 is not the time to make these fixes or changes. The time for that was between 0.9 and 1.0. Therein lies the problen, and that is where I take issue.

So you're arguing this retroactively, KSP is at 1.0.4 now and 1.1 is on the way, the argument that any specific work should have occurred between 0.90 and 1.0 is moot, the horse is glue and no one gains anything by continuing to beat the glue pot with a stick hoping it'll get up and gallop again.

If you really want to see a resolution to this then you can try helping Squad directly, and apply to the Experimental team, where your experiences and system specifications can be made available during the time where Squad is working on game issues.

Link to comment
Share on other sites

I have never seen a stuttering issue with this game from anything other than the mod Contract Configurator. My system setup is fairly close to what you posted except I am running the 64bit client, and I currently have about 45(ish) mods installed including all the EVE clouds and other texture goodies. And I have I guess around 30-40 crafts in flight currently, not counting debris/flags. So it seems that this is not an easily reproduced issue that doesn't affect everyone, and to further complicate matters, the problem most likely resides in code they don't have control over.

As others have said, they have made many posts that are already working towards moving this to unity 5, which is addressing the most likely source of the issue which is the game engine. So a little patience and sometimes a little investigation can help. I've had issues in the past where a game would come to a crawl if I had Winamp on because they were fighting over directsound. Changing the output to windows sound solved it. And another, windows indexing service wasn't playing well with another game and grinding it to a halt, so I had to modify the service settings.

Edit: What Sal_Vager just said.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...