Tuesday, January 17, 2017
A “Blueprint” to Game Designing With Unreal Engine 4
Ever wonder how events and functions in a game are made, like triggering a cutscene of a boss or even shooting a gun? Well there are many many variations and alternatives to the tools that allow us to make these but specifically in Unreal there are 2 primary things: blueprints and C++.
What is a blueprint?
Well to answer that question one would have to understand the term "visual scripting", so what is it. The easiest way to describe it would be to compare it to programming--the two are very much alike. Coding or programming can be described as writing a series specific instructions that work together for the computer or program to follow, so imagine it as a putting together a puzzle which shows a completed picture after putting together all the pieces correctly.
So a blueprint would basically be the same thing as coding but displayed in a more simplistic and visual way compared to code. It has a visual set of instructions that tells the game engine what to do, very similar to coding right?
The boxes as seen above are what we call "nodes", these are what replaces lines of code that we would have had to write. The lines connecting them allow them to work together and send each other information such as relaying the position of a certain object to another box or "node". These lines can have varying colors which represent different types of values being sent (Ex. Green would mean a float, red would be a boolean etc).
When to Use C++ or Blueprints
Although using coding languages such as C++ can replace many functions of blueprints, there are many things blueprints cannot do as well that C++ can. When you are firing an automatic gun (such as above) a TON of information is relayed and used to calculate in so little time, the trajectories, the damages, all that needs to be gathered and used in milliseconds. This is where using a blueprint would not work. C++ is generally used to do the heavy lifting, all of the fast and intricate calculations and executes like firing that rifle in the picture.
So in contrast to C++, blueprints are useful for the more simple functions such as an elevator system. All that needs to be done is determine whether something is done or not and the object or lift will rise up. Of course C++ could do this as well but by using blueprints for functions such as these you are saving yourself from having to write so many lines of code which could be replaced with just one node. When I was first starting out using Unreal Engine 4, I made a lift system in C++ which took hours. After I taught myself blueprints, I made a lift system in 10 minutes, so learn from my mistake folks.
If You're Interested
This is a very basic and in depth tutorial by Unreal to teach you how to make a light turn on when playing https://www.youtube.com/watch?v=8WeE4q6Ba40&t=191s. It helped me out a lot in gaining an understanding of blueprints.