Having a heart attack yet from looking at the featured image? Yeah, it’s probably Lovecraftian in nature; something so ancient and terrible, that people go mad from only looking at it.
However, jokes aside, if you’ve opened this article — then you probably want to see what I have to offer. There won’t be any revelations here (¯\_(ツ)_/¯ ), but rather a humble collection of tips and tricks for using a blueprint editor, that I’ve learned during my time with Unreal Engine 4 and that helped me a lot. Some of them may be kind of obvious, but discovering them made my blueprinting time more enjoyable and now saves a lot of time.
This is the first post in the Tips’n’Trickscategory, and I hope more are to come x)
1. Tidy up
Now that I’ve properly scared you with the featured image (I dare you to take another look at it), let’s make sure you never end up with something like that.
Use functions and macros
If you want to know the difference between the two, just take a look at the functions vs blueprints section in the official UE4 documentation.
For some reason, people (I mean, mostly novices, but still…) are afraid to use functions and macros. Well, don’t be! Blueprint can quickly become cluttered with hundreds of nodes, and sometimes you just reuse the same group of nodes over and over again. Why not make a function or a macro out of them?
You can either go ahead and explicitly create one, or, if you have specific nodes you want to include in your macro/function, just select them, right click on any of them and select ‘Collapse to Macro/Function’.
Then you can easily use it wherever needed, instead of copy-pasting or placing and connecting nodes all over again. Even if it isn’t reusable, it’s still can be convenient to collapse nodes to function/macro — for example, it’s much easier to understand a “Calculate galaxy size” macro node than couple dozens of math nodes.
Add reroute nodes
It’s not cool if you have spaghetti hanging everywhere in your blueprints. Simply double-click on any connection or search for reroute node:
This way your blueprints will look much nicer and cleaner.
Did you notice that every variable and function have a “Category” field in their details? It’s not a random field that has been added ‘4 teh lulz’, it’s another way of keeping your blueprints organized. You can name these categories any way you like, but name them rationally — otherwise, you’ll just lose track of where is what. Grouping variables into categories is only a visual thing, and doesn’t directly influence your blueprints per se, but still it’s a nice feature that will present all your variables in nice groups instead of all of them being in a single list.
Comments are another useful thing for organizing your blueprints. Just select the necessary nodes and press “C”. It will create an outline area around selected nodes. You’ll be able to change the title and the background color — this way you can recognize different parts of your code even from a bird’s eye view. Moreover, this way you can move all those nodes together just by dragging a comment.
2. Follow naming convention
The naming convention is a set of rules on how you should name different files/variables/functions and all of the other stuff in programming.
Not to take up the space of this post, I suggest you check out the official naming convention for assets in UE4 documentation. But here are the very basics:
- All names should be in English, and English only
- There are prefixes and suffixes
- Prefixes are determined by asset type. For example, BP_Character01 for Blueprint
- Suffixes are used less often, for example in textures: T_BrickWall_01_AO for Texture, Ambient Occlusion map
- Use numeric values (two digits) for identifying asset variants: T_Grass_01, T_Grass_02
As for the variables/functions and other coding stuff naming, blueprints is a more forgiving environment, and you don’t necessarily need to bother yourself with CamelCase and camelCase — even names with spaces in them are accepted. But still, try giving your stuff sensible names, because figuring out the difference between “PlayerVariable” and “PlayerVariable2” is next to impossible, while the difference between “Health” and “Mana” is pretty obvious.
3. Get things done faster
Do yourself a favor and learn some hotkeys and shortcuts — this way you’ll save yourself a lot of time, Honestly, it pains me to see people using contextual menus or similar stuff instead of clicking two keys. As always, there’s a Blueprint Editor Cheat Sheet in the docs. But here are a couple of tricks for the most essential actions that you’ll be performing a lot:
Instead of dragging your variable and then clicking either get or set option, you can use one of the two modifier keys: Ctrl for getting and Alt for setting:
If (branch) node
For creating a branch node (if node), simple hold B and left click on an empty space:
Instead of putting all of the nodes for your mathematical operation one by one and connecting them, you can use a Math Expression node:
To break the link between two nodes you don’t have to right click and select “Break link…” option, there’s a faster way. As well as to retarget the link from one node to another:
This will be it. I know it’s not much, but I hope you’ve picked up something useful.
See you later, mates!
If you want to discuss this article, there are three choices: