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…
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.
Why C++ for Unreal 4
61–70 of 178 posts
Re: Why C++ for Unreal 4
#62It will be interesting if any major game engines pop up using Rust as the core language, or even Go. C++ has been the king of highly optimised game engines for so long, I can't help but feel it has become so entrenched in the industry that it will take something monumental to disrupt it.
Re: Why C++ for Unreal 4
#63It will be interesting if any major game engines pop up using Rust as the core language, or even Go. C++ has been the king of highly optimised game engines for so long, I can't help but feel it has become so entrenched in the industry that it will take something monumental to disrupt it.
What's the appeal of Rust for gamedev?
Re: Why C++ for Unreal 4
#64Maybe UnrealScript was just too damn complex. Having not used it, and just Googled it, my first reaction was "this looks just like C++ anyway". What's language features are there specificity catered for games? It doesn't seem very DSLy
Ultimately it was confusing at first. Besides the official docs I had to look at their script source and old UT2 tutorials to figure it out.
I haven't seen the new engine, but I imagine simply doing a net.replicate(&player_info) would have been more straight forward than dealing with all of the unrealscript language constructs for it.
Re: Why C++ for Unreal 4
#65But 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 idea if that's the case here.
Re: Why C++ for Unreal 4
#66Earlier quoted context omitted.
What's the appeal of Rust for gamedev?
A safer language with higher-level, low-cost abstractions.
Re: Why C++ for Unreal 4
#67It's important to note that what is being talked about in this post is not, "why we wrote the Unreal engine in C++", because it already was in C++. Many games, older Unreals included, had a separation between "code" and "scripting", where stuff like animations, weapon firing, etc. was written in scripts, in the belief that this would be easier to update as required vs. C or C++ code. Doom 3 and previous Unreal engine…
But maybe the UnrealScript wasn't simple enough in practice to do that?
Or perhaps, giving people a template function, and a few functions, is just as easy/hard as a separate scripting language.
Generally, scripting languages are a really great idea: consider all the bash scripts in unix. An imperfect mismatch with the underlying language, yes; but worth it.
Re: Why C++ for Unreal 4
#68Am 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…
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
Re: Why C++ for Unreal 4
#69Earlier quoted context omitted.
Exactly. What's most distressing is people (as normal) are completely ignoring the garbage collection overhead, which is mostly where the advantage of having complete control is, in terms of micro-managing your memory allocation, e.g. using slab allocators, memory pools, pre-allocation, etc. C# code in theory (ignoring things like intrinsics support and inline asm) can be as fast as C++ for tight loops, but in my exp…
Note that Unreal uses a C++ 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++.
Re: Why C++ for Unreal 4
#70Earlier quoted context omitted.
The LuaJIT interpreter is surprisingly fast. Still not as fast as the JIT or an AOT compiled language though...
His point though is that JITs (like LuaJIT) are often not allowed on consoles for security reasons - they don't allow running of unsigned code. So LuaJIT might not be an option.