4 ms·
Unity's actually great... the problem is anyone can use it.
by omg_ketchup 9y ago
Unity's actually great... the problem is anyone can use it.
- TylerE 9y agoUnity's great for small indie games. Complex simulations don't mix well with mandatory GC. Microstutters suck.
- jimmaswell 9y agoIt's not that hard to work with the GC in Unity to make the game smooth, especially if you do so from the beginning. https://unity3d.com/learn/tutorials/topics/performance-optimization/optimizing-garbage-collection-unity-games https://unity3d.com/learn/tutorials/topics/performance-optim...
- TylerE 9y agoHow come no ones seem to do it then, or not do it well enough? Cities:Skylines has the same GC stutters.
- bananaboy 9y agoIt's easy to fall into the trap of doing things the simple way or the unity way. To avoid it you have to go out of your way a bit and apply the same rigour as if you were writing your own engine.
- jimmaswell 9y agoNot making heap allocations in loops/Update and favoring object reuse really isn't comparable to writing your own engine.
- bananaboy 9y agoI didn't say it was. I'm just saying that you can't allocate and instantiate all over the shop just because it's a GC language.
- jimmaswell 9y agoI've never encountered a stuttering issue in any Unity game I've played.
- prewett 9y agoFor a game engine, smooth performance is pretty much required. If you have to a) know that you have to worry about GC stutters (which beginners are unlikely to), and b) proactively do something about it, that seems like a major failing of a game engine. If I use a game engine, it's because I want to work on the game and avoid having to do things like manage the GC. Besides, GC is one of those things that is classically unsuitable for real-time use cases, and games are exactly a real-time use case. So you could argue that Unity choosing a GC language was a predictably a bad decision. Again, I don't use a game engine because I want to put up with bad decisions.
- jimmaswell 9y agoAll of the extra convenience and features afforded by using .NET are more than worth having to do a few simple things not to make the GC trigger at the wrong times. A game written by a beginner in any engine is going to have classes of errors that make it harder to keep using the same codebase over time. Compare the few simple suggestions (many of which like object reuse apply to C++ as well) in the article to the huge list of things not to do in C++.
- glenneroo 9y agoIf you're playing KSP, you can tame the stuttering with the MemGraph[0] mod. I don't know about other Unity-based games (nor do I even know of any other games that suffer from the issue). Also in my case they weren't microstutters, rather ~1-3 second pauses. [0]http://forum.kerbalspaceprogram.com/index.php?/topic/139128-12x-memgraph-1103-with-stutter-reduction/ http://forum.kerbalspaceprogram.com/index.php?/topic/139128-...