Why C++ for Unreal 4?

[=Gigantoad;105008]
UE4 already supports real version control. I use Perforce, so does Epic. Blueprints have visual diffing already. Granted, I work alone currently so I don’t know how much of hassle it is in a team. Seems to work for Epic though. Maybe it’s not even necessary that several people work on the same blueprint? Certainly not simultaneously?
[/]

Well, that’s not really a satisfactory answer, now is it…
Perforce is not free (as opposed to Git/Mercurial/SVN etc.), and is not exactly a common tool for version-controlling scripts…

[]
Well, they are adding scripting support right? You know, actually I’m not even sure why we’re still taking about it :slight_smile:
[/]

Well, afaik, what Epic is currently doing is facilitating the infrastructure for implementing external-language bindings - they are just using LUA currently as an example so they have something to work against, and since it’s one of the easiest ones out there to integrate into C++ runtimes.
To extrapolate from that to say that they are implementing/plan-to-implement any other language would be erroneous (at least at this point in time).
And again, this thread is not just a shout-out for Epic, it is mainly about swaying -opinion about the UE4 user-base in that direction, opposing the notion that having JUST C++ source-access is enough.

[]
On your second point, you’ll just have to explain why you would port from blueprint to scripting. What’s the benefit? I think it would be more likely an either/or situation, because if you do end up porting blueprint to code it would be performance-critical stuff. Some door firing an event one time when the player gets close to it would hardly be worth it to port at all. If you’re doing per tick heavy math stuff you may want to port it, but would anyone really then port it to LUA or C# instead of C++? It doesn’t seem to make much sense.
[/]

The way I see it, Blueprints are not a programmer-tool, mainly - their main target (and Epic has stated that on many occasions) is artists, game-designers, generally people that are less heavily-technically-inclined. Given that, and given that Blueprints would probably never get the level of expressiveness as mainstream scripting languages have, it is safe to bet that he Blueprint-code that is generates would more-often-then-not be better treated as not-much-more than a “prototype”, a “proof-of-concept” by some designer/artist. That is also a perspective that has been publicly expressed by Epic personnel on many occasions.
The blueprints that would end-up being generated might end-up being much more convoluted to decipher then what an experienced-programmer would be able to express in code. Moreover, once there is scripting-support, much logic will already be developed by programmers in a scripting-language, and it should be more convenient for them to translate blueprints into their native-languages, if nothing else for re-use and extensiblity, bypassing any inter-op layer between a compiled-blueprint and a written script.
Plus, as noted before, scripts would probably be still faster then compiled blueprints in many cases, and though that may not be an issue a lot of the time, and while C++ would be even faster still, the script-version would be a sweet-spot that gives a nice performance-boost that would probably be sufficient for most cases. Heavy math stuff, yeah, those would probably be most fitted to be coded in C++, but those would be few and far between. This is scripting-optimization land, as is already being done in scripting-environments for many years now.
Case-in-point: C-Extension variation of the “simplejson” package in python (for decoding/encoding formatted text), as an alternative to the default pure-python one (measurable performance-boost - believe me, I’ve checked it extensively). What percentage of a code-base is -decoding/encoding represents in this case? That depends, but if that is “the main” bottleneck in your code-base (given your properly profiled your execution, and are not just “following your gut” which be wrong in most-cases), then once you solve it, the rest would be futile to convert to C++ (there is a point-of-diminishing-return on that performance-graph…)
So, say you have a function in your code-base that is doing ray-trace/ray-cast computation implemented within a complex algorithm. You probably wouldn’t even prototype that using blueprints, and start-off having a script-function. Later, this function gets more and more used, on many occasions in your script-code-base, and it becomes noticeable at run-time. You THEN convert just this function into C++ using UE4’s extensibility-classes, and have direct-access to it from your scripts. You just re-factor them all to use that variation instead of the scripted one you wrote initially, and voila - you are benefiting from both worlds, and had solved your bottleneck - with just a minimal use of C++, just where it’s appropriate.
This is what is called “Hybrid/Heterogeneous Development”, and often provide the best trade-offs all around.

