I’m asking because even though I’m currently going through a book on Unreal 4 C++, I’m still debating on wether or not I should use it or Blueprints for something like, say, a 3D platformer or something like that. And I’m asking this for those that developed for both PC and consoles, BTW.
it really depends on the application.
Blueprints are technially slower and slightly less functionality than C++. There are some networking functions that are exclusive to BPs. Generally, the rule of thumb is that scripting is for blueprints and actual development, platform based programming requires cpp.
++1 to this.
For me best way is to create custom C++ functions or classes. Then connect it all in blueprints.
For eg. sort array, then process results, then display it all in widget.
For this i would:
- make sorting for my structs in C++, probably insert sort or bubble because size of array is usually tiny.
- then in C++ make simple functions (pure) for all calculations etc.
- make either class in C++ or just blueprint to load, sort and process data, preferable blueprint because this is easier to tweak things.
- use blueprint widgets to display it all
Ps.
You asked solo devs, however in teams C++ is better because of possible version control conflicts with binary files (blueprints are those when saved), and C++ is just text, so apps like git can handle conflicts.
What are your long-term goals, as that’s important to answering this. Basically don’t make your life harder than it needs to be. BP difficulty is 1 out of 10 maybe. Whereas C++ as applied to game dev? Easily 10 out 10… However, C++ will unlock the engine for you… But do you actually need that? If your goal is ultimately to work in the industry long-term as a coder, then go the C++ route immediately, no question.
However, if your main goal is to test out a game idea and you’re not sure yet if you want to be a hardcore coder, never mind if your game idea will go anywhere, then just stick with BP for now. C++ as applied to game dev is harder than using it in most other industries imho. That’s just the way game dev is, its quite flaky, an inexact science… And yet game engine tech itself is seriously heavy in science and math.
C++ 100%.
- All logic in one place
- You can debug and/or detect errors by diffing files in a versioning system and not even having the editor or visual studio open
- Sweeping changes to game classes or variables? Its just a search / replace of text, easy
- Readability - a few lines of code can be equivalent of a screen full of blueprints
- Find all logic references to a particular class, function, variable, or asset? Simple text search.
- etc.
C++ not %100 necessary. I know C++ but I refuse to use it with Unreal. People really tend to think Blueprint has some limits against C++ but it’s not. There is always a work around even with cross platform apps. Programming is a refined tool for people and needs to be simplified by merging complex structures continuously. Blueprint is a strong refined system.
Also, Blueprints are not slower and if you wanna speak about functionality, I’d say 50/50. Since you can add two nodes instead of writing ten or twenty lines of codes most of the time, it’s pretty functional against C++ useful structures.
To my knowledge, there was 12 milliseconds difference between Widget Canvas of Blueprint and FCanvas Function of C++ and it was the biggest difference (C++ was fast). As I can remember, this is also fixed and now Widget Canvas equals to 0.2ms with FCanvas. If someone know a function that really faster than Blueprints, let me know.
Blueprint is quickly becoming irrelevant with the use of ai assistants. Blueprint is extremly slow compared to C++ and is only good for keeping asset references.
Blueprint can be useful for quick prototypes but that is about it.
But what kind of functions are slow compared to C++ right now? And what is the difference as milliseconds? Once someone told me that there is no way to create Runtime Fbx Import without C++ and it wasn’t %100 false but I was able to do it %90 blueprint. There are many plugins for that in marketplace and you’ll notice they are at least %90 C++. Once some other guy told me that there is no way to create runtime gizmo without C++. But I’ve created it with %100 Blueprint and totally zero C++. Blueprints has some functions that really slow against C++ that is correct and the most known is “Get Actor Of Class” and “Get All Actors of Class”. But there is Dynamic Casts to work fast. Enlighten us by being specific so we can all improve.
It is not the kind of function it is the amount of nodes in the Blueprint. GetAllActorsOfClass by itself is not slower in Blueprint but the forLoop used to traverse the returned actors is very slow in Blueprint because it has a lot of nodes it has to move through.
That’s right but BP actually different mentality when it comes to reference to other things, espacially with arrays and loops. Refences must be used carefully in BPs and you won’t get slowed down. Almost all BPs and their nodes are C++ structures so there are no proper differences. Reference part is another thing tough. I’ve seen lot of programmer that worked coding for a long time and they mostly couldn’t get the BP programming because it’s actually different mentality. I believe that this is a very good refined system and eventually coding will be changed to it or something like it.
Edit: Complex and “full of node blueprints” may behave slightly different (and/or slow) in editor than packaged game. This is probably because BPs not fully compiled in Editor like C++, until packaged. Not sure about this specific information tough, I just assume.
I vote Blueprint.every one knows C++is better for performance.but CPP is harder to learn then BP.as a solo dev i think we don’t have enough time to pick and choose which programing tool is better?because there always are other things that are really important waiting for us to learn.like Niagara,material,animation BP,Level design.every single part of them will take enough time from us.programming is just a little part of game dev.how leisure I must be so I can pick and choose between CPP and BP?
for speed, it really depends on your setup.
blueprints have overhead for every node placed, and its easier (i feel) to make mistakes if you dont know how memory is handled in blueprints (pure functions are never cached for example). a for loop in blueprints will automatically be slower, regardless of how the memory is accessed, simply from the amount of nodes.
honestly, for like 99% of cases, it really doesnt matter; treating the whole situation like a question of optimization and really how necessary it is in that instance is best. for the few times it does matter, ill just write a small function and expose it to blueprints. something like converting an array to a set then back to an array (to remove duplicates) id do in C++. its like 4 lines of code for a substantial speed increase.
for me its a readability thing. i find it difficult to read C++. im not sure if its because its just so much text information, if its harder for me to follow the data type of each variable, or if the nice to haves of blueprints put me off C++, but im really comfortable in blueprints and i easily get way more done in blueprints than C++.
that being said, converting a blueprint to C++ function is dirt easy, so anything expensive or anything where a special feature of C++ is required, i just make a C++ function and expose it to blueprints.
additionally, the hand holding that blueprints provides is not to be understated. people are like “but thats baby code”, and im like, “nah is safe and i get ■■■■ done”. for loops that dont crash when you got of bounds, objects that you can be null and not crash your program, the ability to bulk update variable names everywhere or remove unused variables from your blueprints, ect.
honestly, the pythoness of blueprints, plus the speed and low levelness of C++ makes unreal engine extremely versatile.
Everyone is going to say it depends.
I won’t say it. What nonsense is this saying it depends?..
-
Everything related to the visual (HUDS, Skeletons, Anims, Characters, Maps…) Always Blueprints. Why? It is too complex to do it by hand. Furthermore, every 4 or 5 months when Unreal Engine is updated it breaks your code… it is not worth studying the C++ of everything that is visual.
-
Database logic or calculations for multiplayer games or specific functions, do it in C++. It is complex but it is necessary since you are going to have to pass parameters to DB functions.
The logic will rarely change since they will be native functions even if they are from Unreal Engine. -
You could do a mix between them if you feel comfortable. But that is my recommendation to be more productive.
I think it is the best advice in 20 years.
ㅤ
ㅤ
ㅤ
But if you want to work Niagara in C++… that seems fine to me.
Bold statement maybe, but its the truth actually… Here’s a relevant example below. The word ‘Schadenfreude’ was invented for this. As a C++ & BP coder from degree to grave here’s 2c fwiw… Whenever possible, take the easier route or whatever works for you. Don’t feel guilty, its ok. JFDI…
I personally go for C++.
I cannot stand nor read any blueprint code. It always becomes a mess and it takes ages to debug and/or find where the issue is. I only use blueprints when it comes to UI as it makes it easier to work with and faster with the knowledge I have.
TL;DR
C++ > Blueprints mainly over speed and readability.
As you mentioned, BP vs. C++ stands relative to developer. One should pick to their liking. In both situations, developer has to know what they are doing to get proper results.
Thanks everyone. I think I’m able to make my choice now.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.