3 ms·
GC doesn't kill constraints for games. Unity3D games have been dealing with the GC for ages now, it's not that bad. Cautious use of memory allocations and calli
by BoorishBears 10y ago
GC doesn't kill constraints for games. Unity3D games have been dealing with the GC for ages now, it's not that bad. Cautious use of memory allocations and calling the GC at convenient times go a long way. But on the other hand Java doesn't have value types, which is pretty terrible.
- Thaxll 10y agoYes it kills it, there is no big AAA game running on Unity, try to do a Battlefield like game with a GC language where every ms count.
- BoorishBears 10y agoThat's actually exactly my point, "kills real time constraints" is very strong language, you end up having to look at AAA games the size of Battlefield to see where it falls short. Minecraft-like games with similar voxel rendering can, and have been, done in Unity. In fact on the internal Nintendo Wii U dev forums I recall a Minecraft-clone was deep in development in Unity, but I think a lack of demand on the platform killed it
- ferongr 10y agoA "demo" (with all the limitations and corner-cutting that demos usually employ) is one thing, a complete product is a different beast.
- vvanders 10y ago> Cautious use of memory allocations... I believe you're arguing against a GC there.
- glenneroo 10y agoI can only speak for Kerbal Space Program, but Unity 5's GC causes stutters on many people's systems, regardless how much RAM is available. There is a wonderful plugin called MemGraph[0] which lets you view GC events and more importantly, to change the time and frequency of GC activation, which has almost completely alleviated stuttering on many systems (my own included). [0]http://forum.kerbalspaceprogram.com/index.php?/topic/139128-12x-memgraph-1103-with-stutter-reduction/ http://forum.kerbalspaceprogram.com/index.php?/topic/139128-...
- BoorishBears 10y agoWorking with the GC is definitely tricky, but I think it's a feature that works well for the majority of the games made with Unity and really only rears it's head in specific types of games of a specific size. Saying it kills realtime constraints for gaming is definitely a stretch. Open world games with no transitions for example, leave little room for natural GC calls, where as level based games can do things like call the GC at the start of each level and carefully budget allocations through out the level.
- ferongr 10y agoThe "majority" of games made in Unity are very constrained mechanically and developers have control over the complete experience.
- deleted 10y ago[deleted]
- webkike 10y ago"not that bad" is still something that "I don't want to deal with" when I'm making a game. Get rid of GC pauses and let me allocate memory.
- BoorishBears 10y agoIt's great that works for you, and there's plenty of ways to take that approach outside of Unity. Like anything technology there are trade offs, having a GC while minimizing allocations can save a lot of time and effort upfront. I see it as Python vs Java, or NoSQL vs SQL, or a host of other similar comparisons that rage on in programming.