We want to talk a little bit about Unreal Engine and specifically about a concern that is recurrent for those who are starting with this engine: what should I use for developing a game in Unreal Engine? Blueprints or C++?
What is Unreal Engine?
Unreal Engine is the main engine for video game development used by AAA companies, but it also has a significant share in indie and AA development. Apart from the spectacular results that can be achieved using this fabulous engine, it has a peculiarity, and that is the use of Blueprints, which are technically nodes for visual programming.
Other popular engines like Unity are also working to integrate this functionality natively, although for some time now, there have been plugins for Unity like Playmaker that the creator of the fantastic Hollow Knight game used to program their game.
We must note that the use of visual programming does not exempt you from knowing how to program. On the contrary, you should focus mostly on programming logic since the syntax is served through the nodes, but at all times, you must know what you are doing.
But, what is visual programming?
Visual programming is code mainly in C++ (regardless of the engine) abstracted into blocks or nodes that often have routines already prepared to streamline processes. Like any abstraction, it has a degree of encapsulation, and therefore, all encapsulation has a price in performance.
So, what is the purpose of Blueprints?
In Unreal Engine, Blueprints are created to speed up communication between programmers and artists. That is, artists can use these nodes to connect routines created with code without the need to read a single line. An artist should not create complex logic with Blueprints; from our point of view, that is not the objective. They should only worry about adding art elements and using nodes with a very simplified abstraction.
This means that a game cannot be entirely made with Blueprints? No, a game can be made simply using Blueprints, and a programmer can program only using Blueprints, and even a solo artist can learn to program using Blueprints and complete their game.
But, like everything, there are nuances. A game created solely with Blueprints has a greater impact on performance than a game developed with code, but we must make several observations. Game performance depends on many factors, from the quality of polygons in 3D designs, the use of lights, the size of textures, level optimization, among many other factors, and it would take several publications to discuss them in-depth.
An important point is the quality of the code. The nodes in the Blueprints are optimized routines that can have better performance than a poorly written custom routine in C++. For this reason, C++ programmers should follow good practices for development in Unreal Engine.
But in comparison, if we take the source code of a game written entirely with Blueprints and migrate the logic to code, this game, in theory, would have better performance. Additionally, a criterion that we should not omit is the versatility when creating the project, the synergy between the team, and this is achieved very well by UE with Blueprints since it is the bridge.
What is our recommendation?
We must understand that it would not be recommended for a large-scale project to create it only with Blueprints for the reasons already stated, nor to try to do everything with code since productivity in a team is crucial to meeting goals. Therefore, from our experience, We believe that if we should put a usage percentage between Blueprints and C++, approximately 40% (Blueprints) and 60% (C++).
When to use Blueprints?
It is highly recommended to use them in project prototypes or for some functionality, and after approval, part of it can be migrated to code.
When to use C++?
It is highly recommended to write all processes that are expensive for performance, require loops, or some extensive logic.
To conclude, this would allow having the best of both worlds and consider that Blueprints should only be used for already encapsulated processes, so as not to turn the project into a spaghetti of nodes.
Just one final note, the C++ used in Unreal Engine is usually a bit different from the standard, of course; this is not a problem, but for those of us who have been using C++ for a while, we must learn a little of this Unreal Engine’s C++, which we can exaggeratingly call UC++, as it has peculiarities and we must learn its logic of Macros, and we will surely dedicate a publication to it.
Thank you for reading, until next time.