Is it really worth programming with C++?

I’ve been a programmer for six years now and been using Unreal for a year and yet I struggle to get things to work on it. I notice that the overwhelming majority of tutorials are in Blueprint and even the official documentation is way better done compare to C++ which has poor or non-existent documentation and things that in Unity are simple to do like singletons for example, I have to look outside for tutorials from unofficial stuff. This kind of thing makes me wonder if using blueprints to launch a game are really that bad…

1 Like

Yes IMHO.

I’ve shipped several commercial products with zero blueprints expect where required for animations. Can’t imagine working on anything super complex and not being able to diff, merge, revert, etc. every piece of game logic (code) added by anyone. Code is much more concise as well. A 10 line nested for loop in code might take an entire page of blueprints. :woozy_face:

Also - how does a major refactor of blueprints work? Seems like a huge hassle compared to manipulating some C++ strings.

4 Likes

You’re right, your point of view was very clearefying. I don’t even know how versioning control would work with blueprints

Use whichever you want. You can make even a complex game entirely in BP. For the most part it simply does not matter which you use.

3 Likes

I’d say yes. It’s more difficult to learn ofc, but you get a lot more control (and a lot more errors and engine crashes too =) ). A lot of things are impossible in blueprints but are possible in c++;
Plus code is much faster. If you make a simple loop with 100000 iterations (like simply a printstring or something), code will do it instantly, and with BPs your game will freeze for about 0.1-0.2 seconds. I know that’s not a viable scenario for a real project, but a lot of functions, if done in code instead of BPs, will increase performance.

3 Likes

Hi @LeTenebrae
It’s a matter of taste, I’ve seen A.I. and very complex code in BP only, well structured and with very organized functional blocks you won’t have any problem, if BP are not well created, it’s a chaos. That’s my experience, anyways this is very similar to the the eternal question “I9 or ryzen”, “nvidia or amd”, both works, both has limitations and both has pros and cons.
But anyways, BP works for anything if you are use them properly.

For versioning control you must have separate blueprints inherited and classes with a correct layout between parents and child or classes, and 2 devs can’t touch the same BP, that’s the only way I know to proceed, it’s a different way of thinking, different than in C++ but absolutely possible. If there is another way I don’t know.

Hope this help you, good luck!

1 Like

@Scionate 100% agree :wink: BPs are great if used properly.

I would definitely learn to become comfortable with c++ as there will be times no-doubt that you will not find a BP node to do what you want, or you need to chase a function to see what is actually happening under the hood.

You don’t NEED c++, though. I think people generally hate on BP performance, but most of the time the bad performance comes from bad design.

1 Like

After opening the subject I realized that probably Unreal was made to give enough flexibility for the programmer decide to balance or solo which type of programming he wants to choose. I did’nt want to bring a discussion about “BP vs C++” because I know it’s not about that since every C++ can be exposed to BP, and that’s the power of Unreal. C++ can still be complicated in the overall but exposing some functions or classes sometimes save me a lot of headache and time :smiley:

Definitely. I mostly use blueprint to quickly prototype things or for “Game specific logic” or more artist facing things that are supposed to be quick to iterate on.

Blueprint becomes extremely hard to manage if you have any sort of complex code.

Also any kind of refactoring or merging code with teammates is a nightmare in blueprint.

C++ is text, and is easy to repair or refactor. Blueprint tends to have the class associated with each node. A lot of times I have to manually redo many nodes as I copy paste blueprint around since it’s strongly tied to a specific class.

In C++ I can just copy paste this code and it’ll compile:

SomeObjectReference->CallSomeFunction();

But in blueprint, that node will fail to compile since it’ll think it’s strongly tied to some class but now my SomeObjectReference is actually an instance of a different class but has the same functions.

There’s also a lot of stuff you simply can’t do in Blueprint. I’ve seen assets on the store say they can’t support doing something since they want to only be purely in blueprint and the author isn’t confident in their C++ abilities. I on the other hand manage to pull off a lot of things in our game that aren’t even that complicated, but simply impossible unless you write a few lines of C++.

For example, I made my list UMG widget able to always have a scroll bar, which is only possible with the Scroll Widget. But the list widget for whatever reason doesn’t let you customize that, and I added a few lines of C++ and made a custom C++ subclass of the UMG list widget that hooked it all up.

I even had to write some Blueprint function libraries that call into C++. Like when working with AI, I just made a simple 1 line function that returns the C++ constant for INVALID_LOCATION so I could set that value in my AI blueprint code.

2 Likes

One example I come across a lot on the internet is locking/inlocking axes of object rotation and/or location at runtime. You can’t do that in blueprints; but in C++, it only takes 3-4 short lines of code.

well if you expose it in blueprints it could also be done in blueprints and it would be just a node. :joy:

I like this video, hope it will help you find your balance between C++ and BP.