Re:Show HN: Strife, a 2D game library for Go
by greysonp on Saturday September 29, 2018 @01:42PM
(#18101674)
No 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.
Re:Show HN: Strife, a 2D game library for Go
by andrewmcwatters on Saturday September 29, 2018 @03:54PM
(#18102430)
Interestingly 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.
Re:Show HN: Strife, a 2D game library for Go
by robmaister on Saturday September 29, 2018 @12:45PM
(#18101318)
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. 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
Re:Show HN: Strife, a 2D game library for Go
by coldtea on Saturday September 29, 2018 @01:28PM
(#18101599)
>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.
Re:Show HN: Strife, a 2D game library for Go
by kjeetgill on Saturday September 29, 2018 @12:55PM
(#18101399)
Unfamiliar 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#?
Re:Show HN: Strife, a 2D game library for Go
by pjmlp on Saturday September 29, 2018 @02:25PM
(#18101926)
.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.
Re:Show HN: Strife, a 2D game library for Go
by pjmlp on Saturday September 29, 2018 @02:20PM
(#18101913)
Just like it is a fight against malloc() if the game's architecture is not done properly.
Re:Show HN: Strife, a 2D game library for Go
by crowhack on Saturday September 29, 2018 @12:14PM
(#18101126)
Yeah 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.
Re:Show HN: Strife, a 2D game library for Go
by BoysenberryPi on Saturday September 29, 2018 @12:36PM
(#18101260)
Game 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.
Re:Show HN: Strife, a 2D game library for Go
by andrewmcwatters on Saturday September 29, 2018 @03:57PM
(#18102446)
Yep. 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.
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...