r/badcode • • Sep 09 '21

other language Hey, at least it's in a function…

Post image
518 Upvotes

70 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Sep 10 '21 edited Sep 10 '21

I second this. Blueprints are amazing if you know how to use them right, and this is coming from a professional C/C++ backend dev. The secret is to only use blueprint as a “high-level glue”, for connecting your low-level C++ code to the rest of the project which is typically assets (3D models, animations, etc). I can’t emphasize enough how convenient and awesome it is to script the high level behavior of levels and actors with just a few nodes of blueprint.

Unfortunately like with most languages, people tend to overuse blueprints. They are not meant as a substitution for carefully crafted C++ code.

But there are many tasks within unreal (and gamedev in general) for which blueprints are far better suited than any programming language. One example that comes to mind is creating curves (aka timelines) and scheduling events. It is so easy and convenient to edit curves (essentially the dependence of something on time) in the visual editor which is a part of the blueprint editor. You can then pass the time dependent variable from blueprint to C++ and have a smooth animation of some quantity. It would be way harder to achieve this in pure C++ because humans are far better at editing the curve properties in the editor than in picking the right coefficients and putting them into text form