DEV Community

Cover image for Unreal Engine, BluePrints, C++, Oh My!
Barrington Hebert
Barrington Hebert

Posted on

Unreal Engine, BluePrints, C++, Oh My!

      When I mention Blueprints and C++, the first thing thing that comes to mind is Unreal Engine. Unreal Engine is a 3D computer graphics tool, it can be used for films, special effects, and game design. Developed by Epic Games, this powerful tool can be utilized to create games for desktop, mobile, console, virtual reality, augmented reality, and mixed reality. It Allows you to code in both C++ and something called BluePrints, both of which are valuable tools that may not take too long to build foundational knowledge in, but will require time, commitment, and discipline to master.

Image description

      So far my experience with Unreal Engine has been great. The ease for creating character models and weapons models is mind-boggling. Once you get a decent set of assets, it becomes quite easy to get started with creating your own game. Assets are the pieces of content used to create a game, they come in many forms, audio, meshes, and textures. Unreal Engine provides a wide variety of assets in it's store, and there are a variety of high quality free assets out there as well. I highly recommend using the free assets from some guys abandoned game project which can be found here:

Assets

      Everything in gaming relies highly on assets, they are the fundamental geometric shapes, colors, and sounds that create the game world. Those games where they show the enemy's head explode from headshots? Each individual chunk of the brain that flies away is it's own respectable mesh. Static meshes comprise the geometrical shapes which are pieced together, whereas textures act as the paint brush of images that are used to be applies to their surfaces. If creating an enemy from scratch in a 3D world in some cases may take just as long as building the entire map they reside in. This game engine takes the first leap into game design by providing templates, including everything from weapons to entire maps to get started with.

Image description

      Unreal Engine has gained alot of popularity for ensuring the more complex elements of game design, such as the collision detection, gravity, bullet projections, physics, dynamic lighting, and various mathematical complexities come pre-coded in C++. The code for the game can be edited, but it is limited to a certain degree, as it seems like gaining access to the deep inner-workings of some functions as they seem to present them in a way that only shows the input and output parameters of a function.

Image description

      I found this mildly disappointing seeing as though I looked forward to expanding my understanding the verbose structure of C++ in game design, but it is not the end of the world completely because at the end of the day, I still get to glimpse at the wonders whilst making games in the process, and I can appreciate the desire to increase usability. They truly step up the usability by offering game design by using blue-prints.

      Blueprints are a visual scripting language in Unreal Engine. It presents itself like a Tree data-structure, where the nodes represents code, and by connecting them, we also connect events, functions, and variables. You can take glimpses of the C++ code from within these nodes, the best way I could describe working with blue-prints is that it reminded me of coding with Scratch.

Image description

      Blueprints allow you to manipulate the behavior of an Actor, which is essentially any animated asset that moves around in the game. Players and characters in the game, are pawns, which are subclasses of Actors, they too can also be manipulated via blueprints.

Image description

      Unreal allows the user to create games in both C++ and blueprints, and there are some cases in which you can use a little bit of both. For the C++ side, every class consists of a header file (.h) and a class source file (.cpp). The header will have the declaration of the class and all of its variables and functions, and the source file acts somewhat like a controller where the implementation of those functions takes place. They follow a naming convention where they are prefixed with either U or A, the syntax will look something like this:

UCLASS([specifier, specifier, ...], [meta(key=value)])
class ClassName : public ParentName
{
 GENERATED_BODY()
}
Enter fullscreen mode Exit fullscreen mode

      The GENERATED_BODY() part is a macro that executes a series of commands or actions. It helps signal the Unreal Header Tool to set up the necessary infrastructure for a class to be recognized by the Unreal Engine. The specifiers help determine how the class behaves with the various aspect of the game engine. You can see some of this in action via the blueprints, yet that seems to be the depth at which Unreal Engine directly allows if you do not have an IDE ready to compile in C++. Here is an example of what you may see if you have opted to use BluePrints:

Image description

      Whether or not you choose to dive into the intricacies of C++ and gaming or utilize blueprints is completely up to you. It should be noted that C++ does perform better than blueprints since it compiles directly into machine code (it will run faster on your CPU), where as with blueprints you need to rely on Unreal engines virtual machine at runtime. Regardless of the two, both are valuable avenues of knowledge and the best way to learn is to dive straight into the pool with a mind that does not fear documentation. There is a common argument that someone new to game design should only focus on learning Unreal Engines Blue-Prints rather than C++. Regardless of which route one may choose, it will be challenging and a foreign experience if they have never designed a game before; so why not take the time to build a foundational knowledge in both? Cheers!

Top comments (0)