Unreal Engine 5: C++ vs Blueprints

Intro to Blueprints vs C++

Blueprints have advanced a lot since their inception, in the beginning, Blueprints were helpful, but you still needed to use C++ for a lot of things. Somewhere along the way, Blueprints got a lot better than they used to be, and now you can get by no problem using only Blueprints and nothing else.

If you’d like a more in depth discussion of blueprints, check out our beginner tutorial.

But wait a minute, hold up.

What are blueprints in Unreal Engine?

Blueprints is a visual scripting system for the Unreal Engine, it is a full replacement for C++. It allows you to write code visually, you can create nodes, drag and drop them, change their settings, and connect them to each other with wires. It is context sensitive.

Should I learn C++ or Blueprints?

You should learn blueprints first, you can do everything in blueprints, without ever plugging a variable into the wrong place or breaking your game with a spelling mistake. C++ is for high level professionals.

Is Blueprint easy to learn?

Yes, it is easy to learn blueprint even if you aren’t a programmer, you can just jump right in and start scripting. It’s not just a prototyping tool, you can do everything in blueprint. Studying blueprints will also teach you about programming.

OK, so how do I use Blueprint?

It’s easy, just open up a blueprint in Unreal and start creating nodes…. At first you won’t know all the nodes, but actually, once you get to know the important ones, branch, cast to type, for each loop, get, set, event tick, event begin play, sequence, get player controller, print string, stuff like that, you’ll be ok. You get a sense of what to do after you’ve practiced long enough.

If you need the university level breakdown of how to use blueprint, check out the official docs from Epic Games.

You’ll also need to understand how variables are handled. For instance, once you use a get command for your variable, you can pull a pin out and get access to all of that variable’s functions.

Context Sensitive Function Access

If you were to just right click on an empty blueprint, and try to use an object’s private function like -> FireWeapon(); . Well when you right click, and start typing that function into the search bar, you won’t find anything. But if you pulled a pin out of your gun’s get node, you can call FireWeapon(); . You can also access all the variables and functions inherent in your gun. You can call foreach loop from basically anywhere and plug in whatever variable you want to, then pull a wire out of the loop execution pin, get the array element being accessed at that cycle of the loop, and pull a wire out when the loop is over.

That wire can only plug into one location, but multiple wires can end up at the same variable pin. For instance if you’re using set master pose component node, you can plug lots of different objects into the node, binding them all to the master pose component, you don’t have to remake the node every time you want to plug something into it. But you can’t finish a function and then drag out two wires and send the flow of execution to two different nodes, if you plug one wire into a node, it will disconnect the other wire, so you get a nice clean flow of execution.

Why would I want to use C++?

Well as I’ve said it’s an advanced technique. If you studied computer science in university you’re probably going to want to use C++. If you’re working in teams, you’ll probably want to go with C++. This is something you will have to be good with if you’re planning to get work in a big corporation, they will require the advanced techniques. If you’re an indie developer however, or you’re self employed, then you can get by just using blueprint.

If you’re optimizing for performance, C++ runs faster, but blueprint compiles faster. And if you’re making a multiplayer game C++ is kind of a given. It also helps to see your code laid out plain text, in a sensible coherent manner, rather than the sea of spaghetti and nodes you get from blueprint. I find sometimes I get lost in big oceans of code in blueprint, and finding where I am in the flow of execution becomes very confusing.

If you’re developing a really big sequence of code, you may wish to organize it in C++, so it can be developed sensibly, and coherently, in sections.

Your mammoth sequence of blueprint code will eventually tend towards looking something like this, if you’re good at keeping things organized, not exactly the easiest to parse visually.

At least that’s the model, if you’re anything like me, your blueprint will probably look like a more disorganized version of THIS:

Nevertheless, I would never trade blueprint for C++, it is too useful, too efficient, I like knowing that if the node connects, it’s valid code. I like not worrying about spelling mistakes.

Actually, scratch everything I just said…..

Choose blueprint for the visual spectacle alone.

What can you do in blueprint?

Well ‘get by’ is a bit of an understatement, you can do just about anything in blueprint, I have yet to encounter a single situation where C++ was required. In Unity I was coding in C# all the time, in Unreal, I see no reason to code, when I can just use blueprint, it’s faster, it’s easier, it’s impossible to make certain mistakes. If you try plugging a variable of the wrong type into the wrong node, it simply won’t connect. But if you type out the wrong variable name, into one of your own function getters, it will take you a while to discover your own foolishness, if you ever figure it out.

