SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
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?

Mais conteúdo relacionado

Mais procurados

최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012
최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012
최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012
devCAT Studio, NEXON
 
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
devCAT Studio, NEXON
 
06_게임엔진구성
06_게임엔진구성06_게임엔진구성
06_게임엔진구성
noerror
 
게임 프레임워크의 아키텍쳐와 디자인 패턴
게임 프레임워크의 아키텍쳐와 디자인 패턴게임 프레임워크의 아키텍쳐와 디자인 패턴
게임 프레임워크의 아키텍쳐와 디자인 패턴
MinGeun Park
 
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
Jubok Kim
 

Mais procurados (20)

GameInstance에 대해서 알아보자
GameInstance에 대해서 알아보자GameInstance에 대해서 알아보자
GameInstance에 대해서 알아보자
 
NDC2019 - 게임플레이 프로그래머의 역할
NDC2019 - 게임플레이 프로그래머의 역할NDC2019 - 게임플레이 프로그래머의 역할
NDC2019 - 게임플레이 프로그래머의 역할
 
Unity Introduction
Unity IntroductionUnity Introduction
Unity Introduction
 
최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012
최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012
최은영, 아티스트가 기획을 - 하이브리드의 길 Ver.1, NDC 2012
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
 
멀티스레드 렌더링 (Multithreaded rendering)
멀티스레드 렌더링 (Multithreaded rendering)멀티스레드 렌더링 (Multithreaded rendering)
멀티스레드 렌더링 (Multithreaded rendering)
 
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
 
How to generate game character behaviors using AI and ML - Unite Copenhagen
How to generate game character behaviors using AI and ML - Unite CopenhagenHow to generate game character behaviors using AI and ML - Unite Copenhagen
How to generate game character behaviors using AI and ML - Unite Copenhagen
 
Refelction의 개념과 RTTR 라이브러리
Refelction의 개념과 RTTR 라이브러리Refelction의 개념과 RTTR 라이브러리
Refelction의 개념과 RTTR 라이브러리
 
06_게임엔진구성
06_게임엔진구성06_게임엔진구성
06_게임엔진구성
 
[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들
[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들
[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들
 
게임 프레임워크의 아키텍쳐와 디자인 패턴
게임 프레임워크의 아키텍쳐와 디자인 패턴게임 프레임워크의 아키텍쳐와 디자인 패턴
게임 프레임워크의 아키텍쳐와 디자인 패턴
 
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
 
Game Design Process
Game Design ProcessGame Design Process
Game Design Process
 
언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링
 
[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지
[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지
[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지
 
LAFS Game Design 7 - Prototyping
LAFS Game Design 7 - PrototypingLAFS Game Design 7 - Prototyping
LAFS Game Design 7 - Prototyping
 
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
 
Intro to unreal with framework and vr
Intro to unreal with framework and vrIntro to unreal with framework and vr
Intro to unreal with framework and vr
 
Game Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsGame Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity Systems
 

Semelhante a Unreal Engine Basics 02 - Unreal Editor

Initial design (Game Architecture)
Initial design (Game Architecture)Initial design (Game Architecture)
Initial design (Game Architecture)
Rajkumar Pawar
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
Susan Gold
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
Sohil Gupta
 
Rotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billyRotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billy
nimbleltd
 

Semelhante a Unreal Engine Basics 02 - Unreal Editor (20)

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

Mais de Nick Pruehs

Mais de Nick Pruehs (20)

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - Git
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with Pony
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard Do
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - Git
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - Shaders
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game Physics
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - Localization
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AI
 
Game Development Challenges
Game Development ChallengesGame Development Challenges
Game Development Challenges
 
Game Programming 08 - Tool Development
Game Programming 08 - Tool DevelopmentGame Programming 08 - Tool Development
Game Programming 08 - Tool Development
 
Game Programming 06 - Automated Testing
Game Programming 06 - Automated TestingGame Programming 06 - Automated Testing
Game Programming 06 - Automated Testing
 
Game Programming 05 - Development Tools
Game Programming 05 - Development ToolsGame Programming 05 - Development Tools
Game Programming 05 - Development Tools
 
Game Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design PrinciplesGame Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design Principles
 
Game Programming 03 - Git Flow
Game Programming 03 - Git FlowGame Programming 03 - Git Flow
Game Programming 03 - Git Flow
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

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 npruehs@outlook.com
  • 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?