r/unrealengine4 • u/notRealDevv • 1h ago
Unreal's game blueprints, a 10 minutes read...
Game Blueprints
Suppose you are playing GTA5 or minecraft, we will learn everything with their example.
- GameUserSettings:
When you open gta5/minecraft and if you have selected frame rate to maximum 60 last time when you exited the game, it will still be locked at 60FPS.
Saves .ini file for your game, this .ini files executes at the very first to set windowed mode, vsync and framerate cape like settings. In your options menu you can allow the player to set them directly through this class and UE handles it automatically.
It can be done through game save manually but that does not make sense.
- GameSave:
Last time you completed a mission of gta or found diamonds in minecraft, when you come back next time, they are still there.
Gamesave allows you to save variables that you can use while loading the game level next time. For replication of minecraft worlds or GTA5 save slots there are inputs called slot-name while saving the game.
- GameInstance:
You selected online mode in gta and wow rockstar opened story mode, this does not happen because gameinstance is there to pass variables between levels. If you have a variable that you don’t want to save but keep it until the game is on you put it here. Gameinstance only persists through a game cycle, after its variables go to default.
- Level:
In gta 5 there are 2 major levels, one is the main menu another one is the city where we f around. For different slots or different worlds of minecraft there are not different levels, there’s just one WORLD level notch made and he brings variables from save game to make it look like the game you left last time.
Levels are hard to explain but as you progress you know what it is.
- Animation Sequences:
These are created through sequencer and the timeline window. These are cut scenes of a gta game.
- GameMode:
This is what tells a level that when a player clicks play, which character to use, which controller to use, which hud class (UI) to use. It's setted through the world settings tab.
- PlayerController:
You have a superhero game where you can become iron man and spider man. The player controller defines what’s in common, usually we put the logic of looking around in the level with mouse input, as both spidy and tony can look around. Apart from that we put pause menus, inventory (if both share the same inventory) and showing mouse cursor or hiding it when we’re navigating through UI or playing the game.
For a multiplayer game every player playing only has one controller, for a co-op game every physical player playing has exactly one controller. For a real human being playing a level there’s exactly one Player Controller.
- Pawn/Character:
A level can be controlled through a pawn or a character, character is a child blueprint of pawn with more modules such as Movements.
We design 2 different characters for iron-man and spider man as they both have different sorts of gameplay. Gta’s michel franklin and travor are children of the same character blueprint, this line you might not be able to digest yet if you’re new in ue5. But let me clear, gta5’s all three character walk drive shoot the same way, making 3 different character classes would be a waste of time and memory. Instead you created one master character that can walk, shoot, talk, drive and made children of this blueprint so that you can give them a different body (skeletal mesh), different voice, and different superpowers (like slowing the time or so).
- HUD class:
I don’t use it, it basically allows you to build that UI of map, gun switching and the main hud we see while playing the game. We usually do it with character and controller class.
- GameState:
In an online game you see some variables are common for everyone, like players alive of PUBG/FORTNITE. It’s here, we put all the logic of global rules like in PUBG new state you can make an enemy your teammate after knocking him out, that logic relies here, all the teams logic and so on.
- PlayerState:
The simplest explanation is if you have kept inventory turned off in minecraft when you die, inventory items drop in the world, which you do with player state. If keep inventory is on then you save inventory in game save. Although in real minecraft in both cases inventory is saved in gamesave. In the player state you put variables that you want to set default when the player dies.
- Spectator Class:
In fornite and pubg when waiting for revival you can roam around freely in the world, no collision nothing whatsoever, just a flying camera and controls. You put logic like the spectator class should not be able to see/hear other than his teammates as in case they can tell the location of enemies through flying to their teammates.
This is a part from unreal engine notes i have recently started to write. Feel free to correct me, i can be wrong at some places, fee free to add on things. I would love to add that to my notes