Check out Gamedev.gg, our subscription service:

If you’re new to the industry and you want to learn how to make a game, you should check out our subscription service. We can teach you everything you need to know about game design, 3d modelling, or game engines. Have a look through our tutorials, it’s top grade stuff that can really help you a lot if you’re in a bind, or if you want help making your first game. You can also learn advanced techniques if you’ve been making games for a while, so have a look.

Other reasons to use C++

Another reason you might want to go with C++ is if you need more control over the core systems. You can make changes to core basic systems in C++ that would just be impossible under blueprint, which merely works with what is already built into it. It gives you more control over how the game works, and you can access the entire code, not just some of it.

Should a beginner use C++?

That’s a big no, captain. I suggest we steer around it. If you’re just starting out, make sure to start with blueprint, it’ll make things a lot easier, you can just start programming out of the gate instead of worrying about learning a whole new language and learn the further intricacies of the Unreal Engine in C++ which is different from just plain old C++. You’ll need to learn about UProperties, for instance…. What is that? I forget, but you’ll use it a lot.

If you’re an indie dev, or a hobbyist, or just self employed, this is a great way to go. Do you have a game inside of you that you want the world to see? Unreal in Blueprint is easy to learn even for a beginner, and it can teach you the skills you need to put food on your table and take care of your family, without working a minimum wage job in food service, security, or retail. You can build a game or get work making games without any knowledge of C++.

When I tried making something simple in C++, it didn’t work out too well. Didn’t function, and I was just trying to something I could do with blueprint and the editor no problem. You have to get very good to get results in C++. However, that’s not to say you shouldn’t do it.

Should an expert use C++?

Definitely. Especially if you plan to make a career in this industry, at a big company, being a master of C++ is a very nice thing to have on your resume. You won’t just be designing games, you could work for the defense industry, among other things. Unreal Engine is used for a variety of different functions. If you get really good with C++, you can do things you could never get done in blueprint in an efficient manner. You can also just run your program a lot faster and more efficiently than you otherwise would. If you want the fastest running game with the best optimization and the least overhead, then you need to be working in C++, and these considerations are the considerations of a professional, and a master of game design.

Also keep in mind that multiplayer games go well with C++

If you’re making a multiplayer game, coding in C++ is a huge asset, there’s just too much that requires it. I’ve never built a multiplayer game, but it’s a lot more challenging, and C++ is borderline required if that’s what you’re doing. You will also have the advantage of your game running smoother and faster and more efficient, and keeping in mind optimization considerations, there’s really no alternative if you’re making a serious online multiplayer game. I’m sure you can do it in blueprint, but it’s probably not advisable.

Teams

Teams tend to require C++, a whole bunch of people messing around with the same blueprint is dangerous and stupid. They WILL step on each other’s toes, and make problems for each other, they will have a hard time keeping track of what everyone else is doing, and the game will run slower as well.

If you compartmentalize everyone, and have all the members of your team simultaneously working on different C++ classes and programs, they can turn in their work at their own pace, and when it is done, you can assemble everything together, without the need for excessive messy blueprint. You can even access your C++ classes and functions in blueprint once you’ve created them, so maybe your core execution loop on a team is just 10 functions working in tandem, each one a short novel of code.

My personal gripes about teams

I stay away from teams. Due to licensing considerations, I can make a waaaaaay better game on my own than I can in a team. Adding another member to my team, in game design terms, is like cutting off my own foot to lose weight. The gains are almost irrelevant, and I lose access to 90% of the 6 or 7 thousand dollars worth of tools and resources I have acquired over the years. So teams and me, don’t really get along, unless it was at a company maybe, but they’re likely to hire people who know C++ like the back of their hand. With a computer science degree, and 4 years professional experience in the industry, so that’s harder to achieve, and not even really what I want. I would like to make my own games, in my own time, and write about game design for a living.

Conclusion

C++ is a very powerful tool for an expert, or a professional. If on the other hand, you are a more indie dev focused character, or a hobbyist, making your own game, or just beginning to learn, you should start with the easy way, and then get used to advanced techniques and learning languages at a later time. Don’t bite off more than you can chew.

Related Articles

Responses

Your email address will not be published. Required fields are marked *