Perforce is free for up to 20 users. Also we were talking about blueprints not scripts. I don’t know how well it works for code, never used it for that. If you do have code then you can just use whatever you like anyway.

As for your other points, I think we’re just repeating ourselves at this point. Let’s hope that scripting support will come and allow people like you apparently unhappy with the current situation to work with UE4 and have fun. Instead of waiting until that days comes though, maybe you could just start using the engine now, play with the many features it does have, and who knows, when scripting arrives in the future you won’t need it as much as you initially thought.

Off in the weeds much? What codebase is not “compatible” with revision control of any flavor? That has to be the weirdest thing I’ve ever read…

[=timconwell;103713]
I think this is important for many to understand, one can find complaints about this on other frameworks going back some time. For Epic’s sake, sometimes feel as if this particular issue is directed wrongly at them. Otherwise…

Seems like there are plenty of arguments to go around no matter which side you prefer. I have my preference and it’s not C++, but what’s the point of complaining if we are using UE4? It’s not like programming games is easy in any language. If those here are looking to build in UE4, then C++ is what you have and blueprints which IMHO are about as innovative and advanced as it gets. There was some talk from some developers about adding more language interfaces, I’d recommend finding those threads for those who are interested to lend support and suggestions since the debate over languages will never be settled. In an effort to be neutral on the subject, there are probably better outlets in helping to add new features than an attempt to change another’s opinion.

Could be that this thread may have a happier home under General? Maybe it’s more fitting in this group, but this is a topic that generates more anger than being informative.
[/]

Thank you!!

[=VegasRich;106619]
Off in the weeds much? What codebase is not “compatible” with revision control of any flavor? That has to be the weirdest thing I’ve ever read…
[/]

Revision control usually doesn’t work well with binary files. If blueprint files are binary, then a special tool of some kind is necessary to diff them and merge changes properly.

(Disclaimer: I don’t know what blueprint files are like nor if such a tool exists)

[=Sharpfish;15345]
I’m glad they haven’t layered on any other kind of ‘scripting’ - C++ is where it’s at and my years of learning that won’t go to waste. C++ is fast, and direct access to the source code is a dream come true for coders. Learning C++ was also rewarding (though I should point out I’m now rusty with it and I still had much to learn on more advanced topics even back 10 years ago when I wrote my own simple D3D8 engine before I tacked my own game engine onto Irrlicht).

P.S I hate Javascript and C# doesn’t do much for me either. I went from ‘BASIC’ (on the Amiga) to C++ (didn’t even know ‘C’ before starting) and it wasn’t too bad in the end. I figured if I’m going to spend years learning something I may as well shoot for the top of the tree (no, not assembly or machine code lol). With C++ I felt there was literally nothing I couldn’t create, on a technical level, and knowing it was may more likely to run my code at far faster speeds than higher level languages was a massive incentive to roll my sleeves up and dig in. I became addicted to learning C++ as geeky as that may sound, I never felt that way about the other languages I’ve since dabbled with (which if anything I find frustrating for all their hand holding and so called ease of use)
[/]

I have written in so many languages over the 8 years of my programming career. C#, Java, PHP, JavaScript… C++ is by far the most expressive language especially with strap-ons (try not to laugh) like Boost or even just C++11’s additional functionality with brings it into the modern age.

C# is definitely my second choice in terms of elegance and modern features. The C# plugins from the booming community also rock and its tight integration with vs is beautiful.

I cannot agree more… C++ should by no means be considered an underdog at any point. It is overwhelmingly simple to understand, robust, fast, reliable!!!.. and gives you so much freedom.

I am also very glad that they are not packing on c# wrappers and abstracting stuff to within an inch of its life. It is genuinely important that coders get as much control as they can with as little learning overhead as possible… I would imagine that this is even more important in huge applications like games.

