6 ms·
>? I'm generally curious because I figured Golang would be a no-go due to the GC... Huh? Tons of GC languages are used for games. Heck, web games use JS. Not t
by coldtea 8y ago
>? I'm generally curious because I figured Golang would be a no-go due to the GC...
Huh? Tons of GC languages are used for games. Heck, web games use JS. Not to mention the whole C#/Unity thing that even powers AAA games...
- crowhack 8y agoYeah that's true but I disagree it's a good idea. Most AAA shops still use non-GC languages because they need the full control/cannot waste ms on random GC pass.
- BoysenberryPi 8y agoGame dev here. Unless you are making GTA or some high fidelity 3D game. You are wasting your time using a language like C++. You are going to spend more time dealing with memory than actually making your game which is pointless in a 2D game.
- andrewmcwatters 8y agoYep. I'm always more curious about how I can get back milliseconds based on 2D rendering techniques and GPU-related concerns. I'm almost never thinking about memory consumption. It's always stunningly low, even for games doing a ton of things. You'd almost truly have to go out of your way to consume browser-levels of memory.
- pjmlp 8y agoIf they use Unreal, they are using C++ with GC.
- robmaister 8y agoOnce you get past a certain point of developing a complex game in Unity, one of the optimization techniques is to keep runtime allocations at 0 bytes in order to prevent a GC pause from ever happening. This was a huge pain back when Unity was on Mono 2.10.8 (released Dec 2011) but it's a bit better now. It's a fight against the GC typically
- kjeetgill 8y agoUnfamiliar with any game codebases or much C++, but I know in C we'd do zero-allocation or controlled arena allocation for "embedded" uses. I'd imagine Allocation tuning is always present. Was it much harder in C#?
- pjmlp 8y ago.NET has support for stack allocation and manual management of native memory. Many forget that MSIL is rich enough to support C++, initially via Managed C++, later replaced by C++/CLI. The major features in C# 7.3 are related to slices, improved stack allocation and reducing copies of value types.
- coldtea 8y ago>Once you get past a certain point of developing a complex game in Unity, one of the optimization techniques is to keep runtime allocations at 0 bytes in order to prevent a GC pause from ever happening. It is, but it's still an option. It's not like "language with GC" == no-go for games, as the parent implied.
- pjmlp 8y agoJust like it is a fight against malloc() if the game's architecture is not done properly.
- greysonp 8y agoNo idea why this is getting downvoted. You'll naturally need more control over memory when building AAA high-performance 3D games, but there's tons of great 2D games made with GC languages (see: Love2D, OpenFL, HaxeFlixel, ImpactJS, Unity). In a lot of 2D games, simple patterns like object pooling are more than enough to squash any GC problems. There's a whole spectrum of performance requirements out there -- no need to discount a framework due to it's language.
- andrewmcwatters 8y agoInterestingly enough, many times GC tricks like object pooling aren't even the first concern; it's usually proper utilization of GPU buffers and understanding pixel fill-rate more than anything. It's truly wonderful time for all programming languages in this space.
- deleted 8y ago[deleted]