Blueprints vs. C++: How They Fit Together and Why You Should Use Both
It's not an either/or decision. Learn what makes C++ and Blueprints different, what they have in common, and how to use them together effectively. We'll also learn a thing or two about performance optimization and some basic software design concepts.
Read the article version: awforsythe.com/unreal/blueprin...
00:00 - Introduction
01:29 - Common Ground
02:18 - Design Concepts: High-Level vs. Low-Level
03:10 - Design Example: Weapon System
04:44 - Design Concepts: Scripting vs. Programming
06:44 - C++ and BP as Programming and Scripting Languages
08:54 - Video Scope: Where C++ and BP Overlap
09:52 - Performance: How C++ and BP Are Compiled
10:48 - Performance: Comparing Compiled C++ and BP
15:23 - Performance: Conclusions and Profiling
17:35 - Project Organization: Class Design
18:54 - Design Concepts: Types and Dependencies
20:33 - Project Organization: C++ Modules
23:05 - Project Organization: BP-to-C++ Dependencies
24:36 - Design Example: Refactoring from BP to C++
28:31 - Design Example: Doing Everything in C++
31:03 - Design Example: Basic C++ / BP Interop
33:11 - The Traditional Programming / Scripting Split
33:47 - Design Example: Blueprint Function Libraries in C++
34:13 - The Main Event: C++ vs. Blueprints (it only took 35 minutes)
34:52 - BP Advantages: Assets, Visuals, Scripted Events
36:54 - BP Advantages: Ease of Use
38:34 - C++ Advantages: Performance, Fundamental Code
39:56 - C++ Advantages: Engine Functionality Not Exposed to BP
41:45 - C++ Advantages: External Libraries
42:18 - C++ Advantages: Diffing and Merging
45:05 - Personal Preferences
46:39 - Outro and Thanks
Patreon: / alexforsythe
Twitter: / alexforsythe
#UnrealEngine #UE4 #programming
I tried a hybrid approach where I implement low level stuff on CPP and high level on Blueprints. However, Blueprints are really not stable. For one they break if you make any refactoring in CPP code while other CPP code gets automatically refactored. Second, even for simple stuff CPP code seems to be better organized than blueprints. Third you can get various problems with blueprints when making version upgrades but CPP is almost always flawless. I once spend 2 days fixing a blueprint related problem that occurred on version upgrade, and fix was appearantly "renaming variable to something, compiling it and renaming it back to its original name" So yeah, now I'm just slapping CPP at everything I can wtih minimal blueprint interactions. Not because i'm "real programmer that does everything on CPP" but because I had much more stable experience working with CPP than blueprints. I still setup paths and references by extending classes via blueprint. I just try to keep blueprint "code" to minimal. I wish there was a way to "code" blueprints. Blueprints are in background just code organized in graphical manner, It shouldn't be too difficult to expose underlying code in a nice manner in text form for us to write blueprint scripts. I really like the concept of having high level scripting language and low level C++ for performance but I don't think blueprints - from programming perspective - work that well. Stuff that I can code in 20 lines of CPP end up taking massive visual area and turn into spaghetti with blueprints. Yes my lack of visual organization has role to play on that as well but still. I really wish we had Python instead of blueprint
This is a well-thought-out, reasonable comment. I held pretty much this exact opinion earlier in my career, and I still agree with a lot of your points today, so my response is "here's some additional food for thought" rather than "go to hell you're wrong." First, just to get the obligatory cranky-old-man, you-don't-know-how-bad-we-had-it talk out of my system: Blueprints have come a long way since their initial launch, and they're remarkably stable these days. Don't believe me? Go back to Unreal 4.1 and try working with Blueprint interop! Back then, the editor crashed if you looked at it sideways! You don't know how bad we had it! ...OK, sorry about that. On to some real points. Anyone who's ever made C++ changes only to have the editor crash when loading a Blueprint can understand what you're talking about re: Blueprints feeling unstable. If you're one of those people, and you only take one thing away from this comment, make it this: Core Redirects. docs.unrealengine.com/en-US/ProgrammingAndScripting/ProgrammingWithCPP/Assets/CoreRedirects/index.html If you refactor something in C++ that has downstream dependencies in Blueprints, then you just slap a line or two into the [CoreRedirects] section of DefaultEngine.ini to record the old and new paths/names for the classes/properties/functions/etc. that you've renamed or moved. The Engine takes care of the rest: all references (including references from Blueprints to native types) go through this automatic translation process and will be seamlessly fixed up. That's a very simple, straightforward fix that applies to the majority of cases where you need to preserve Blueprint compatibility in response to C++ changes. If you find working in C++ to be fun and carefree and light-as-a-feather, only to be crushed by the sudden thought of "oh god, but what's going to break in Blueprints if I make this change," then you need CoreRedirects in your life. There *are* other cases besides simple renaming/moving, where you might have to do something slightly more involved, like deprecating old properties and patching their values into new properties on PostLoad, or, in rare cases, attaching a debugger to figure out why something's crashing on load. These are costs of a workflow that supports Blueprints. These are also important skills to have. You just have to weigh those costs honestly, and you have to appreciate and learn those skills. After that, the decisions are yours to make. I've seen people who are weirdly, counterproductively resistant to Blueprints because they got frustrated with these sorts of issues and just decided "I know C++; I don't need to bother with Blueprints ever again." I nearly fell into that trap earlier in my career. The problem with that line of thinking is that it stops you from learning *why* those issues are happening and learning *how* to anticipate and avoid them, and it biases what should be an objective decisionmaking process. You're not doing anything wrong by choosing to use C++ for most things, as long as you're not insisting on using C++ for things that it's objectively ill-suited for (direct asset references, scripted sequences, etc.), and as long as you're not hamstringing Blueprint-savvy people on your team by yanking tools out of their hands. The workflow you're describing (i.e. a thin layer of Blueprints on top of mostly C++, where Blueprints handle asset references and visual details but have minimal gameplay-relevant logic) sounds pretty much like the workflow that traditionally-organized gamedev studios tend to use. There are plenty of good reasons why that's a common approach. Based on your comment, it sounds like your reasoning isn't "Blueprints are terrible," it's just "I have weighed the costs and this is the workflow that makes the most sense for what I'm doing." More power to you - my only advice is to make sure you're keeping an open mind and reevaluating based on your continually evolving understanding of how things work *now*, not based purely on past experiences.
@@AlexForsythe I truly appreciate the information and thanks for the answer! Going into the future, I will keep your valuable advices in mind and I agree that I shouldn't just ditch blueprints because I had bad experience with them but instead try to learn and understand root of these issues so that I can become a better engineer.
@@SomeKindOfMattias As of C++17/20, how much easier is it to write higher-level expressive code in C++?
@@DefinitelyNotAMachineCultist I'm far from an expert in C++, coming from C# fairly recently. That being said, you can use things like templates, but not expose to blueprints (I think they're working on better template support). Subsystems are great for abstraction out aspects of a system. Gameplay Tags are awesome for a host of things. n general though it's more about knowing a and implementing design patterns, and that doesn't requite much from the actual language
@@AlexForsythe I'd have to back up OP here. Extending Blueprints in C++ seems really interesting, and is something I plan to support in my own engine. Well, something like it, not Unreal's Blueprints, but a visual scripting compiler that you can hack at in C. Something for UI specifically. It would be nice to have a more powerful scripting language to handle asset references and gameplay code like you mention. The only problem I've heard of wrt Blueprints is performance at scale. Doing *everything* in Blueprints has a performance cost, but most may not see it AFAIK.
This is like watching the Bob Ross of unreal engine.
second that
Everything about this video is a masterpiece! The voice, the video animations, and obviously this immense knowledge about Unreal Engine. Thank you.
Couldn't have put it any better... Well besides for him not saying, 'Happy lil rockets' or whatever
@@-abs- it feels like Bruce Wayne is giving you a lesson on business.
nailed it
I pray you're at LEAST the head of engineering at your company. So few people have the capacity to delivery complex topics this coherently.
The quality of this video is exceptional, the pacing is incredible, the information is invaluable, and your explanations and included examples are extremely helpful. I am so glad I found this video, and I still can't believe that this quality of video is available for free. Thanks for making this.
I'm really glad you humored the "real programmer" because I never saw the real value of blueprints until this video.
totally agree
Have you tried using c++ with UI vs the UMG editor?
@@chancylvania UI with UMG seems waaaay bad-optimized, but I don't care too much about the overall performance impact. In fact, I prefer to use both C++ and BP when I'm working with UI.
@@morderus0033 why does it seem badly optimized? I’m talking about the widget UI bp object you can create. Maybe the UMG editor is something different
@@chancylvania maybe I am not the best programmer, neither have the best practices, but doing a Main Menu using only blueprints causes the game to crash or just bug, if I try to do something more complex
I was under the assumption that all functionality was better in c++. I’m glad you explained use cases of blueprints that are more than FX. This was amazing.
I would prefer C++ a lot more if not super long compile times. Until I buy better CPU at least even then still blueprints would be faster to compile. But lot of node spaghetti can be fixed with C++ too. So best is use both.
You make the best content by an extremely large margin, and this includes the official UE4 stuff imo :D
I learned more from this 45 minute video than Ive learned from hours of other tutorials. thank you
This video is so high quality, I've never seen such a high quality video before explaining UE topics. Please guys, give him at least one month of patreon support! I'll be doing it now too. (edit it's actually per release of video, not per month)
At exactly :29 into this video I saw a Cursor duplicate and someone started writing two functions at once and knew I had stumbled onto something special here. How does this have so few views?! This is the single best unreal video I've seen (and yes I'm including their official videos in that comparison). The production quality, pacing, everything is A+ top tier. For the love of God I hope you keep making these--this channel deserves way more credit than it's getting currently.
Best Unreal Engine teacher! Can’t explain how good this videos are. Best mix of “How’s made” tv show and game development 😆
Your content is unbelievably unique. There is quite literally nothing like it. Nor the quality you produce. You're the Bob Ross of unreal engine. Losing you is the day we all lose a part of unreal engine.
As a beginner in Unreal Engine . I needed this today . Vielen Dank !
This video is incredible! It answers a vast array of questions about game development in UE4, all in a compact packaging. The voice of the narrator is pleasant, the animations are extremely good and fit the content perfectly and the subjects that are covered are exactly what I was looking for. Look no further! All the answers to your questions as a beginner game developer in Unreal are here!
Uhhh. This is the best unreal engine video on the internet. You are amazing, dude.
I came here to learn about the differences and benefits, specific to unreal. I ended up learning things that change the way I think and create as a programmer in general. Thanks!
This video is so well written that even though I have no experience in game development and Unreal, I left the video with a general superficial understanding of game architecture, C++ and Unreal in less than an hour, even if that wasn't the focus of the video. Literally one of the best educational videos I've ever watched on KZhead, in general.
Another advantage of C++ vs Blueprints: game debuggability outside of Editor. This is a major one for me, importance of this grows with the scale of the project and the number of supported platforms. You won't be able to debug blueprints directly anywhere outside of Editor.
Am I the only one who felt like standing up and clapping at the end of this video? Amazing work alex, thank you for your time and effort 🙌
Hello Alex, I am a Unity dev' learning Unreal and I wanted to let you know that you did a wonderful job teaching how C++ and Blueprints should/can be used in a project. I thank you very much for sharing your knowledge on this, and doing it in the cleanest and most understandable way I could imagine ! Have a great day and thank you again !
I hope Alex Forsythe is doing ok as I haven't been able to find any follow up content. But as a software engineer with 20+ years experience just playing around with UE - I found this to be a masterclass. Great work, wish there was more, hope you're OK and just busy working on some awesome stuff and don't have time for social media.
Thanks! I'm glad you found it useful, and I appreciate everybody's comments. Indeed, I'm just busy with work and life - these videos took a ton of effort to produce, and I made most of them during a hiatus when I could devote the majority of my time to them. These days I'm more concentrated on paying the bills, which Unreal tutorial videos sadly don't do as well as a full-time software engineering job :)
@@AlexForsythe Good to hear! Seriously you packed in so much general wisdom in this video about software engineering I was compelled to watch it to the end :) The extra UE C++ vs Blueprints was just a bonus.
@@AlexForsythe Hi, I just stumbled on this video and I loved it. Glad you're well. Have you considered making shorter unreal c++ videos (5-10 mins) and instead of making these beautiful graphics and animations, you just sketch diagrams on a piece of paper for example? Maybe it would be easier to produce videos that way until you grow your channel and Patreon to the point where you could sustain yourself with this content. Anyway, I just watched a couple of your videos, and as Alex said, they are a masterclass. Great job, thanks for these videos and I wish you all the best! :)
I'm trying to learn UE and am a nine-to-five developer (on the java platform). Your quote on being a [hardcore] programmer which don't want to resort to silly point and click blueprint; called me out. I wanted to do achieve everthing in C++. Until I watched this video. Thanks for calling me out with my narrow minded attitide and helping me adjust to a proper learning approach from here on.
This is amazing
Best dang UE channel on KZhead. Thank you for everything you do!
I wish I would have seen this video years ago. I learned more with this one video than I did in the last year of tutorials. Thanks
How someone can watch this and not feel obliged to subscribe is beyond me, great work and very useful information.
I really appreciate the effort into the video editing quality as well as the structure of the content. Please continue creating more content, you're doing great work!
For somebody like me who has been using blueprints for years and started to learn C++ afterward, this video is a gem! a lot of the things mentioned seemed common sense to me while learning C++. I love still love quickly designing or testing codes in blueprints then writing them in C++. The time it takes to compile, close editor, recompile, crash and restart due to missed pointer check, its just crazy. Needless to say that a lot of the time, you write the code and you're sure its right, but it still doesn't work just because the live coding sucks at times or its that nullptr check you missed that ends up crashing the engine and there you miss all your unsaved work! for all that headache, its easier to quickly iterate in blueprint, tweaking..etc then transcribe the code. Blueprints are simply one UE best features!
Good grief this is one of the most beautiful explanations of anything ever. Such great helpful visual aids. You've taken a topic that is a really tricky one for beginner/intermediate unreal users to understand and spelled it out in elegant simplicity. Thank you so much. Please do more tutorials. I hope you can monetize in some way. Would love to support you creating content like this!
Awesome video as always! Very detailed and in-depth. This is the quality that only few people achieve with their tutorials. Keep up good work! :)
I got my first AAA job back then thanks to you and your MOBU tutorials. Now history repeats with Unreal engine. Thank you a lot!
i have been waiting for years for something like this. Bravo
The best video I've seen that talks about C++ and Blueprint in Unreal!
OMG, this is the best visual lecture on c++& UE4 I ever seen in my life. A truly masterpiece. linking your explanation with visual animation of "what it mean and how it work" make your point more clear than reading thousand & watching 100 hours of udemy ,I'm god damn serious. YOU ARE THE BEST . I can't wait for future uploads
That's the kind of explanation I have been looking for years! Thank you!
Incredible video Alex, thanks for creating and sharing this!
Incredible content! Very clear & concise - keep it up!
By far one of the best explanations I've seen. I'd love to see a production quality build along series. It's rare to see these types of videos with proper code architecture using modules etc.
This entire playlist is pure gold, thank you!
This video was so freaking good. Thanks for taking the time to make this!
The fact that this is free is insane... thank you so much
This is so well written and narrates. Nicely done!
You should really do more videos with topics like this. One of the best KZhead channels for learning Unreal here. Really appreciated!
Absolutely fantastic video, clear concise and well relayed information. Thank you and keep it up!
All the reference material included in this is amazing...thanks for all the effort.
crazy good production quality and extremely informative
A very articulate video about a topic difficult to summarize, with production quality off the charts. Good job :)
One of the best coding explanation video ive seen in a long time, good job!
Exceptionally good video! I'm so glad to see someone talking about a game engine who has both comprehension of software engineering concepts and the ability to explain them in a relatable manner. I'd certainly love to see more content with this tone.
Alex you cannot just make such a awesome video and then disappear from KZhead
This is the most informative, educational video I have ever experienced on KZhead, by FAR. Thank you for your time and work put into this content. I have learned a TON!
One of the best videos on Unreal I have ever watched, extremely well done
Your videos have been extremely helpful to me. Thank you for spending the time to create such high quality content!
This channel is a gold mine. 10/10. I hope you continue to create content for the community. It's not easy to find decent tutorials like this on the internet
Now, this is some actual good content. Advanced tutorials with this amazing production value are kind of rare.
true
This was beautifully illustrated. Thanks!
This may be the highest quality educational video I have ever seen on KZhead. It is extremely well researched, edited, and illustrated. This is not your typical KZhead fare. Thank you.
Thank you, amazing breakdown. Had me glued for every second of the video!
Stunningly professional and valuable explanation.
Been at this for a long time and this is genuinely the clearest and most informative video i've seen pertaining to coding in Unreal
This video was super useful for me!! I'm a hobbyist who's learning C++ after already understanding blueprints, this video actually gives me a great base of understanding for what each is used for and where to start. The direct comparisons were especially helpful. Subbed.
That was really fantastic! These playlist is a hidden treasure.
This is exactly what I was looking for, I am new to unreal and got some basic clarification about Blueprint VS C++ but now it's all clear! great work thank you!
Just had to leave a comment about how well this video is edited and presented. Incredible visuals, flow, visibility, explanation....This must have taken days to edit. Thank you so much!
Best video ending the debate on C++ vs Blueprints I have ever seen, thanks for all the effort put in this video.
Man, you nailed this breakdown/comparison perfectly! I was a little hazy on the details up until now, but your video really cleared things for me, so thank you!
This is pure gold for me and I appreciate your efforts to teach us! Thank you very much! 🔥🔥🔥
This was easily the most informative video that I've ever watched. Not only did you explain blueprints and cpp well (where I literally don't do game design and only web apps with JS), but you introduced and explained game development philosophies that I've inferred or heard about, but in a way I can tangibly understand how to apply to my projects. You have provided me with invaluable information that I literally could never even get a glimpse of with Unity because of their tutorials. I am very excited to start playing with Unreal and this only helped. Thank you.
This is so succinct and thorough, well above and beyond my expectations.
I never subscribe to any channel, I just subscribed to this channel very well done I needed this years ago, Thank you!
This is such a well-researched, well-organized video that covers everything I wanted to know (and more) coming from Unity. Thank you for all the hard work you clearly put into this.
Best explanation I've come across, thank you 😊
Top quality editing and explaining. Great PSV. I didn't even know UE offered BP diff/merge capabilities individually, that'll sure be useful.
Really great video! I shared this with my colleagues and I really appreciate your effort put into this!
This is the most informative and best presented game Dev channel on KZhead. Thank you!
The best video that I've seen so far about the c++/blueprint topic, thank you so much, I learned really a lot!
As everyone else has said: phenomenal work. You’ve done an outstanding job explaining a variety of topics. Thank you very much for your work!
Love what you're doing! Unreal c++ was in need of this kind of content!
This is actually very high quality content here, subscribing for more. Keep up the good work!
Excellent video. Honestly, the best educational content that I have ever seen for Unreal Engine 4; bar none.
Amazing explanation, excellent editing, thanks so much for making this available for free.
This video is amazing. Thanks a lot for this explicit demonstration! Bravo
You're the first person who has explained C++ in a simple manner and demonstrated the code alongside its equivalent in Blueprint. Thank you!
Incredible video! Well played!
I am forever grateful for sharing these videos about the architecture of a video game and about how UE works in general. Every time I decided to start a project, I had exactly these questions: - How can I make sure that my code is clean, maintainable and scalable? - When should I use blueprints? - What design patterns are commonly used in a video game? - How do I organize my project? - How do I refactor a Blueprint to C++? - How do large companies handle huge and complex projects? All that and more has been explained in your videos, facing all the problems and with examples. I believe that any programmer has his mentor, for me, it's you. I'm speechless, thank you...
This video should be on start page in UE documentation. Awesome work, Alex!
Hey Alex! I just wanted to say thank you for the excellent videos you've made on the topic of Unreal Engine. They have really helped me get a better understanding of the engine, code in general and how it all ties together. It has made me a better developer and gets me excited to keep learning. I've subscribed and rang the bell in hopes that more videos will pop up in the future. But if they don't that's fine, you have my gratitude either way. Thanks again!
UNBELIEVABLE. Just an incredible master class on what a masterclass should look like.
This is one of the best technical videos I’ve ever seen
I feel like I am watching educational TV here. And I mean this is the most postive way possible. There is quality control, things are layed out clearly and with specific intent. It feels like it has professional producers behind it. Well done.
With 15 years of C++ experience, I started using UE5 with blueprints because the engine is vast, and I found that blueprints helped a lot in understanding it. Now I use blueprints and C++ side by side.
Very Informative video, got a new perspective on blueprints and C++.
Well done dude, i appreciate the effort you put in editing these amazing videos.
This is probably the most useful video on Unreal that I've seen since I first started learning a year ago.
The quality of your videos is incredible, thanks a lot for this! I'm pretty familiar with these concepts but I wanted to watch your video to see what you thought about it all. I just wanted to say that it's true that it's great the Blueprints allow non-programmers to do stuff... but the bad thing is that usually what they do with it is pretty much always messy, unordered, inefficient and so on! My point is that people that "don't know what they're doing", usually tend to increase the complexity of a project when adding even small logic to BPs. In my opinion, the ideal scenario would be to have the Blueprints only determine the visual aspects of whatever is being done, and a middle layer language doing the actual logic in between C++ and BPs. I've been waiting for something like this for years, and there are even many plugins and projects that allow to use a textual scripting language, but I'm hoping that with UE 5 Epic Games will surprise us with something official (maybe Python?)!
Underrated, this is one of the best general game design videos I’ve ever watched and teaches fundamentals that are never normally taught but are extremely important.
This is insane quality, wow! Great Job, thanks for sharing this valuable information for free!
This video is awesome. You are so thorough and the animations are beautiful. It deserves a lot more likes
I must say that's a very professionally made video. Well structured, well narrated, cool motion graphics. And it's very useful for me.
This video is amazing in structure, clarity, visuals, content and... helped me INFINITELY on the high level stuff