E-Book, Englisch, 384 Seiten
A.Moniem Mastering Unreal Engine 4.X
1. Auflage 2025
ISBN: 978-1-78588-522-8
Verlag: De Gruyter
Format: PDF
Kopierschutz: Adobe DRM (»Systemvoraussetzungen)
Master the art of building AAA games with Unreal Engine
E-Book, Englisch, 384 Seiten
ISBN: 978-1-78588-522-8
Verlag: De Gruyter
Format: PDF
Kopierschutz: Adobe DRM (»Systemvoraussetzungen)
Unreal Engine 4 has garnered a lot of attention in the gaming world because of its new and improved graphics and rendering engine, the physics simulator, particle generator, and more. This book is the ideal guide to help you leverage all these features to create state-of-the-art games that capture the eye of your audience.
Inside we'll explain advanced shaders and effects techniques and how you can implement them in your games. You'll create custom lighting effects, use the physics simulator to add that extra edge to your games, and create customized game environments that look visually stunning using the rendering technique. You'll find out how to use the new rendering engine efficiently, add amazing post-processing effects, and use data tables to create data-driven gameplay that is engaging and exciting.
By the end of this book, you will be able to create professional games with stunning graphics using Unreal Engine 4!
Autoren/Hrsg.
Weitere Infos & Material
The Gladiator header (.h) file
Now let's jump back to the header file again, and let's start adding some more functions and variables to it so we can start building gameplay logic for the character and make something that fits our target.
Considering that a class based on and called will be used later to read the gameplay data from Excel tables; here is the header file code I ended up with.
To make it easier to understand the code, I would like to breakdown all the variable components and methods into a set of chunks; that way it will be very easy to understand them.
Everything starts with the includes, just like any form of C++ coding you are used to making, including the header files that are going to be used or referenced and must be done at the top of the code.
Defining the class itself is essentially a step directly after the statements.
: This is the virtual void of the override from the class base and this one will be called once the game is started.
: This is a that will be added to the character blueprint that is based on that class. This component will be used to control the camera.
: This is the camera itself that will be viewing the game and following the player. This one will also be added to the blueprints.
: This is a sprite component (Paper 2D is the main 2D framework for Unreal Engine 4.x). There are lots of ways we can use this to achieve an on-screen draw texture, but this one is the easiest and most flexible. I managed to add a sprite component that is very close to the camera, and then we can use it to draw whatever effect we need.
: This is the constructor, and as mentioned earlier, it is used to build the object in edit mode.
: This is a variable in degrees to control the camera turn rate.
: Another variable to control the camera, but this time it's for lookups. This one is also in degrees.
: This is a variable to determine the jump velocity.
: This is a Boolean variable to tell us what the current state of the layer is. It is a very important variable, as most of player behavior and inputs will be based on it.
: Another Boolean variable to report if the player is attacking now or not. It is important for animations.
: This is an integer to determine the current active weapon index. The player could have several weapons; to be able to load the weapon's data, it is a good idea to give each weapon its own index.
: Sometimes the player is not dead, but you also need to take the control out of his hands, maybe because the character is carrying out an attack, or maybe because the player paused the game. So this is a variable meant to tell us if the player is in control now or not.
: A variable to hold the active instance of the game tables. It is just here to load some data.
: A getter method to return the value of the Boolean variable.
: A method that takes a parameter of or , and uses it to set the status of the player controller. So it is here we take the control from the player, or give it to him at a certain moment.
: A method that takes a value, and reduces the total player health using it. It is usually used when the player gets damaged.
: This is a function that returns the value of the player as a value.
: A method that holds some procedurals after the player has done an attack.
: A method to return the component variable.
: Another method to return the component variable.
: A method that holds the code responsible for player movement to the forward and backward. Notice that it is a in order to be able to use it from the class blueprint instances.
: A method that holds the code responsible for player movement to the left and right.
: A method that is responsible for applying the jump action to the character based on the base character class.
: A method that is responsible for stopping the jump, and resuming the idle/run animation.
: A method that is responsible for attacking.
: A method that is responsible for switching between weapons.
: A method that is responsible for applying turns to the following camera.
: A method that is responsible for applying the camera look-up rate to the follow camera.
: A variable that holds the player's total health (the current health), as at any moment the player's health gets reduced, that will be the final value. Some people like the approach of creating two variables:
- : This is the base and default...




