5 ms·
Doing game dev and digital content creation in anything but C++ and some python is simply a fool's errand. Any decent software in this area needs to use librari
by gmueckl 8y ago
Doing game dev and digital content creation in anything but C++ and some python is simply a fool's errand. Any decent software in this area needs to use libraries written in C++ to have even a remote chance of being successful. These libraries are often written in ways that makes wrapping them for other languages impossible or at least force the exclusion of some desirable features in the bindings.
In other words, C++ is utterly entrenched in that space like Fortran is for HPC.
- est31 8y agoUnity, one of the most popular engines out there, is mainly about C# for the gamedevs.
- gmueckl 8y agoAnd it is a special snowflake because of that. Unity needs to pour a ton of resources into this to make it viable and competitive. IL2CPP and the Burst compiler are proof. A company with fewer resources would have to give up on this approach.
- jayd16 8y agoMono runs fine. IL2CPP is more of a work around to get AOT on iOS and Burst is just a nice linter but you could write the same tight loops now and mostly likely get very close. Plus, Burst isn't even out so its odd to bring it up as necessary.
- gmueckl 8y agoUnity makes it very clear in their blog posts that Burst is a special vectorizing compiler. It is not a linter at all. I am not sure where you got that notion. IL2CPP was required to be able to stick with C# and stay relevant for mobile gaming. They forced themselves into this corner by wanting to stay with C# and become relevant for mobile gaming. Compare all this to Unreal. By sticking to C++, they do not have to commit the same amount of resources to programming language related tooling.
- pjmlp 8y agoActually they do, because Blueprints need to support graphical debugging and profiling as well. Some studios don't want to mess that much with Unreal's C++. Then Unreal has their own C++ runtime to allow for a tracing GC.
- gmueckl 8y agoStill, Epic does not have to commit the same amount of resources. That is my point. The Unreal Build Tool and Unreal Header Tool do not come for free, but this is still less than two sets of optimizing compilers in my book.
- pjmlp 8y agoIL2CPP resuses the platform C++ compiler, and Burst builds up on LLVM. It is not like Unity is building their compilers from scratch. And the fact that the Insomiatic guys felt it was a good project speaks for it, given how they are respected in the gaming industry regarding engine optimization. Also some of this work influenced C# 7.x features.
- jayd16 8y agoBurst is basically an upgrade to Roslyn with some perf warnings set to errors. IL2CPP is literally required on iOS but the perf gain you get on Android was never very good. Because of its general instability, a lot of games just ship in mono mode. It's funny that you're saying both Burst and IL2CPP are required. Can't you see that Burst is an admission that IL2CPP wasn't the way to go?
- pjmlp 8y agoThe same was said about the game developers using Pascal and C instead of Assembly, followed by game developers using C++ instead of C. The industry always needs some pioniers willing to do the investment regardless of the naysayers.
- gmueckl 8y agoI am not a naysayer. I just point out the resource investment involved in going down a different path. Also, Unity is built on a lot of 3rd party C++ code. From the top of my head, this is at least Mono, FMOD, PhysX, Enlighten and FBX.
- pjmlp 8y agoSure, just like those C and C++ engines weren't re-writing the battle proven Assembly libraries unless required to do so.
- mewse 8y agoNote that the game industry avoided C++ for a long time because those early C++ compilers produced code which was very large and quite a lot slower than you'd get from C, so C++ was kind of a non-starter when you were writing code for the consoles of the day which had slow processors and only a few megabytes of RAM. You just couldn't afford the overheads of C++ or your competitors would eat your lunch. It wasn't about needing a pioneer to show us that we'd been wrong; we weren't wrong. C++ just wasn't ready for the particular set of requirements that games imposed, yet. Once the state of C++ compilers began dramatically improving in the late 90s (by the criteria of optimisation and executable sizes), most studios moved over to the language pretty quick. Or at least that was my experience.
- pjmlp 8y agoThe pioneers were the studios using Watcom C++ on MS-DOS, while others were still being dragged into Windows with plain old C, while complaining about losing hardware access until Wing was released. And the studios that were forced to adopt C++ when the PlayStation SDK required it. So nothing speaks against other languages getting over the same kind of acceptance issues.
- jayd16 8y agoThe first non Unity non Unreal game I thought of, Celeste, uses C# and XNA. Lots of games use other languages these days.
- gmueckl 8y agoXNA is dead. Microsoft officially recommends MonoGame instead. When a game seems to be written exclusively in a high level language like C# then there is almost always a massive framework underneath that integrates a lot of shiny C and C++ libraries for the real heavy lifting.
- pjmlp 8y agoTime travel 20 years back on some USENET forum. "When a game seems to be written exclusively in a high level language like C++ then there is almost always a massive framework underneath that integrates a lot of shiny C and Assembly libraries for the real heavy lifting." Time travel 30 years back on some BBS forum. "When a game seems to be written exclusively in a high level language like C or Pascal then there is almost always a massive framework underneath that integrates a lot of shiny Assembly libraries for the real heavy lifting."
- gmueckl 8y agoExcept that games back then were limited in code size by what could be stored in memory on the target systems. All the game code that I have seen from the 80s and early 90s came in well under 100kloc and library dependencies weren't a thing because of the same resource constraints. This changed over time and now almost any contemporary and technically decent game sits on top of several hundreds of thousands or millions of lines of 3rd party code.
- pjmlp 8y agoSure and that 3rd party code can be written in whatever language the library authors feel like using, it doesn't need to be necessarly C or C++.
- alfalfasprout 8y agoFWIW at least for a lot of major libraries in HPC now have C/C++ wrappers (eg; IMSL). But yeah, while it is possible to write rust wrappers for everything it's just not something you're going to do most of the time. Modern C++ is "good enough" where you'll potentially end up with some unsafe code but unless you're writing an SSL library it'll be OK.