home

Tutorial index

Unreal Engine 4: Setup, introduction and orientation

The Unreal Engine has been, since its very beginnings, one of the most widely used engines. This was because it provides an easy interface on which both programmers and artists can work and test their work in the same workspace, which is feature-rich and intuitive. In this tutorial series we will be looking only on the c++ coding part, independent of the editor, blueprints, and any other aids.

Why only C++?
The answer is, with code you can do anything. When you work in the editor, you place stuff around that have already been implemented in cde and blueprints, but you cannot create anything really new. With Blueprints you can string together properties, functions and other programming-related stuff to compose new entities, behaviours etc, but if you do not have the required building block, you cannot do that. With code however, you can literally work out any behavior computation, action, or anything you want, and you can even create new Blueprint elements and so on. Thus we focus on learning UE4's framework, so we can do anything, independently of whether someone else has already implemented the basic parts or not.

Why is Unreal an "Engine"?
Game engines are frameworks people use to develop games. A framework in turn, is a wrapper of sorts, it strings together a lot of components and functionalities. In the case of Unreal, it is a wrapper containing physics (using NVidia's PhysX system), graphics (Microsoft DirectX and recently OpenGL), and a number of other stuff you need to make any sort of game you want (networking, audio, even support for VR kits, peripherals etc). Most of the technologies I refered to are themselves frameworks or wrappers of sorts. The only cost is a 5%

cut from any future profits. The next question is, why not implement this stuff on my own and keep that 5%? Because it takes a lot of knowledge to get each of these working (see my DirectX tutorials to get a feeling of how hard it is even without lighting effects to render a model), and a lot of time, and of course, a lot of optimization, requiring more knowledge, time, tests and experience. Could you hire others to do that? Yes, you would be making your own engine, but that would require that you pay them before you get any income, and probably pay them a lot. If they worked for three months (insert laughs, it would probably take more) and they were, say three people (I doubt it would take less, and we're only thinking about graphics and some basic physics) , they'd take maybe 2000 a month each, which would go to about 18000 of whatever currency we are talking of. That is 5% of 360.000, so if you don't make that much money, you're better off with Unreal. And 4 programmers for a game that will gross that much is really bad odds, not to mention that you need the cash beforehand.

Ok, so I need an engine to get something done in reasonable time, but why Unreal?
As I said before, it is feature-rich and industry proven (tens of AAA box office hits, hundreds of titles with publishers and all), and with a quite fair deal. Also you have cutting edge graphics (CryEngine is generally assumed to have the best between commercially availlable engines, but UE4 did give us mindblowing effects without doubt), it is now open source, so you can mess with everything, it has reliability all over it (PhysX is probably the most widely used physics engine out there, it has at least decent performance, and is quite stable), and it is aimed specifically at creating top quality games for the PC and the consoles. The alternatives are CryEngine, which requires more searching to learn about as it is not entirely free, and also has a license fee you discuss with CryTek, though it does have all its merits and is worth its money if you're worth it, and Unity3D, which is however aimed specifically at the mobile market (200 new mobile tools in Unity5) and thus though it starts low on demands, it quickly grows heavy on big projects (see Wasteland 2, great game but requires more resources than it justifies) and is nowhere as close in graphics and physics, and assuming you can make it as close, you'll need a really mean system to support it.

So how do I set it up?
You will have to go to https://www.unrealengine.com/ and create an account (no credit cards or tricky stuff, no worries), be honest about your name as you may be getting some cash with their engine in the future, in which case you don't want anny messing up with the names. After that you will get a download link to the Epic Games Launcher, Epic Games being the company behind Unreal, the Unreal Tournament and so on. In the launcher you will see a tab callse Unreal Engine, over there you will be able to select the version you want to download (if you had a project in an older version you might want to remain on that for compatibility and safety), and let it download. Unreal pretty much takes care of everything, once it's ready, click on Launch under the engine version you want, it will open the project manager, where you can access existing projects (also listed in the library in the Epig Games Launcher), and it also has a new project tab. We will create a new project, either of the first or third person type, and check the "starter content" marker (or equivalent) so as to have some stuff availlable. Eventually it won't matter which project you will use, as we will,as stated, do everything in code, nothing through the editor, so it doesn't matter much what there is, as long as any content we reference in code is visible to unreal (i.e. it is in the open project).

For the programming part, you will be using Microsoft Visual Studio 2013 or 2015, I would go with 2013 as it is about 7GB, whereas 2015 is around 17GB, though it can be brought down to about 8-9 if you start removing components. You can get the free version of Visual Studio (community edition if I am not mistaken) through it's installer for the 2013 and 2015 versions respectively.

Moving around the editor
I will not go into detail about moving iside the editor, hold right click in the view port and use WASD to move around, Q and E to lift/lower the camera, on the bottom you can browse the project files, including C++ classes, models, textures and so on.

We get started in the next tutorial by creating a new class and taking a look at the code, after that we will spawn a mesh through code, and then add some hovering movement to it.