Comparing development in Unreal Engine and Unity

I will not compare all features one by one and I will only compare development with each engine.

Unreal Engine supports blueprints and C++. Let me review them in detail.

Unreal Engine Blueprints

Blueprints are really good for an inexperienced developer and allow an easy way to start doing some programming in their project. You can drag and drop nodes that do particular actions and connect them using your mouse. It looks intuitive and easy. And at the beginning it is.

But there is a reason why visual programming never worked. And there are a few reasons for that: it is much slower to write and much harder to read. It works only for very simple cases.

For example, imagine we have the following code:

Call FunctionA

If A > B Then

  Call FunctionB

End If

Call FunctionC

And here is the picture, of how will it look in the Unreal Engine blueprint.

As you can see it took up almost all horizontal space on my screen.

Now imagine that I need to call FunctionD before calling of FunctionC. Any person who uses a computer for 1-2 years can do it in like 10 seconds. Move caret to the beginning of the line that contains Call FunctionC, press Enter and type Call FunctionD. Most can do it in 5-7 seconds.

In a blueprint I will have to do the following:

  1. select everything from the node that calls FunctionC and to the right
  2. move selection to the right to make space for a new node
  3. place a new node to call FunctionD
  4. connect else part of IF node to FunctionD
  5. connect a node that calls FunctionB to FunctionD
  6. connect FunctionD with FunctionC.

Here is a result:

It will take around 20-30 seconds. But it is not the only time that it is a problem here. Quite often there will be mistakes. For example, you forgot to connect FunctionB to FunctionD. I’m an experienced developer, with tens of years of experience and I still sometimes do these mistakes from time to time. I know that I have to re-check everything and I still do them. Perhaps it happens because sometimes nodes didn’t connect even though I drag them to a proper place.

Sometimes I found that I didn’t select every node at step #1 and some nodes didn’t move. As a result, I have a mess that I have to fix. Sometimes after new changes, lines that connect these nodes are crossing other nodes and I have to move them around.

Now, imagine you will need to change If A > B Then to If A < B Then. In the text, it is possible to do it in a second or two. But in the blueprint, you will have to delete > node. Then place < node and reconnect nodes A and B. Took me almost 15 seconds to do it. And again there is the risk of missing some nodes and do not connect them.

And there is another problem. As you can see I have to zoom out to fit all nodes on the screen. Now compare it with 6 lines of code. It will take maybe 1/6th of screen space vertically. But if you will change A > B to something more complex, things will be much worse. Imagine I will put A > B Or Abs(C – D) > 0.01 Or E <> F. This new condition will not change vertical space at all because it will easily fit in one line of code. But it will require around 11 new nodes. And it will be much harder to read.

And probably in one out of three cases I will drag a node instead of connecting from it. Sometimes it is the opposite and instead of dragging nodes, I will start connecting them.

And I have to state that comments are quite bad and can be explained only by the following words: better than nothing. It is possible to place them when by pressing C key, but it will not be connected to any node and when you move a node, you will have to move a comment node as well. And if your node became bigger or smaller, you will have to resize a comment node manually.

The blueprint debugger is also quite basic and simple, lacks keyboard shortcuts, and requires a lot of mouse work.

And blueprint code is very slow. From 20 to 1000 times slower in extreme cases. But most of the time it is not a problem.

And last and the probably biggest problem with blueprints is that they are stored as binary and that makes it quite hard to see what was changed between 2 different revisions. I hope that you are doing the right thing and that you are using source control for your project. Yes, the Unreal Engine itself can show a difference but it is much slower and much harder.

 As a result of all these limitations, many people will stop making their code look good, and the more they develop, the messier their code became. It gets harder to read and even harder to modify and in the end it will be an unreadable mess. It requires quite a lot of discipline to keep it in good shape.

And in general constant switching from keyboard to mouse and back is extremely unproductive and slows development considerably.

Unreal Engine C++

But Unreal Engine supports writing code in C++. And it is on the other and more extreme side. C++ is a hard language to learn and even harder to master. Moreover, because Unreal Engine has garbage collection that C++ does not support, some errors are quite tricky to find and solve.

Also sometimes Unreal Editor will just crash when you change C++ code. It happened because compiled code loaded in the editor itself and some changes are too much for an editor to handle. And when it happened, you will find that Unreal Editor takes considerable time to load.

And lastly, C++ is very slow to compile. In my project, it takes from 5 to 15 seconds to compile when you do big changes. For example in header files. And I have to sit and stare at the screen waiting for compilation. Smaller changes are much faster but still 1-2 seconds. I spent quite a bit of time researching this topic and my understanding is that it is the way it is supposed to be.

Yes, C++ is a very powerful language, and compiled code is extremely efficient and fast. But most of the time it is not required and even much slower blueprints are fine.

On the good side, Unreal Engine is written in C++ and its source code is available for free. So it is much easier to research and investigate problems.

Unity

Unity is using a much better language C# and in my opinion, it is the best language. It is easy to learn, it is quite powerful. It is very popular and easy to find help. All development and debugging happened in Visual Studio and it is one of the best IDE in the world. Everything is good, right? Not really.

There is no source code of the engine available and that considerably increases the time required to investigate and fix problems. These kinds of problems are quite rare but when they happened, it is very helpful to have source code.

But the biggest problem is that when you press the Play button, it takes 2-3 seconds to start. Always! Even if you didn’t change anything. On a project, I just created from the template. I spent quite a bit of time researching this topic and it looks like it is by design and unavoidable. I tried the beta version and it has the same problem.

Update 31 Oct 2022: I found out how to play instant in Unity. Go to Project Settings|Editor and set the checkbox “Enter Play Mode Options”. Option “Reload Domain” controls this setting and it should be off. After that, when you press the Play button game will start instantly. Read more about caveats. But they look really minor to me and only include static methods and static fields with easy workaround.

Outcome

I decided to write this review because I had some project in the Unreal Engine and I thought about porting it to Unity. Mostly for sake of seeing how long will it take and to learn some Unity. But I also hope that I will develop it faster.

But even though Unity clearly is looking much better for development, I decided that overall I will stick to Unreal Engine (Update 31 Oct 2022: currently I’m reevaluating this statement). It starts the project instantly when I press the Play button and there is no delay. From my point of view, it is better to lose some time on compilation than lose it every single time when you run your project.

There are a lot of other activities that require the start of the application and waiting 2-3 seconds every time to me looks like a very bad deal. In the past, when I was trying to find out why something does not work as expected, I had to start the application quite a lot of times and try different things to get an idea of where the issue could be. Also, development is a big part, but there are a lot of other activities that are also required to start and stop the game.

Just in case you are interested, I finally decided to use a mixed approach and I’m writing the most complex code in C++ and putting the basic code in blueprints. I still have a lot of blueprint code but it is relatively simple. In other words, I use C++ to create building blocks and blueprints as glue to connect them, and sometimes I do some prototypes in blueprints.

I hope it helps someone.