A level is a user defined area of gameplay. Each level is saved as a .umap file so they are also sometimes referred to as Maps.
The World in Unreal is the part that handles the streaming of Levels when creating large areas of gameplay.
An Actor (AActor) is any object that can be placed in a level. There are several different types of Actors depending on how it will be used.
Subclass of Actor that serve as an in-game avatar or persona. Pawns are controlled by the player or AI using a PlayerController or an AIController.
- A Character is a special type of pawn that can walk around like a humanoid like creature.
A controller is a non-physical actor that can possess a pawn and control it's actions.
- PlayerController is used by a human player.
- AIController is used by AI's to control pawns.
There are three actors used to build the geometry of the game.
Trigger are actors that fires a event when some other object in the level interact with them. The shapes to select from are Box or Sphere triggers.
A component can be added to an actor to give it new functionality. Use the Details window or the My Blueprint window to add or delete components. When the components exists it is possible to drag it into a eventgraph as a variable or right click it to add events related to it.
AActor* ParentActor = MyComponent->GetOwner();
UMyComponent* MyComp = MyActor->FindComponentByClass<UMyComponent>();
Besides the actors that exist in levels there are a few more classes that the 'game' is split into.
The GameInstance is a object that exist from the game runs to the player turns it off.
- BP: GetGameInstance
The GameMode object is created when a level is loaded. It only exist on the server. There are two base classes to create a game mode from. AGameModeBase is the base class for all game modes and AGameMode have with functionality to support multiplayer matches. The default game can be set in DefaultEngine.ini and it can be set in world settings for each map.
The game state exists on the server and is replicated to all clients. AGameStateBase is the base class. Game state is often paired with a game mode for the specific things needed by the game mode.
Each player in the game has it's own player state. They exist on and is synced to all clients.
Subsystems is automatically instances classes with managed lifetimes.
Engines - UEngineSubsystem
Editor - UEditorSubsystem
Game Instance - UGameInstanceSubsystem
World - UWorldSubsystem
Local Player - ULocalPlayerSubsystem
Data Driven Gameplay
Instead of tweaking values directly inside of blueprints and c++ code one can put them in spreadsheet documents and import them into the unreal. The first column is the name by which each row is accessed in the game. The rest of the columns depends on if it is imported as a Data table or a Curve table in Unreal. To use the sheet export it as a csv file and then import it to unreal.
In a curve table each row is the points of a curve. Each column heading contains the x-axis position and each value in the column is the y-axis value for the curve. The ability system in unreal use it for level values. So on row can be named Fireball_damage and then the curve is the damage for a level 1, 2 or 3 level fireball. For single values use a row with name, 0 and 1 and put the values in 01 and comments for designers in column 1. Sample at level 0 and ignore the other column that will be all zero.
- Blueprint: Use Evalute Curve Table row to get the value of a row.
- C++: UCurveTable and then GetRowMap and then Eval on the row.
For a data table a struct based on FTableRowBase is created in C++. Each row is in the sheet is then the content of such as struct and you use the name in the first column to access it. The header for each column is the name of a variable in the structure. A data table is useful when there is many things with the same information. Like if you have monsters in the game and each one has its health, movement speed and xp when killed.
- Blueprint: Get Data Table Row to get a row from a data table. Use break to split the structure for access to elements.
Composite data/curve tables