Live data from Hacker News

Why C++ for Unreal 4

forums.unrealengine.com

71–80 of 178 posts

Re: Why C++ for Unreal 4

#71
post #69
post #25

Earlier quoted context omitted.

Note that Unreal uses a C++ GC.

Totally different from C#:sa GC. The GC in unreal engine is used to know when what entity should be removed from the game. (If you have multiple entities pointing each other.) The memory allocation still works how it works in C++.

Well, since C++11, C++ also has a standard minimal GC API, although only VC++ supports it currently.

Thanks for the clarification, as I only knew there was a GC from gamedev articles, forums, without much details.

Re: Why C++ for Unreal 4

#72
post #68
post #65

Am I cynical? The recent changes in Unreal 4 make me think the company is in extremely serious trouble. It's because they aren't addressing the key reason people buy a graphics engine ( viz graphics), but all this ancilliary stuff. While it is important, it's off center... But maybe they are just trying to fend off Unity (open source, a more coherent experience). Usually when companies do this, it's too late. I've no…

Haha. Note how many games have come out using UE3, think about the royalties coming in. Also, right now they have just about the best game-engine, only hobbyists and some indies would choose Unity, mostly because its easier. UE4 will definitely get several high profile games soon from big AAA companies. I would say that Unity is in deep trouble right now :P

note that disruption comes from below, not from big AAA titles...

Re: Why C++ for Unreal 4

#73
post #72
post #68

Earlier quoted context omitted.

Haha. Note how many games have come out using UE3, think about the royalties coming in. Also, right now they have just about the best game-engine, only hobbyists and some indies would choose Unity, mostly because its easier. UE4 will definitely get several high profile games soon from big AAA companies. I would say that Unity is in deep trouble right now :P

note that disruption comes from below, not from big AAA titles...

note that 90% of the profit comes from big AAA titles, not from below.

... I get what you're saying, but I think the Unreal Engine is going to continue to be a cash cow for a good while yet.

Re: Why C++ for Unreal 4

#74
post #39

Earlier quoted context omitted.

They could also use C# instead of UnrealScript on top of C++. This way you would be able to leverage the Visual Studio while getting one of the best languages. It would make Unity3d guys welcome once they need something better as well. PS: I like the BluePrint though.

To second what scott_s said, you'd have a huge interop layer. The fact that C# has a closer match to C++ types and primitives doesn't mean you have no interop. Unity has a huge surface area between the C++ parts of the engine and the C# parts of the engine; a ton of work goes into maintaining that, and it complicates porting to new target platforms like the web (can't just feed everything through emscripten).

Yes, C# and other .NET languages are nice, but the open source implementation (Mono) ends up being difficult to port to novel platforms due to a combination of technical and legal issues.

Re: Why C++ for Unreal 4

#75
This was refreshing. I'm struggling with the same problem...I've embedded Lua in my C++ engine for high-level scripting. Unfortunately, as my scenes became more and more complex, I found myself struggling with representing the inheritance hierarchies in Lua, as well as things like object ownership/gc (resorting to passing around shared_ptrs in Lua userdatas). And for each new data type, I had to write the same old C++ boilerplate to make it available in Lua the way I needed to. The complexity is getting to be too much.

I think this article is going to push me to strip out the embedded Lua from the engine and use plain old C++ as well. Great read!

Re: Why C++ for Unreal 4

#76

Earlier quoted context omitted.

A safer language with higher-level, low-cost abstractions.

Honestly, I've made over 15 games in my career and safety with C++ really just isn't an issue with decent developers. The line between what's a programmer for games and what's a designer is narrowing, most designers are competent programmers. Furthermore, there's some great tools out there to help prevent things like memory leaks. Combine that with good company practice, like code reviews, and it becomes a non-issue.

> Furthermore, there's some great tools out there to help prevent things like memory leaks. Combine that with good company practice, like code reviews, and it becomes a non-issue.

The security track record of applications written in C++ disagrees with you.

Re: Why C++ for Unreal 4

#77
post #8

