SlideShare a Scribd company logo
Unreal Engine Basics
Chapter 2: Unreal Editor
Nick Prühs
Objectives
• Getting familiar with the Unreal Level Editor
• Learning how to bind and handle player keyboard and mouse input
• Understanding character movement properties and functions
Unreal Levels
Unreal Levels
In Unreal, a Level is defined as a collection of Actors.
The default level contains seven of them:
• Atmospheric Fog: Provides a realistic sense of atmosphere, air density, and light
scattering.
• Floor: A simple static mesh actor.
• Light Source: Directional light that simulates light that is being emitted from a
source that is infinitely far away (e.g. the sun).
• Player Start: Location in the game world that the player can start from.
• Sky Sphere: Background used to make the level look bigger.
• SkyLight: Captures the distant parts of your level and applies that to the scene as a
light.
• SphereReflectionCapture: Captures the scene for reflection in a sphere shape.
Unreal Levels
Starting the game will spawn eleven more actors:
• CameraActor: Camera viewpoint that can be placed in a level.
• DefaultPawn: Simple Pawn with spherical collision and built-in flying movement.
• GameNetworkManager: Handles game-specific networking management (cheat
detection, bandwidth management, etc.).
• GameSession: Game-specific wrapper around the session interface (e.g. for
matchmaking).
• HUD: Allows rendering text, textures, rectangles and materials.
• ParticleEventManager: Allows handling spawn, collision and death of particles.
• PlayerCameraManager: Responsible for managing the camera for a particular
player.
• GameModeBase, GameStateBase, PlayerController, PlayerState
Asset Naming Conventions
For the same reasons we agreed on coding conventions earlier, it makes
sense to think about your project folder structure:
• Maps
• Characters
• Effects
• Environment
• Gameplay
• Sound
• UI
Asset Naming Conventions
For the same reasons we agreed on coding conventions earlier, it makes sense to think
about your asset names:
(Prefix_)AssetName(_Number)
with prefixes such as:
• BP_ for blueprints
• SK_ for skeletal meshes
• SM_ for static meshes
• M_ for materials
• T_ for textures
Blueprints
• Complete node-based gameplay scripting system
• Typed variables, functions, execution flow
• Extend C++ base classes
 Thus, blueprint actors can be spawned, ticked, destroyed, etc.
• Allow for very fast iteration times
Hint!
By convention, maps don’t use the default underscore (_) asset naming
scheme.
Instead, they are using a combination of game mode shorthand, dash (-)
and map name, e.g.
DM-Deck
Putting it all together
To tell Unreal Engine which game framework classes to use, you need
to…
 Specify your desired game mode in the World Settings of a map
 Specify your other desired classes in your game mode (blueprint)
