Project

General

Profile

Bug #4051

game freeze at regular intervals

Added by rkman about 9 years ago. Updated almost 8 years ago.

Status:
Unity Bug
Severity:
Low
Assignee:
-
Category:
Gameplay
Target version:
-
Start date:
02/09/2015
% Done:

100%

Version:
Platform:
Win32
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

Interval ranging from some 5 to 15 seconds depending on current physics delta; with the game slowed down (ingame clock color other than green) the interval is longer. The freeze lasts for several 10's of ms to maybe a 100ms, and seems to become more severe the longer a game session lasts.

same as
Bug #530 Framedropping with sound crackling
http://bugs.kerbalspaceprogram.com/issues/530

Which is marked as resolved, but it is actually still an issue:

http://forum.kerbalspaceprogram.com/threads/106523-Slight-freeze-every-5-seconds-%28or-so%29

http://forum.kerbalspaceprogram.com/threads/108935-That-stutter-every-x-seconds

History

#1 Updated by Squelch over 8 years ago

  • Platform Win32 added
  • Platform deleted (Windows)

#2 Updated by sal_vager over 8 years ago

  • Status changed from New to Unity Bug
  • Severity changed from High to Low

This has been identified as Unity3D game engine issue, caused by the Mono garbage collection algorithm.

#3 Updated by Broco almost 8 years ago

sal_vager wrote:

This has been identified as Unity3D game engine issue, caused by the Mono garbage collection algorithm.

This bug is still present and got worse in 1.1.1 for me and many others. Yes, the freezes are triggered by Unity GC BUT there are ways to get around it as seen here:

https://www.pluralsight.com/blog/software-development/unity-tips-and-tricks
http://stackoverflow.com/questions/17481863/unity3d-optimize-garbage-collection
http://www.gamasutra.com/blogs/MeganHughes/20150727/249375/Unity_Garbage_Collection_Tips_and_Tricks.php

Basically you need to significantly reduce the amount of garbage created each frame by not instatiating and destroying objects but instead enable and disable them after instatiating them, avoid string concatenation and avoid GetComponents.
This bug needs to be addressed with higher priority since it affects a majority of players. Some think it's an issue with their settings or their computers but it's definitely not.

At the current state the game is unplayable for me, even in vanilla state the GC runs every ~5 seconds.

I know this one requires a lot of code rewriting but after 1.1.1 came out I think it's time to get rid of some lose ends, optimize the code base and create a good basis to movoe on before new features are implemented. Stability + performance > features.

You can't really say this is a unity issue. A friend of mine works with Unity too and says these problems are known to the Unity community and they describe ways to avoid it.

I really like you guys and love KSP, but don't try to hand this one over to Unity when it's evident that it can be avoided with proper coding.

#4 Updated by funkcanna almost 8 years ago

This issue MUST be fixed. I think it was more acceptable in pre 1.1.x days as there were all sorts of other issues caused by not having 64bit and this issue is exaggerated by mods, however now 64bit is here, its worse! A game that stutters every five seconds is unplayable and unprofessional.

Hire someone specifically to fix this issue so your "priority list" for employees is unaffected.

Also available in: Atom PDF