Helion


Szczegóły ebooka

Elevating Game Experiences with Unreal Engine 5 - Second Edition

Elevating Game Experiences with Unreal Engine 5 - Second Edition


Immerse yourself in the Unreal game projects with this book, written by four highly experienced industry professionals with many years of combined experience with Unreal Engine. Elevating Game Experiences with Unreal Engine 5 will walk you through the latest version of Unreal Engine by helping you get hands-on with the game creation projects.

The book starts with an introduction to the Unreal Editor and key concepts such as actors, blueprints, animations, inheritance, and player input. You'll then move on to the first of three projects, building a dodgeball game, where you'll learn the concepts of line traces, collisions, projectiles, user interface, and sound effects. You'll also discover how to combine these concepts to showcase your new skills. The second project, a side-scroller game, will help you implement concepts such as animation blending, enemy AI, spawning objects, and collectibles. And finally, you'll cover the key concepts in creating a multiplayer environment as you work on the third project, an FPS game.

By the end of this Unreal Engine book, you'll have a broad understanding of how to use the tools that the game engine provides to start building your own games.

  • Elevating Game Experiences with Unreal Engine 5
  • Second Edition
  • Contributors
  • About the authors
  • About the reviewers
  • Preface
    • Who this book is for
    • What this book covers
      • To get the most out of this book
      • Installing Visual Studio
      • Epic Games Launcher
    • Download the example code files
    • Download the color images
    • Conventions used
    • Get in touch
    • Share Your Thoughts
  • 1
  • Introduction to Unreal Engine
    • Technical requirements
    • Exercise 1.01 creating an Unreal Engine 5 project
    • Getting to know Unreal Engine
    • Exploring editor windows
    • Viewport navigation
    • Manipulating Actors
      • Exercise 1.02 adding and removing Actors
    • Understanding Blueprint Actors
      • Exercise 1.03 creating Blueprint Actors
    • Exploring the Blueprint editor
    • Exploring the Event Graph window
      • Exercise 1.04 creating Blueprint variables
      • Exercise 1.05 creating Blueprint functions
    • Understanding the Multiply node
    • Exploring the BeginPlay and Tick events
      • Exercise 1.06 offsetting the TestActor class on the Z-axis
    • The ThirdPersonCharacter Blueprint class
    • Exploring the usage of meshes and materials
      • Meshes
      • Materials
    • Manipulating materials in UE5
    • Activity 1.01 propelling TestActor on the Z-axis indefinitely
    • Summary
  • 2
  • Working with Unreal Engine
    • Technical requirements
    • Creating and setting up a blank C++ project
      • Exercise 2.01 creating an empty C++ project
    • The Content folders structure in Unreal Engine
    • Working with the Visual Studio solution
      • Debugging code in Visual Studio
      • Exercise 2.02 debugging the Third Person template code
    • Importing the required assets
      • Exercise 2.03 importing a character FBX file
    • The Unreal Game Mode class
      • Game Mode default classes
      • Gameplay events
      • Networking
      • GameModeBase versus Game Mode
    • Understanding levels and the Level Blueprint
      • The Unreal Pawn class
      • The Unreal Player Controller class
      • Exercise 2.04 setting up the Game Mode, Player Controller, and Pawn classes
    • Working with animations
      • Animation Blueprints
      • Event Graph
      • The Anim Graph
      • State Machines
      • Transition Rules
      • Blend Spaces
      • Activity 2.01 linking animations to a character
    • Summary
  • 3
  • Character Class Components and Blueprint Setup
    • Technical requirements
    • The Unreal Character class
    • Extending the C++ class with Blueprints
    • Summary
  • 4
  • Getting Started with Player Input
    • Technical requirements
    • Understanding Input Actions and Contexts
      • Exercise 4.01 creating the movement and jump input actions
    • Processing Player Input
      • Exercise 4.02 listening to movement and jump input actions
    • Turning the camera around the character
    • Activity 4.01 adding walking logic to our character
    • Summary
  • 5
  • Query with Line Traces
    • Technical requirements
    • Introduction to collision
    • Setting up your project
      • Exercise 5.01: Converting DodgeballCharacter to a top-down perspective
    • Understanding Line Traces
    • Creating the EnemyCharacter C++ class
      • Exercise 5.02: Creating the CanSeeActor function that executes Line Traces
    • Visualizing the Line Trace
      • Exercise 5.03: Creating the LookAtActor function
    • Creating the EnemyCharacter Blueprint Class
    • Sweep Traces
      • Exercise 5.04: Executing a Sweep Trace
      • Changing the Visibility Trace Response
      • Multi Line Traces
      • The Camera Trace Channel
      • Exercise 5.05: Creating a custom EnemySight Trace Channel
      • Activity 5.01: Creating the SightSource property
    • Summary
  • 6
  • Setting Up Collision Objects
    • Technical requirements
    • Understanding object collision in UE5
    • Understanding collision components
    • Understanding collision events
    • Understanding collision channels
      • Exercise 6.01 creating the Dodgeball class
    • Creating Physical Materials
      • Exercise 6.02 adding a ProjectileMovementComponent to DodgeballProjectile
    • Introducing timers
    • Understanding how to spawn actors
      • Exercise 6.03 adding projectile-throwing logic to the EnemyCharacter class
    • Creating the Wall classes
      • Exercise 6.04 creating Wall classes
    • Creating the VictoryBox actor
      • Exercise 6.05 creating the VictoryBox class
      • Exercise 6.06 adding the ProjectileMovementComponent getter function to DodgeballProjectile
      • Activity 6.01 replacing the SpawnActor function with SpawnActorDeferred in EnemyCharacter
    • Summary
  • 7
  • Working with UE5 Utilities
    • Technical requirements
    • Good practices loose coupling
    • Blueprint Function Libraries
      • Exercise 7.01 moving the CanSeeActor function to the Blueprint Function Library
    • Actor components
      • Exercise 7.02 creating the HealthComponent Actor component
      • Exercise 7.03 integrating the HealthComponent Actor component
    • Exploring interfaces
    • Blueprint native events
      • Exercise 7.04 creating the HealthInterface class
      • Activity 7.01 moving the LookAtActor logic to an Actor component
    • Summary
  • 8
  • Creating User Interfaces with UMG
    • Technical requirements
    • Game UI
    • UMG basics
      • Exercise 8.01 creating a Widget Blueprint
    • Introducing anchors
      • Exercise 8.02 editing UMG anchors
      • Exercise 8.03 creating the RestartWidget C++ class
      • Exercise 8.04 creating the logic for adding the RestartWidget class to the screen
      • Exercise 8.05 setting up the DodgeballPlayerController blueprint class
    • Understanding progress bars
      • Exercise 8.06 creating the health bar C++ logic
      • Activity 8.01 improving the RestartWidget class
    • Summary
  • 9
  • Adding Audio-Visual Elements
    • Technical requirements
    • Audio in UE5
      • Exercise 9.01 Importing an audio file
      • Exercise 9.02 Playing a sound when the dodgeball bounces off a surface
    • Sound attenuation
      • Exercise 9.03 Turning the bounce sound into a 3D sound
      • Exercise 9.04 Adding background music to our game
    • Understanding Particle Systems
      • Exercise 9.05 Spawning a Particle System when the dodgeball hits the player
      • Activity 9.01 Playing a sound when the dodgeball hits the player
    • Exploring level design
      • Exercise 9.06 Building a level blockout
    • Extra features
    • Summary
  • 10
  • Creating the SuperSideScroller Game
    • Technical requirements
    • Project breakdown
    • The player character
    • Converting the Third Person template into a side-scroller
      • Exercise 10.01 Creating the side-scroller project and using the Character Movement component
      • Activity 10.01 Making our character jump higher
    • Exploring the features of our side-scroller game
      • Enemy character
      • Power-ups
      • Collectibles
      • Heads-Up Display (HUD)
      • Exercise 10.02 Exploring the Persona Editor and manipulating the default mannequin skeleton weights
      • Activity 10.02 Skeletal bone manipulation and animations
    • Understanding animations in Unreal Engine 5
      • Skeletons
      • Skeletal Meshes
      • Animation sequences
      • Exercise 10.03 Importing and setting up the character and animation
      • Activity 10.03 Importing more custom animations to preview the character running
    • Summary
  • 11
  • Working with Blend Space 1D, Key Bindings, and State Machines
    • Technical requirements
    • Creating Blend Spaces
      • Blend Space 1D versus normal Blend Space
      • Exercise 11.01 creating the CharacterMovement Blend Space 1D
      • Activity 11.01 adding the Walking and Running animations to the Blend Space
    • The Main Character Animation Blueprint
      • Animation Blueprints
      • Exercise 11.02 adding the Blend Space to the character Animation Blueprint
    • What are velocity vectors?
      • Exercise 11.03 passing the characters Speed variable into the Blend Space
      • Activity 11.02 previewing the Running animation in-game
    • Enhanced input system
      • Exercise 11.04 adding input for sprinting
      • Exercise 11.05 reparenting the character Blueprint
      • Exercise 11.06 coding the characters sprint functionality
      • Activity 11.03 implementing the throwing input
    • Using Animation State Machines
      • Exercise 11.07 player character movement and jump state machine
      • Transition rules
      • Exercise 11.08 adding states and transition rules to the state machine
      • Exercise 11.09 The Time Remaining Ratio function
      • Activity 11.04 finishing the Movement and Jumping state machines
    • Summary
  • 12
  • Animation Blending and Montages
    • Technical requirements
    • Animation blending, Anim Slots, and Animation Montages
      • Exercise 12.01 Setting up the Animation Montage
    • Animation Montages
      • Exercise 12.02 Adding the Throw animation to the montage
    • Anim Slot Manager
      • Exercise 12.03 Adding a new Anim Slot
    • Save Cached Pose
      • Exercise 12.04 Save Cached Pose of the Movement State Machine
    • Layered blend per bone
      • Exercise 12.05 Blending animation with the Upper Body Anim Slot
      • Exercise 12.06 Previewing the Throw animation
    • The SuperSideScroller game enemy
      • Exercise 12.07 Creating the enemy base C++ class
      • Exercise 12.08 Creating and applying the enemy Animation Blueprint
    • Materials and Material Instances
      • Exercise 12.09 Creating and applying the enemy Material Instance
      • Activity 12.01 Updating Blend Weights
    • Summary
  • 13
  • Creating and Adding the Enemy Artificial Intelligence
    • Technical requirements
    • Enemy AI
    • AI Controller
      • Auto Possess AI
      • Exercise 13.01 implementing AI Controllers
    • Navigation Mesh
      • Exercise 13.02 implementing a Nav Mesh Volume for the AI enemy
    • Recasting the Nav Mesh
      • Exercise 13.03 recasting Nav Mesh Volume parameters
      • Activity 13.01 creating a new level
    • Behavior trees and Blackboards
      • Tasks
      • Decorators
      • Services
      • Exercise 13.04 creating the AI behavior tree and Blackboard
      • Exercise 13.05 creating a new behavior tree task
      • Exercise 13.06 creating the behavior tree logic
      • Activity 13.02 AI moving to the players location
      • Exercise 13.07 creating the enemy patrol locations
    • Vector Transformation
      • Exercise 13.08 selecting a random point in an array
      • Exercise 13.09 referencing the patrol point actor
      • Exercise 13.10 updating BTTask_FindLocation
    • Player projectile
      • Exercise 13.11 creating the player projectile
      • Exercise 13.12 initializing the PlayerProjectile classs settings
      • Activity 13.03 creating the player projectile Blueprint
    • Summary
  • 14
  • Spawning the Player Projectile
    • Anim Notifies and Anim Notify States
      • Exercise 14.01 creating a UAnimNotify class
      • Exercise 14.02 adding the new notify to the Throw Animation Montage
    • Playing Animation Montages
      • Playing Animation Montages in Blueprints
      • Playing Animation Montages in C++
      • Exercise 14.03 playing the Throw animation in C++
      • Exercise 14.04 creating the projectile spawn socket
      • Exercise 14.05 preparing the SpawnProjectile() Function
      • Exercise 14.06 updating the Anim_ProjectileNotify class
    • Destroying actors
      • Exercise 14.07 creating the DestroyEnemy() function
      • Exercise 14.08 destroying projectiles
      • Activity 14.01 Allow the projectile to destroy enemies
    • Understanding and implementing visual and audio effects
      • VFX
      • Audio effects (SFX)
      • Exercise 14.09 adding effects when the enemy is destroyed
      • Exercise 14.10 adding effects to the player projectile
      • Exercise 14.11 adding VFX and SFX notifies
      • Activity 14.02 adding effects for when the projectile is destroyed
    • Summary
  • 15
  • Exploring Collectibles, Power-Ups, and Pickups
    • Technical requirements
    • Understanding URotatingMovementComponent
      • Exercise 15.01 creating the PickableActor_Base class and adding URotatingMovementComponent
      • Activity 15.01 player overlap detection and spawning effects in PickableActor_Base
      • Activity 15.02 finalizing the PickableActor_Collectable actor
    • Logging variables using UE_LOG
      • Exercise 15.03 tracking the number of coins for the player
    • Introducing Unreal Motion Graphics UI
    • Understanding the Text widget
      • Anchors
      • Text formatting
      • Exercise 15.04 creating the Coin Counter UI HUD element
    • Adding and creating UMG user widgets
      • Exercise 15.05 Adding Coin Counter UI to the player screen
    • Using timers
      • Exercise 15.06 adding the potion power-up behavior to the player
      • Activity 15.03 creating the potion power-up actor
      • Exercise 15.07 creating the Brick class
      • Exercise 15.08 adding the Brick classs C++ logic
    • Summary
    • Additional Challenges
  • 16
  • Getting Started with Multiplayer Basics
    • Technical requirements
    • Introduction to multiplayer basics
    • Understanding the server
      • Dedicated server
      • The listen server
    • Understanding the client
      • Exercise 16.01 Testing the Third Person template in multiplayer
    • Packaging the project
    • Exploring connections and ownership
    • Getting to know roles
      • Actor spawned on the server
      • Actor spawned on the client
      • Player-owned pawn spawned on the server
      • Player-owned pawn spawned on the client
      • Exercise 16.02 Implementing ownership and roles
      • Output for the Server window
      • Server Character
      • Client 1 Character
      • The OwnershipTest actor
      • Output for the Client 1 window
    • Understanding variable replication
      • Replicated variables
      • Exercise 16.03 Replicating variables using Replicated, ReplicatedUsing, DOREPLIFETIME, and DOREPLIFETIME_CONDITION
      • Output for the Server window
      • Output for the Client 1 window
    • Exploring 2D Blend Spaces
      • Exercise 16.04 Creating a movement 2D Blend Space
    • Transforming (modifying) bones
      • Exercise 16.05 Creating a character that looks up and down
    • Activity 16.01 Creating the character for the multiplayer FPS project
    • Summary
  • 17
  • Using Remote Procedure Calls
    • Technical requirements
    • Understanding remote procedure calls
      • Server RPC
      • Multicast RPC
      • Client RPC
      • Important considerations when using RPCs
      • Exercise 17.01 Using remote procedure calls
    • Exposing enumerations to the editor
      • TEnumAsByte
      • UMETA
      • BlueprintType
      • Exercise 17.02 Using C++ enumerations in the editor
    • Using array index wrapping
      • Exercise 17.03 Using array index wrapping to cycle between an enumeration
    • Activity 17.01 Adding weapons and ammo to the multiplayer FPS game
    • Summary
  • 18
  • Using Gameplay Framework Classes in Multiplayer
    • Technical requirements
    • Accessing Gameplay Framework Instances in Multiplayer
      • Exercise 18.01 Displaying the Gameplay Framework instance values
      • Output for the Server window
      • Output for the Client 1 window
      • Game mode
      • Player state
      • Game State
      • Useful built-in functionality
      • Exercise 18.02 Making a simple multiplayer pickup game
    • Activity 18.01 Adding death, respawning, a scoreboard, kill limit, and pickups to the multiplayer FPS game
    • Summary
  • Index
    • Why subscribe?
  • Other Books You May Enjoy
    • Packt is searching for authors like you