Hint!
If you don’t happen to have any assets at hand, the
AnimationStarter Pack
from the Unreal Marketplace is a great place to start.
Binding Input
First, we need to define the actions and axes we want to use, in the Input
Settings of our project (saved to Config/DefaultInput.ini).
Binding Input
Then, we need to override APlayerController::SetupInputComponent to
bind our input to C++ functions:
void AASPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
if (!IsValid(InputComponent))
{
return;
}
InputComponent->BindAxis(TEXT("MoveForward"), this, & AASPlayerController ::InputMoveForward);
}
Binding Input
Finally, we can apply input as character movement:
void AASPlayerController ::InputMoveForward(float AxisValue)
{
// Early out if we haven't got a valid pawn.
if (!IsValid(GetPawn()))
{
return;
}
// Scale movement by input axis value.
FVector Forward = GetPawn()->GetActorForwardVector();
// Apply input.
GetPawn()->AddMovementInput(Forward, AxisValue);
}
Binding Input
In order for our camera to follow our turns, we need to have it use our
control rotation:
Hint!
You can change the
Editor StartupMap
of your project in the project settings.
Binding Input Actions
Just as we‘ve been binding functions to an input axis, we can bind
functions to one-shot input actions:
void AASPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
if (!IsValid(InputComponent))
{
return;
}
// ...
InputComponent->BindAction(TEXT("Jump"), IE_Pressed, this, &AASPlayerController::InputJump);
}
Character Movement Properties
You can change various other properties at the
CharacterMovementComponent as well, e.g.:
• Max Walk Speed
• Jump Z Velocity (affects jump height)
Setting Up Logging
1. Declare your log category in your module header file:
2. Define your log category in your module .cpp file:
3. Make sure you‘ve included your module header file.
4. Log wherever you want to:
DECLARE_LOG_CATEGORY_EXTERN(LogAS, Log, All);
DEFINE_LOG_CATEGORY(LogAS);
UE_LOG(LogAS, Log, TEXT("This is some nice log output!"));
Unreal Log Categories
Category Summary
Fatal Always prints a error (even if logging is disabled).
Error Prints an error.
Warning Prints a warning.
Log Prints a message.
Verbose Prints a verbose message (if enabled for the given category).
VeryVerbose Prints a verbose message (if enabled for the given category).
Log Formatting
The UE_LOG macro supports formatting, just as in other languages and
frameworks:
FStrings require the indirection operator (*) to be applied for logging:
UE_LOG(LogAS, Log, TEXT("OnHealthChanged - OldHealth: %f, NewHealth: %f"),
OldHealth, NewHealth);
UE_LOG(LogAS, Log, TEXT("OnHealthChanged - Character: %s"), *GetName());
Blueprint Libraries
Unreal Engine exposes many C++ functions to blueprints, some of which
can be very useful for gameplay programming as well, e.g.:
• Kismet/GameplayStatics.h
• Kismet/KismetMathLibrary.h
(Kismet was the name of visual scripting in Unreal Engine3.)
We’ll learn how to do that ourselves in a minute.
Assignment #2 – Character Movement
1. Add blueprints for your code game framework classes.
2. Create a map and setup your world settings and game mode.
3. Make your character move forward, back, left and right.
4. Allow your player to look around.
5. Make your character jump.
References
• Epic Games. Assets Naming Convention.
https://wiki.unrealengine.com/Assets_Naming_Convention, February
2020.
• Epic Games. Introduction to Blueprints.
https://docs.unrealengine.com/en-
US/Engine/Blueprints/GettingStarted/index.html, February 2020.
• Epic Games. Basic Scripting. https://docs.unrealengine.com/en-
US/Engine/Blueprints/Scripting/index.html, February 2020.
• Epic Games. Setting Up Character Movement in Blueprints.
https://docs.unrealengine.com/en-
US/Gameplay/HowTo/CharacterMovement/Blueprints/index.html,
Feburary 2020.
See you next time!
https://www.slideshare.net/npruehs
https://github.com/npruehs/teaching-
unreal-engine/releases/tag/assignment02
npruehs@outlook.com
5 Minute Review Session
• Where do players spawn in Unreal levels?
• How do you tell Unreal which game framework classes to use?
• Where do you define input axis mappings?
• What is the difference between axis and action mappings?
• How do you bind input?

More Related Content

PDF
Unreal Engine Basics 03 - Gameplay
PDF
Unreal Engine Basics 01 - Game Framework
PDF
Unreal Engine Basics 05 - User Interface
PDF
State-Based Scripting in Uncharted 2: Among Thieves
PPTX
Player Traversal Mechanics in the Vast World of Horizon Zero Dawn
PDF
UE4のローカライズ機能紹介 (UE4 Localization Deep Dive)
PDF
UE4をレンダラとした趣味的スピード背景ルックデブ(UE4 Environment Art Dive)
PPTX
Final year project presentation
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 05 - User Interface
State-Based Scripting in Uncharted 2: Among Thieves
Player Traversal Mechanics in the Vast World of Horizon Zero Dawn
UE4のローカライズ機能紹介 (UE4 Localization Deep Dive)
UE4をレンダラとした趣味的スピード背景ルックデブ(UE4 Environment Art Dive)
Final year project presentation

What's hot (20)

