NOTE: This post was originally written in 2013, but could not be published due to certain NDA clashes. Now that UE4 is public I can finally share my thoughts with the world. Small edits have been made to make sure the post remains relevant, since UE4 has advanced a lot since last year.
I was given the amazing opportunity to preview Unreal Engine 4 in private beta. Verdict? UE4 is currently the best game engine in the known universe.
- UnrealScript is Dead, Long Live C++
- Faster than a Cheetah on Jet Pack Rollerskates
- Blueprint: Kismet on Steroids
- UE4 Loves Version Control
- An Editor for You and Me
- Let’s Rocket To Infinity and Beyond
I may as well get the biggest rumor out of the way first. UnrealScript is gone. 100% out of there. You know all that effort you put into learning UnrealScript these past few years for UDK? Yeah, not important anymore. Forget all of it.
Well, not all of it.
But most of it.
I could go into great detail about how much I hate C++, but we’ll leave that for another post. The sad truth is, C++ is pretty much the de facto language in game development and if you want to get anywhere in this industry you should at least know its basics. And what better incentive than UE4?
My loathing for C++ aside, programming in UE4 isn’t really that bad. It helps to have had a course in C/C++ (as I did) and one or two C++ books lying around (my personal favorite is C++ Primer Plus, but a better starter book is C++ For Dummies), and a second monitor for Stack Overflow is indispensable. Even with all these resources, though, the learning curve for C++ is gigantic.
In that respect, Epic Games has tried to make programming as painless as possible. Remember the hot-load feature from the UE4 Features Walkthrough? Totally works. You no longer need to quit the editor to recompile code; in fact, compiling from the editor is recommended. There’s a C++ Class Wizard, also in-editor, to help with generating boilerplate code. And there are dozens of sweet C++ macros to learn that help boost your code’s functionality. For example, this:
UFUNCTION(BlueprintCallable, Category="MyAwesomeFunctions") static void MyAwesomeFunction();
will allow me to call MyAwesomeFunction() from Blueprint (we’ll get to that later). I also love the Unreal Smart Pointer Library. If you’ve coded in C-and-friends for any length of time you probably despise pointers. In UE4, just use TSharedRef all over the place and you’re good to go.
Of course, you’ll have to learn all of these UE4-specific tricks and shortcuts in addition to learning C++ by itself. So prepare yourself for a lot of learning.
One reason why C++ is so popular is that it’s fast. For UE4, this means a dramatic speed improvement in almost every way. On my computer, the editor starts up in a little under 5 seconds, whereas UDK can take up to half a minute to load. Compilation takes about the same amount of time in either version (20-40 seconds for a smallish project), but I chalk that up to Visual Studio doing a bunch of linking junk in the background that UDK never had to do.
The engine is also no longer strictly limited to 30 FPS. The editor (which is build upon the engine, mind you) consistently runs over 60 FPS and usually clocks in at 110 FPS for the default level. Depending on the game, I do get FPS drops occasionally, but never below 30 FPS. And there are crazy optimizations at work: open a menu while in the editor and you’ll flat-line at 120 FPS, because the world doesn’t need to render since you’re looking at a menu. Yeah, they’ve thought this through.
Epic was also not lying about gameplay performance. I’ve done the million-particles test and UE4 was able to pull it off with no sweat. And a good friend of mine has dropped over 3000 dynamic lights into a single level — UE4 didn’t even blink.
You might be wondering about the state of lighting in the engine. In a video I posted a while back, I said UE4 would have dynamic global illumination. This is not entirely true anymore. I’d have to agree with the reasoning; if it makes the engine that much faster at the expense of “fake” dynamic lighting, then I can live with it.
So how fast is UE4? Well:
Wait, that title isn’t accurate. “Steroids” gives Blueprint a negative connotation, when in fact Blueprints are quite positively awesome. I should really say something more along the lines of “Blueprint: Kismet if Kismet Exercised Daily, Ate a Balanced Diet, and Learned C++“. But that’s kind of a long title. I digress.
Blueprint is in some sense the successor of Kismet, but it’s really a lot more than that. Put very simply, Blueprint is a visual scripting language. Imagine if you took any piece of code you’ve written in UnrealScript and tried to draw it out as a graph of nodes connected by wires. That would be Blueprint.
In UDK, Kismet was only a visual graph for events in a single level. But in UE4, Blueprints can be applied to pretty much anything. You have your standard Level Blueprint (doing what Kismet did), but you also have Class Blueprints that extend the functionality of C++ classes within the editor. Blueprints can be saved like any other asset in the Content Browser. Blueprints can talk to other Blueprints (this functionality is current kind of lacking, but Epic says it will become a lot more robust in future releases). Blueprints can even be included in other Blueprints via macros.
Blueprint can’t do everything C++ can do, but I envision that at some point it will become powerful enough that we don’t need to depend on C++ at all. In fact, Epic has already released a demo game called Swing Ninja that is written completely in Blueprint, and some people on the forums have already done things in Blueprint that I wouldn’t even begin to try coding in C++. And a final added bonus is, it’s incredibly easy to learn. Actually, if you’ve done any work in Kismet at all, you already know it.
Let’s end by revisiting my previous code example:
UFUNCTION(BlueprintCallable, Category="MyAwesomeFunctions") static void MyAwesomeFunction();
In UDK it was a real pain to add custom Kismet nodes, but in Blueprint this is all you need to do. Just hop on over to the editor after compiling and you’ll see your custom MyAwesomeFunction node in the MyAwesomeFunctions folder within Blueprint. Sweet, right? Yeah, I thought so.
One of the last things Epic did before stalling UDK development altogether was integrate Perforce version control. I’d like to take this time now to say that if you haven’t used version control before you should be ashamed of yourself. Even if you’re developing your game alone, you should try it out. Version control systems make life easier for software developers and increase the productivity of large teams dramatically.
In UE4, Perforce is enabled by default but can be disabled with the click of a button. I don’t use Perforce myself — not a hypocrite, I just like GitHub better — but I can see where this automatic integration would be insanely useful.
But suppose you don’t use Perforce (like me)? What benefits does it give you (and me)?
To facilitate better version control, Epic has rethought their entire project structure. Remember in UDK how we had the single folder, and all our game code lived in \Development, and all our assets in \UDKGame\Content, and so on? Ever tried working on two games at the same time using the same UDK release? No? Well it’s a pain in the posterior. That’s why I usually had two or more UDK version installed, one for each project I felt like messing around with. And if I wanted to somehow “separate” my game’s code/assets from the rest of the engine (to distribute its source, for instance) I had to resort to copying a bunch of folder paths all over the place.
In UE4, all your projects live in a folder called (appropriately enough) “Unreal Projects”. Inside this folder you can have any number of subfolders, one for each project you’re working on. And each project subfolder contains all your game’s code, assets, levels, etc. Here, each project’s structure is completely self-contained and separate from engine code. If I want to distribute the entire project, I just zip up its folder.
Each game asset is also now a separate file. No longer do we have giant 100MB files containing all the Necris archways and pillars and whatnot. Rather, we’d have a directory containing 200+ individual files, each one encapsulating a single mesh or texture or material. This makes version control a breeze because instead of having to upload the diff of a 100MB package every time you change the color of a single material inside it, you just have to upload the changed ~40KB material file. It’s beautiful.
One thing I’ve always loved about the Unreal Engine is that it’s very much community-oriented. Unlike in many other AAA game companies, with Epic the Unreal Engine is actually a product, so they put a lot of time and effort into making it useful to other developers as well.
UE4 takes this to the next level. Perhaps I should let Epic speak for itself:
Many Unreal Engine subsystems were designed to be extensible, allowing you to add entire new features and to modify built-in functionality without modifying the engine code directly. You can create new file types, add new menu items and tool bar commands to the editor, or even add entire new features and editor sub-modes!
The way to do this is through the new Plugin system. It’s currently very experimental and Epic cautions us that it will change in future releases, but I’ve already created a plugin and it’s actually pretty easy to do. A plugin, like a game project, is self-contained in a single directory. That means it can be zipped up and distributed for other users, and all they have to do is drop the code into the plugin directory \[UE4 root]\Engine\Plugins and it’ll be available to be installed in the editor.
At some point, I hope that Epic will have a plugin hosting service integrated into the editor itself a la Sublime Package Control, so that all we have to do is browse for available plugins, click a button to install, and profit.
Even if you don’t use plugins, though, UE4 is already way more customizable than UDK. For example, I know someone who’s made their editor pink. I’ll leave it up to you to figure out who that is.
I believe I’ve already said this, but it bears repeating: UE4 is currently the best game engine in the known universe. It has its little quirks and flaws and many of its subsystems aren’t finished yet, but it’s already leaps and bounds above UE3 before it (and dare I say any other engine in the industry).
You may disagree. That’s cool. I’m not going to say you’re wrong.
But even if you don’t agree…at least give Epic a big hats off for all the work they’ve done. With UE4, they’ve certainly earned their name.