#Gamedev TutorialsProgramming

Is Learning C++ for Unreal Engine Worth It?

FavoriteLoadingAdd to favorites

C++ in Unreal Engine is massive. To many beginners, learning Unreal Engine C++ can feel like learning a completely new programming language, even if they already know C++! So, with tools like Blueprints (Unreal's visual scripting system), is learning C++ to program in Unreal Engine even worth it? What are the benefits of doing that extra work, and should you even bother in the first place? There are several reasons why, if you're a gameplay programmer (or an aspiring one), you will benefit greatly from learning the Unreal Engine C++ framework. This is true whether you plan on programming your games using C++ or solely in Blueprints! (Crazy, right?) This requires an explanation. Hang on, it's comin'!

Firstly, Unreal Engine 4 Blueprints is basically a prettier version of Unreal Engine C++. The entire framework is based on an object-oriented hierarchy of class inheritance. What does this mean? It means you must understand programming concepts to truly understand the system at a deep enough level to be a decent gameplay programmer. As a beginner, you might have a little bit of trouble wrapping your head around the hierarchy of inheritance that is Unreal Engine.

You see, in programming, there are these things called classes. They contain all the information for a particular object. Then, there are classes which have relationships with other classes. There are parent/child relationships, where one class inherits everything from a parent class, plus it has more functionality. Then there might be another class that inherits from the child class, which now becomes a parent of the third class, and so on.

In Unreal, there is the Object (or UOBject in C++), which is the parent of an assortment of various classes, including the Actor (AActor). Actors are more specialized. In fact, the Object is so basic, it can't even be placed in the level! The class must be of the type Actor or lower on the hierarchy to even be placed in the level. Then from Actor there are Pawns (APawn), which can be possessed by Controllers (a class that acts like an interface between user input and the Pawn) and can thus use input such as a mouse click to perform certain actions. Descending from the Pawn is a Character, which has even more functionality and components, such as a Character Movement Component, which is really nifty and has tons of functionality a Character would need.

Anyway, the idea of inheriting traits from a parent class is very much a programming one. On top of that, all the logic you create in Blueprints are C++ at their core, which brings me to the second benefit of knowing C++ for gameplay programming: Blueprints visual scripting is programming!

Sure, you can create an entire game in Unreal Engine Blueprints, and many people have. But those who do so often have tons and tons of Blueprint logic, involving wires upon wires and nodes upon nodes (wires and nodes make up the visual scripting system of Blueprints). Ultimately, each node in Blueprints has C++ code at its core and will be converted into C++ code upon compilation. With modern computers, this added time is generally not very big, but the larger the project, the more significant this extra step can be.

Unreal Engine C++ programmers have a closer relationship to the engine. They are responsible for the core mechanics of the game at a deeper level. They are the ones who decide what functionality even gets exposed to Blueprints for the more artistic developers to tinker with. In Unreal, there are these nifty things call UPROPERTY macros, which can be attached to variables and alter their degree of exposure in Blueprints. This is handy when you have variables which, if tampered with incorrectly, could break your game. Programmers more familiar with the core mechanics would be responsible for knowing this, but a more artistic developer might not. In short, Unreal C++ programmers have a deeper understanding of the core mechanics of the game, and for larger and more involved games, this separation of church and state can make things much more orderly.

While there are some things that would definitely be easier in Blueprints, such as taking care of particle system effects, timelines (nifty Blueprint nodes which allow you to create a curve which can determine the value of a variable with respect to time or some other variable; these are great for doors opening, objects floating etc.) and the like, core mechanics are better left to programmers. A good rule of thumb is that when your Blueprint wires and nodes start looking more and more like spaghetti, you might want to consider learning programming or finding a programmer.

Unfortunately, Unreal Engine C++ is not very friendly to beginners. There are tutorials out there which take beginners and throw them into the fire by having them blindly follow along while a tutorial video types countless lines of code, and by the end of it, they create some game mechanic, but would never be able to reproduce it, let alone make something of their own. Most Unreal Engine C++ tutorials start writing code right off the bat, with the assumption that the viewer has a solid understanding of C++. For those who are already seasoned programmers, following along is only slightly frustrating, because Unreal's C++ system is very specific with its conventions and tendencies. For those who don't have a solid grasp of C++, it's just a discouraging and disheartening experience.

It is for this reason I have created C++ tutorials specifically for those who wish to learn to program games in Unreal Engine. You learn the basics, but there are also not-so-basic concepts most seasoned programmers know about that beginners don't. What many beginners do is go out and watch C++ beginner tutorials and get them down fairly well. Then they go and watch Unreal Engine C++ tutorials and they understand nothing. There are a handful of skills that aren't taught in beginner C++ tutorials, and when you watch advanced level tutorials, you have no idea what to look out for because the programming language is practically endless.

My tutorial series takes you from absolute beginner (like literally... you don't even need to know what a programming language even is! We cover that) to being able to actually start programming in Unreal Engine C++ and know what you're doing. I take challenges from a game developer's perspective and introduce concepts a game programmer needs to know. If you're interested, you can contact me or visit my website and get more info about my tutorials. Below is a tutorial video for an absolute beginner, introducing the programming environment and the most basic thing any programmer learns: how to print text to the screen. Traditionally, the first thing a programmer learns to print is "Hello World!" For this example, since we're game developers, you create your first game and print "You Died!" to the screen. It's a game you can't win, but hey, it's a start, right?

#indiegame gamedev indiedev programming #UE4 #gaming Unreal Engine gamer #C++ coding Unreal engine 4 code

Stephen Ulibarri

I am passionate about playing and designing video games. I love computer science, game art, writing, music, fantasy and science fiction. I am a Udemy instructor and have my own website, DruidMechanics.com, which I am currently building and plan to turn it into a valuable source for learning developers.

Leave a Reply

Your email address will not be published.

Back to top button