PDF
Component-Based Entity Systems (Demo)
PPTX
Game development life cycle
PPTX
Unity 3d Basics
PPTX
Unity 3D, A game engine
PPTX
ガルガンチュア on Oculus Quest - 72FPSへの挑戦 -
PPTX
Unity - Essentials of Programming in Unity
PPTX
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
PPTX
[CEDEC2018] UE4で多数のキャラクターを生かすためのテクニック
PPTX
PDF
Press Button, Drink Coffee : An Overview of UE4 build pipeline and maintenance
PDF
UE4.17で入る新機能を一気に紹介・解説!
PDF
Introduction to Game Development
PPT
CROSS PLATFORM APPLICATIONS DEVELOPMENT
PDF
出張ヒストリア ブループリントを書くにあたって大切なこと
PPTX
Introduction to Unity
PPTX
Unity 3D
PDF
Game Engine Architecture
PPTX
Umg ,이벤트 바인딩, Invaidation Box
PDF
バイキング流UE4活用術 ~BPとお別れするまでの18ヶ月~
PDF
Unreal Engine 4.27 ノンゲーム向け新機能まとめ
Component-Based Entity Systems (Demo)
Game development life cycle
Unity 3d Basics
Unity 3D, A game engine
ガルガンチュア on Oculus Quest - 72FPSへの挑戦 -
Unity - Essentials of Programming in Unity
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
[CEDEC2018] UE4で多数のキャラクターを生かすためのテクニック
Press Button, Drink Coffee : An Overview of UE4 build pipeline and maintenance
UE4.17で入る新機能を一気に紹介・解説!
Introduction to Game Development
CROSS PLATFORM APPLICATIONS DEVELOPMENT
出張ヒストリア ブループリントを書くにあたって大切なこと
Introduction to Unity
Unity 3D
Game Engine Architecture
Umg ,이벤트 바인딩, Invaidation Box
バイキング流UE4活用術 ~BPとお別れするまでの18ヶ月~
Unreal Engine 4.27 ノンゲーム向け新機能まとめ
Ad

Similar to Unreal Engine Basics 02 - Unreal Editor (20)

PDF
Unity3d scripting tutorial
PPT
Ember.js Tokyo event 2014/09/22 (English)
PDF
Introduction to Coding
PPTX
Silverlight as a Gaming Platform
PDF
Sephy engine development document
PDF
libGDX: Scene2D
PPTX
Initial design (Game Architecture)
PDF
Introduction to html5 game programming with impact js
PDF
Cocos2d 소개 - Korea Linux Forum 2014
PDF
Cocos2d programming
PPT
Gdc09 Minigames
PPTX
Parallel Futures of a Game Engine
PPTX
Galactic Wars XNA Game
PPTX
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
PDF
Developing a Multiplayer RTS with the Unreal Engine 3
PPT
Rotoscope inthebrowserppt billy
PPTX
Unity workshop
PPTX
98 374 Lesson 06-slides
PDF
Enterprise Tic-Tac-Toe
PPT
OpenGL ES based UI Development on TI Platforms
Unity3d scripting tutorial
Ember.js Tokyo event 2014/09/22 (English)
Introduction to Coding
Silverlight as a Gaming Platform
Sephy engine development document
libGDX: Scene2D
Initial design (Game Architecture)
Introduction to html5 game programming with impact js
Cocos2d 소개 - Korea Linux Forum 2014
Cocos2d programming
Gdc09 Minigames
Parallel Futures of a Game Engine
Galactic Wars XNA Game
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Developing a Multiplayer RTS with the Unreal Engine 3
Rotoscope inthebrowserppt billy
Unity workshop
98 374 Lesson 06-slides
Enterprise Tic-Tac-Toe
OpenGL ES based UI Development on TI Platforms
Ad

More from Nick Pruehs (20)