I developed two titles with the Unreal Engine and whilst initially UnrealScript seems like an advantage it very very quickly becomes problematic. My favorite being the dependency of the C++ code on the script and the script on the C++, so if you're not careful you can end up being completely unable to do a build. As much effort as they put into the IDE it would always play second fiddle to Visual Studio. When I left…

The modmakers don't suffer too dearly, blueprint can do almost anything a modmaker could want, and in the future perhaps we can drop the almost.

They didn't really drop the highlevel language, they just dropped the idea of a highlevel general purpose language, favouring a strict DSL.

There's still a bit of interop, but you have to be very explicit about it. In C++ you use macro's to tell the compiler what's accessible to blueprint, and to access blueprint from C++ you have to make weird queries that are very obviously highly dynamic and ill-performant.

So cool stuff all around :)

Re: Why C++ for Unreal 4

#78

Earlier quoted context omitted.

A safer language with higher-level, low-cost abstractions.

Honestly, I've made over 15 games in my career and safety with C++ really just isn't an issue with decent developers. The line between what's a programmer for games and what's a designer is narrowing, most designers are competent programmers. Furthermore, there's some great tools out there to help prevent things like memory leaks. Combine that with good company practice, like code reviews, and it becomes a non-issue.

I guess, then, that you weren't part of the Battlefield 4 team [1]. I've discussed the issue of the "no decent programmer" fallacy in the past; yes, in theory if programmers were careful and alert, they could create flawless software, yet this never happens in practice because humans are prone to errors (i.e. not understanding a subtlety of the language or library, thinking that a validation is done at a different level of abstraction, failing to imagine what could be an error scenario and how it could occur, etc.). Languages like Rust offer the same capabilities as C or C++, while eliminating entire classes of bug sources.

[1] http://en.wikipedia.org/wiki/Battlefield_4#Technical_issues_...

Re: Why C++ for Unreal 4

#79
We've also been there done that (about 10 years ago though), we had a very powerful scripting approach integrated into our game engine which gave direct access to game play systems in order to let our level and game designers build scripted behaviour into the game. In the end we ended up with a terribly huge mess of script code (I think it was about a third of the actual C/C++ code) and the majority of the per-frame performance-budget was lost somewhere in this scripted mess. The game sometimes suddencly crawled to a halt when some crazy scripting construct was called, and we had a lot of trouble getting stuff into a shippable state until the gold-master milestone (this is the game: http://www.metacritic.com/game/pc/project-nomads).

The main problem with scripting layers is that you are basically handing programming tasks over to team members who's job is not to solve programming tasks, and thus getting a lot of beginner's code quality and performance problems which are almost impossible to debug and profile (unless you have a few top-notch coders in the game- and level-design teams).

And then there will be definitely those "creative workarounds" to get something done which neither the engine nor the scripting layer was designed for, which make entertaining horror stories the programmers tell the new hires when they inevitable ask why your engine doesn't have scripting ;)

A better approach is to give the level designers simple, pre-programmed, combinable high-level building blocks (AI behaviours, actions, triggers, etc), and let them customize a level (as in game area) with this. But never build the entire game logic with such an approach! With this, stuff can still be fucked up, but at least the performance-sensitive stuff can be implemented by the programming team, and it's much easier to debug and maintain.

[edit: typos]

Re: Why C++ for Unreal 4

#80
post #73
post #72

Earlier quoted context omitted.

note that disruption comes from below, not from big AAA titles...

note that 90% of the profit comes from big AAA titles, not from below. ... I get what you're saying, but I think the Unreal Engine is going to continue to be a cash cow for a good while yet.

Digital had bumper profits just before they went under - it's typical, as they go upmarket, to get greater profits. But I'll accept that you get what I'm saying. :)

Another data point: id was killing it (and, to us, Carmack remains undisputed). But they completely lost out the next generation, to Unreal, because of vehicles. I don't think that'll happen here, just disclaimin' past performance is no guarantee of future success.

Though, to be fair, the Quake engine underlied Call of Duty, the most successful franchise (I believe), and it really showed in the framerate. Note: no vehicles. And yes, past tense.

Post reply on HN