I think the main reason for C++ in UE4 is simple, it gives unrestricted access. If you want a feature, it is just on your resources and skill to implement it. With most engines, if you want a feature not explicitly thought of you either had to buy a Source Code license or were SOL.

One of the biggest complaints I heard about UE3 and previous versions was UnrealScript. While personally I liked it, companies hated it. The reason was it made for a very small pool of people to hire from that had experience in it and I watched most programmers just fight it and complain. By the time they had learned UnrealScript well enough to use it they had allready designed and implemented the main architecture for the game and there was no turning back to redo it. Now, companies can just hire C++ programmers. Much wider pool to find engineers with experience.

[=Gigantoad;104507]

Are you not the least bit excited about being able to develop and debug right in the engine source code?
[/]

Not really no, if I wanted to learn an engines source code I’d make my own engine instead of trying to reverse engineer other peoples work. Also the reason why I really don’t care is I use engines to speed up game development, the game is what’s important not what you use to get there.

I’m not really fussed what language people use to make games, if C# is quicker from a development speed angle that’s what I’ll use. If my team is more familiar with C++ that’s what I use, in terms of speed the only thing I care about is the game meets latency requirements to run at a decent speed across the board. C# could be 50X slower for all I care, if my game is performs within boundaries for console and minimum PC specs than it’s good enough for me.

It’s all about the end goal and a language is a means to an end.

[=;107524]
Not really no, if I wanted to learn an engines source code I’d make my own engine instead of trying to reverse engineer other peoples work. Also the reason why I really don’t care is I use engines to speed up game development, the game is what’s important not what you use to get there.

[/]

My main point was that you can debug stepping through the engine source code, providing a better understanding of why something in your own code may not behave as expected.

[=;107524]

I’m not really fussed what language people use to make games, if C# is quicker from a development speed angle that’s what I’ll use. If my team is more familiar with C++ that’s what I use, in terms of speed the only thing I care about is the game meets latency requirements to run at a decent speed across the board. C# could be 50X slower for all I care, if my game is performs within boundaries for console and minimum PC specs than it’s good enough for me.

It’s all about the end goal and a language is a means to an end.
[/]

That’s certainly true and if you’re that pragmatic, you may end up choosing Unity in case C# is so important.

[=Gigantoad;107573]
My main point was that you can debug stepping through the engine source code, providing a better understanding of why something in your own code may not behave as expected.

That’s certainly true and if you’re that pragmatic, you may end up choosing Unity in case C# is so important.
[/]

You could do, but you may be missing out on important tools and feature sets that Unity doesn’t have. I wouldn’t shy away from C++ just because it’s C++, it might be a little scary to some but I hope as a community we can give them a helping hand.

[=jimmyt1988;107437]
It is overwhelmingly simple to understand
[/]

The book Exceptional C++ very quickly disabused me of the notion that C++ is simple to understand. If that doesn’t do it, a peek at Boost’s source code will.

[=furrykef;108264]
The book Exceptional C++ very quickly disabused me of the notion that C++ is simple to understand. If that doesn’t do it, a peek at Boost’s source code will.
[/]

C++ the language is very logical, is very strong typed so its API is exceptionally inferable compared to… PHP or javascript for example. It has enough choice to shake a stick at which also makes it often easy to work with. I’m not saying the C# isn’t the same… It really is, it’s exceptional… but C++ is going to obviously be the language choice because you retain all of that lower level functionality.

This is what I mean by overwhelmingly simple… Just in comparison to other languages that sometimes have too much give in them to be inferable enough to take guesses and those guesses work.

[]
Revision control usually doesn’t work well with binary files. If blueprint files are binary, then a special tool of some kind is necessary to diff them and merge changes properly.
[/]