PDF
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
PDF
Unreal Engine Basics 04 - Behavior Trees
PDF
Game Programming - Cloud Development
PDF
Game Programming - Git
PDF
Eight Rules for Making Your First Great Game
PDF
Designing an actor model game architecture with Pony
PDF
Game Programming 13 - Debugging & Performance Optimization
PDF
Scrum - but... Agile Game Development in Small Teams
PDF
What Would Blizzard Do
PDF
School For Games 2015 - Unity Engine Basics
PDF
Tool Development A - Git
PDF
Game Programming 12 - Shaders
PDF
Game Programming 11 - Game Physics
PDF
Game Programming 10 - Localization
PDF
Game Programming 09 - AI
PDF
Game Development Challenges
PDF
Game Programming 08 - Tool Development
PDF
Game Programming 07 - Procedural Content Generation
PDF
Game Programming 06 - Automated Testing
PDF
Game Programming 05 - Development Tools
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 04 - Behavior Trees
Game Programming - Cloud Development
Game Programming - Git
Eight Rules for Making Your First Great Game
Designing an actor model game architecture with Pony
Game Programming 13 - Debugging & Performance Optimization
Scrum - but... Agile Game Development in Small Teams
What Would Blizzard Do
School For Games 2015 - Unity Engine Basics
Tool Development A - Git
Game Programming 12 - Shaders
Game Programming 11 - Game Physics
Game Programming 10 - Localization
Game Programming 09 - AI
Game Development Challenges
Game Programming 08 - Tool Development
Game Programming 07 - Procedural Content Generation
Game Programming 06 - Automated Testing
Game Programming 05 - Development Tools

Recently uploaded (20)

PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Advanced IT Governance
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Transforming Manufacturing operations through Intelligent Integrations
Chapter 2 Digital Image Fundamentals.pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Review of recent advances in non-invasive hemoglobin estimation
Advanced IT Governance
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.
Understanding_Digital_Forensics_Presentation.pptx
GamePlan Trading System Review: Professional Trader's Honest Take
Spectral efficient network and resource selection model in 5G networks
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology

Unreal Engine Basics 02 - Unreal Editor

  • 1. Unreal Engine Basics Chapter 2: Unreal Editor Nick Prühs
  • 2. Objectives • Getting familiar with the Unreal Level Editor • Learning how to bind and handle player keyboard and mouse input • Understanding character movement properties and functions
  • 4. Unreal Levels In Unreal, a Level is defined as a collection of Actors. The default level contains seven of them: • Atmospheric Fog: Provides a realistic sense of atmosphere, air density, and light scattering. • Floor: A simple static mesh actor. • Light Source: Directional light that simulates light that is being emitted from a source that is infinitely far away (e.g. the sun). • Player Start: Location in the game world that the player can start from. • Sky Sphere: Background used to make the level look bigger. • SkyLight: Captures the distant parts of your level and applies that to the scene as a light. • SphereReflectionCapture: Captures the scene for reflection in a sphere shape.
  • 5. Unreal Levels Starting the game will spawn eleven more actors: • CameraActor: Camera viewpoint that can be placed in a level. • DefaultPawn: Simple Pawn with spherical collision and built-in flying movement. • GameNetworkManager: Handles game-specific networking management (cheat detection, bandwidth management, etc.). • GameSession: Game-specific wrapper around the session interface (e.g. for matchmaking). • HUD: Allows rendering text, textures, rectangles and materials. • ParticleEventManager: Allows handling spawn, collision and death of particles. • PlayerCameraManager: Responsible for managing the camera for a particular player. • GameModeBase, GameStateBase, PlayerController, PlayerState
  • 6. Asset Naming Conventions For the same reasons we agreed on coding conventions earlier, it makes sense to think about your project folder structure: • Maps • Characters • Effects • Environment • Gameplay • Sound • UI
  • 7. Asset Naming Conventions For the same reasons we agreed on coding conventions earlier, it makes sense to think about your asset names: (Prefix_)AssetName(_Number) with prefixes such as: • BP_ for blueprints • SK_ for skeletal meshes • SM_ for static meshes • M_ for materials • T_ for textures
  • 8. Blueprints • Complete node-based gameplay scripting system • Typed variables, functions, execution flow • Extend C++ base classes  Thus, blueprint actors can be spawned, ticked, destroyed, etc. • Allow for very fast iteration times
  • 9. Hint! By convention, maps don’t use the default underscore (_) asset naming scheme. Instead, they are using a combination of game mode shorthand, dash (-) and map name, e.g. DM-Deck
  • 10. Putting it all together To tell Unreal Engine which game framework classes to use, you need to…  Specify your desired game mode in the World Settings of a map  Specify your other desired classes in your game mode (blueprint)
  • 11. Hint! If you don’t happen to have any assets at hand, the AnimationStarter Pack from the Unreal Marketplace is a great place to start.
  • 12. Binding Input First, we need to define the actions and axes we want to use, in the Input Settings of our project (saved to Config/DefaultInput.ini).
  • 13. Binding Input Then, we need to override APlayerController::SetupInputComponent to bind our input to C++ functions: void AASPlayerController::SetupInputComponent() { Super::SetupInputComponent(); if (!IsValid(InputComponent)) { return; } InputComponent->BindAxis(TEXT("MoveForward"), this, & AASPlayerController ::InputMoveForward); }
  • 14. Binding Input Finally, we can apply input as character movement: void AASPlayerController ::InputMoveForward(float AxisValue) { // Early out if we haven't got a valid pawn. if (!IsValid(GetPawn())) { return; } // Scale movement by input axis value. FVector Forward = GetPawn()->GetActorForwardVector(); // Apply input. GetPawn()->AddMovementInput(Forward, AxisValue); }
  • 15. Binding Input In order for our camera to follow our turns, we need to have it use our control rotation:
  • 16. Hint! You can change the Editor StartupMap of your project in the project settings.
  • 17. Binding Input Actions Just as we‘ve been binding functions to an input axis, we can bind functions to one-shot input actions: void AASPlayerController::SetupInputComponent() { Super::SetupInputComponent(); if (!IsValid(InputComponent)) { return; } // ... InputComponent->BindAction(TEXT("Jump"), IE_Pressed, this, &AASPlayerController::InputJump); }
  • 18. Character Movement Properties You can change various other properties at the CharacterMovementComponent as well, e.g.: • Max Walk Speed • Jump Z Velocity (affects jump height)
  • 19. Setting Up Logging 1. Declare your log category in your module header file: 2. Define your log category in your module .cpp file: 3. Make sure you‘ve included your module header file. 4. Log wherever you want to: DECLARE_LOG_CATEGORY_EXTERN(LogAS, Log, All); DEFINE_LOG_CATEGORY(LogAS); UE_LOG(LogAS, Log, TEXT("This is some nice log output!"));
  • 20. Unreal Log Categories Category Summary Fatal Always prints a error (even if logging is disabled). Error Prints an error. Warning Prints a warning. Log Prints a message. Verbose Prints a verbose message (if enabled for the given category). VeryVerbose Prints a verbose message (if enabled for the given category).
  • 21. Log Formatting The UE_LOG macro supports formatting, just as in other languages and frameworks: FStrings require the indirection operator (*) to be applied for logging: UE_LOG(LogAS, Log, TEXT("OnHealthChanged - OldHealth: %f, NewHealth: %f"), OldHealth, NewHealth); UE_LOG(LogAS, Log, TEXT("OnHealthChanged - Character: %s"), *GetName());
  • 22. Blueprint Libraries Unreal Engine exposes many C++ functions to blueprints, some of which can be very useful for gameplay programming as well, e.g.: • Kismet/GameplayStatics.h • Kismet/KismetMathLibrary.h (Kismet was the name of visual scripting in Unreal Engine3.) We’ll learn how to do that ourselves in a minute.
  • 23. Assignment #2 – Character Movement 1. Add blueprints for your code game framework classes. 2. Create a map and setup your world settings and game mode. 3. Make your character move forward, back, left and right. 4. Allow your player to look around. 5. Make your character jump.
  • 24. References • Epic Games. Assets Naming Convention. https://wiki.unrealengine.com/Assets_Naming_Convention, February 2020. • Epic Games. Introduction to Blueprints. https://docs.unrealengine.com/en- US/Engine/Blueprints/GettingStarted/index.html, February 2020. • Epic Games. Basic Scripting. https://docs.unrealengine.com/en- US/Engine/Blueprints/Scripting/index.html, February 2020. • Epic Games. Setting Up Character Movement in Blueprints. https://docs.unrealengine.com/en- US/Gameplay/HowTo/CharacterMovement/Blueprints/index.html, Feburary 2020.
  • 25. See you next time! https://www.slideshare.net/npruehs https://github.com/npruehs/teaching- unreal-engine/releases/tag/assignment02 [email protected]
  • 26. 5 Minute Review Session • Where do players spawn in Unreal levels? • How do you tell Unreal which game framework classes to use? • Where do you define input axis mappings? • What is the difference between axis and action mappings? • How do you bind input?