Hacker News new | ask | show | jobs
by ogsharkman 3779 days ago
Yeah, especially when you consider Carmack basically volunteered to rewrite Minecraft in C++ for Microsoft (and VR use). I'm not a game developer so I have no idea if C++ is as widespread as it seems but to me that's a pretty big indication.
2 comments

The rewrite had already taken place (the pocket version of Minecraft). He "just" tweaked the graphics pipeline to minimize latency using techniques such as asynchronous timewarp, optimize framerate and add the other VR related stuff.
Ah, I see. Thanks!
I spent some time going through tutorials for different game engines, UE, Unity, Chaos and researching others, it became pretty clear that C++ the most pervasive and valuable across them, which is probably obvious to some of the more involved players in that space.
I think it's become something of a chicken and egg problem. All the hard-core game developers moved up from assembly to C, then introduced bits of C++ in the late 90s. All the books and tutorials end up getting written in C++ (or C with classes...). APIs get written in C/C++. More people learn C++ because its what the game devs do, and it's harder to find resources on learning how to do it in any other language. It's usually possible to make a wrapper for C++ code in a managed language, but it's not easy, if somebody else hasn't made a good binding already.

Garbage-collection has a bad name for some reason in game-dev circles, which maybe makes sense if you're developing a fast-twitch action game or shooter - a GC pause might drop enough frames to matter there, but for most games, Java or C# should be fine.

The console manufacturers have typically provided a C/C++ compiler and nothing else, so it was very difficult in the past to use any other language for developing console games. Some studios did retarget existing compilers like gcc but it was pretty rare; you don't usually have the time for that! If you're doing cross-platform that then limits your code base, so you can't even use the latest features of a language on one platform but not another (e.g. some platforms don't support C++11 in their compiler).
"if you're developing a fast-twitch action game or shooter - a GC pause might drop enough frames to matter there, but for most games, Java or C# should be fine."

Are most games adventure, puzzle solving, or turn-based?

or otherwise not dependent on single-frame precision, yeah.

certainly "fast-twitch action games" and "fast twitch shooters" are a minority of all games.

Action games may be the minority of all games developed, maybe. They're definitely the most desired and most market viable. It's easier to write a turn based game in garbage collected language. There's a surplus of these games, so they don't even sell well.

The best selling console games are sports simulators and first person shooters. The next popular are open world RPG/action (Skyrim, Fallout), then we have fighting and racing games. 2.5D platformsrs are also popular now. All of these games need the deterministic guarantees of "fast twitched action games".

It's not so much performance as much as control. Objective-C is a lot slower than C++, but making action games in pure Objective-C is viable because you are still in control of a system that allows for deterministic resource cleanup and stable frame rate.

In the US, I'd say turn based RPGs and puzzle games are by far the least popular genre on consoles across the board. They may be most widely produced games, they are hardly the most widely consumed ( outside of Mobile).

> Action games may be the minority of all games developed, maybe

I specified "fast twitch action", not just action. For instance, both of the open-world action games you mentioned are single-player only, so issues like lag and slowdown are less critical. Also, enemies in those games are almost always slow-moving- definitely no fast-twitch required.

For fast twitch action (not shooter), I might include things like street fighter, where button timing and reflexes are critical. Most 2.5d platformers I've seen would not suffer that much for the occasional dozen-millisecond GC pause. In fact, many of them have worse pauses than that for less prosaic reasons. ;-)

Well, yes, the idea that there will be GC pauses and you just cannot get a _consistent_ framerate no matter how hard you try does not sound good. (Disclaimer I currently write games with Unity ;D)