Live data from Hacker News

Why C++ for Unreal 4

forums.unrealengine.com

31–40 of 178 posts

Re: Why C++ for Unreal 4

#31
post #10

Maybe 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

Time and State are first class constructs in UnrealScript, they are not in C++.

It's also possible to recompile UnrealScript files without recompiling the whole C++ program which took quite a while. (Unreal4 allows hot reloading C++ so this is no longer an issue.)

Re: Why C++ for Unreal 4

#32
post #16

The upshot is likely that a community-created Lua or JS binding will gain a significant userbase.

Note that you'll need a language capable of AOT compilation if you want to target consoles which only run signed code (or use an interpreter, which will be rather slow). JIT is not an option on those systems.

The LuaJIT interpreter is surprisingly fast. Still not as fast as the JIT or an AOT compiled language though...

Re: Why C++ for Unreal 4

#33
post #12

> Developers seeking to take advantage of the engine's native C++ features end up dividing their code unnaturally between the script world and the C++ world, with significant development time lost in this Interop Hell. Replace "C++" with "JavaScript/client-side processing" and "script" with "server-side scripting" and I feel like this adequately describes web-development.

Replace "C++" with "server-side processing" and "script" with "client-side scripting" and I feel like this adequately describes web-development.

FTFY

On a serious note:

I've recently started using Clojure on the backend and ClojureScript on the frontend and while its not quite 100% of the way there, its close and quite pleasant to work with.

Re: Why C++ for Unreal 4

#35
post #2

The phrase > 'What starts out as a sandbox full of toys eventually grows into a desert of complexity and duplication.' is beautiful and is a pattern I've seen multiple times before. Its not feature creep per-se, but more something a bit more insidious in software development.

Any specific examples? It would be interesting to go through the commit logs.

Re: Why C++ for Unreal 4

#36
post #10

Maybe 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

It had synchronous-style code for handling animation logic, without needing hundreds of threads.

It also had some clever ideas about replicating state across the network. You want to run the simulation locally to reduce latency, but you also need it to run elsewhere to have a consistent source of truth. So some state would be calculated by the local simulation, but be updated when packets of truth arrive. Member variables could be annotated according to how they were replicated, IIRC.

Re: Why C++ for Unreal 4

#37
post #12

> Developers seeking to take advantage of the engine's native C++ features end up dividing their code unnaturally between the script world and the C++ world, with significant development time lost in this Interop Hell. Replace "C++" with "JavaScript/client-side processing" and "script" with "server-side scripting" and I feel like this adequately describes web-development.

Completely disagree. Server-side and client side are two completely different environments — different architecture, different security concerns, different user interfaces. Indeed, there's pretty much nothing shared.

Attempts to hide this have thus far all been leaky abstractions, and we're still in the research phase (e.g. Meteor). I'm not convinced that it will be possible to create a coherent web environment which abstracts the server-client boundary effectively.

Note that this doesn't preclude e.g. using Javascript as a server-side language. That's not related.

Re: Why C++ for Unreal 4

#38
It 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

#39
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…

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.

Re: Why C++ for Unreal 4

#40
post #5

On the other hand, I feel that tools like Unity are successful precisely because they let you tinker with your game in a WYSIWYG kind of way. It's really liberating to be able to work inside such a tight feedback loop, and it's a little weird to see a modern game engine distancing itself from that approach. (But maybe I'm missing something. What exactly is the role of the Unreal Editor in UE4? Is it mostly for things…

Can you make new Blueprint building blocks using Blueprint itself? Also it is still programming, just a visual kind of it.
Post reply on HN