Yeah, yeah, you can’t diff binary files meaningfully or merge them, but you can still keep historical versions. Since I have actually used Git, Subversion, StarTeam, and CVS in commercial production environments I can tell you that even this rudimentary functionality is a life-saver. Just being able to easily revert back to a working version is helpful. If you need some sort of actual binary merge/diff tool then I’d recommend an add-on/plug-in anyway - how is any VCS supposed to deal with every possible binary data format on the planet?

very nice!

I am finishing-up some pluralsight courses nowadays, and also going through Channel-9’s in-depth lectures about C++, by STL (the person, not the library…)
I ended-up reading through his detailed blog-posts which are also outstanding - I just spent the entire day going through the second in a 3-part blog-post about C++11 features (from when it was still called C++0x). I can comfortably say that I eventually managed to fully comprehend roughly 90% of it, and I consider that a personal-achievement. But I think the comment below the post speaks volumes…

Here is the video that led me to read all this (it has links to all 3 parts below):
http://channel9.msdn.com/Shows/Going+Deep/VC-10-Stephan-T-Lavavej-and-Damien-Watkins-Inside-STL

In any case, C++ 11 is ultra cool and all, but a lot of it is “anything-but” simple…
While some features simplify code and semantics (such-as: auto, range-for, smart-pointers, initializer-lists, variadic-templates, perfect-forwarding), others just add much more complexity by “leaking-out” compiler-logic onto developer-space (like RValue/LValue explicitness/conversion, move-semantics, ‘explicit’/‘implicit’, ‘override/final’, ‘= delete’/‘=default’, Lambda-capturing-semantics). These last ones are really mainly for library-writers, and while they do add even more expressive-power, you still have to learn them even if you don’t write libraries, because now that they’re in, you are going to encounter them, so you have to at least know what they mean and how they are used - and this adds to your list of things to learn, some of them necessitates going way too deep (for most developers) into compiler-land/standardese. So, in some senses C++11 becomes less-intimidating, but then in many others it becomes even more so…

Many common C++ pitfalls that even professional coders will make and that most compiles won’t tell them about (some C++1 ones):
http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Clang-Defending-C-from-Murphy-s-Million-Monkeys

Ans some more C++1 ones here (some really scary ones…):
http://channel9.msdn.com/Events/GoingNative/2013/The-Care-and-Feeding-of-C-s-Dragons

[]
^^ Blizzard used Unity for Hearthstone. Is that game considered AAA or not? I dunno. Regardless, it would be rather strange to claim C# will not be used in AAA games when it is already being heavily utilized in several titles
[/]

Did they really use Unity for that? That would be surprising. Why bother with the full 3D engine for something so 2D?

And yeah, I’d say that it is indeed AAA. Lack of ultra realistic graphics doesn’t cause a game to not be AAA. Mostly “AAA” means its a professional game that hits the major platforms, has high implementation quality, and is part of the “core gaming” community in some sense.

[=;114056]
Did they really use Unity for that? That would be surprising. Why bother with the full 3D engine for something so 2D?
[/]

What would you use instead?

[=;114056]
Did they really use Unity for that? That would be surprising. Why bother with the full 3D engine for something so 2D?

And yeah, I’d say that it is indeed AAA. Lack of ultra realistic graphics doesn’t cause a game to not be AAA. Mostly “AAA” means its a professional game that hits the major platforms, has high implementation quality, and is part of the “core gaming” community in some sense.
[/]

Because Unity, like Unreal, is more than just the 3D renderer. It’s a framework you use to build games, and in the case of Hearthstone, the ease with which games can be implemented and deployed across multiple platforms makes it a very good choice indeed.

[=;114056]
Did they really use Unity for that? That would be surprising. Why bother with the full 3D engine for something so 2D?

And yeah, I’d say that it is indeed AAA. Lack of ultra realistic graphics doesn’t cause a game to not be AAA. Mostly “AAA” means its a professional game that hits the major platforms, has high implementation quality, and is part of the “core gaming” community in some sense.
[/]

I always thought AAA was defined by how much budget it was assigned. Seems it wasn’t like that originally.