Blueprints Visual Scripting for Unreal Engine 5 - Third Edition

Book description

Explore the faster way to build games using UE5 Blueprints using this practical guide with key images printed in color

Key Features

  • Design a fully functional game in UE5 without writing a single line of code
  • Implement visual scripting to develop gameplay mechanics, UI, visual effects, VR, and artificial intelligence
  • Deploy your game on multiple platforms and share it with the world

Book Description

Unreal Engine's Blueprint visual scripting system enables designers to script their games and programmers to create base elements that can be extended by designers. With this book, you'll explore all the features of the Blueprint Editor, along with expert tips, shortcuts, and best practices.

The book guides you through using variables, macros, and functions, and helps you learn about object-oriented programming (OOP). You'll discover the Gameplay Framework and advance to learning how Blueprint Communication allows one Blueprint to access information from another Blueprint. Later chapters focus on building a fully functional game step by step. You'll start with a basic first-person shooter (FPS) template, and each chapter will build on the prototype to create an increasingly complex and robust game experience. You'll then progress from creating basic shooting mechanics to more complex systems such as user interface elements and intelligent enemy behavior. The book demonstrates how to use arrays, maps, enums, and vector operations and introduces the elements needed for VR game development. In the final chapters, you’ll learn how to implement procedural generation and create a product configurator.

By the end of this book, you'll have learned how to build a fully functional game and have the skills required to develop an entertaining experience for your audience.

What you will learn

  • Understand programming concepts in Blueprints
  • Create prototypes and iterate new game mechanics rapidly
  • Build user interface elements and interactive menus
  • Use advanced Blueprint nodes to manage the complexity of a game
  • Explore all the features of the Blueprint editor, such as the Components tab, Viewport, and Event Graph
  • Get to grips with OOP concepts and explore the Gameplay Framework
  • Work with virtual reality development in UE Blueprint
  • Implement procedural generation and create a product configurator

Who this book is for

This book is for anyone interested in developing games or applications with UE5. Although basic knowledge of Windows OS is required, experience in programming or UE5 is not necessary.

Table of contents

  1. Blueprints Visual Scripting for Unreal Engine 5
  2. Third Edition
  3. Foreword
  4. Contributors
  5. About the authors
  6. About the reviewer
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
  8. Part 1: Blueprint Fundamentals
  9. Chapter 1: Exploring the Blueprint Editor
    1. Installing Unreal Engine
    2. Creating new projects and using templates
    3. Blueprints Visual Scripting
      1. Opening the Level Blueprint Editor
      2. Creating a Blueprint Class
    4. The Blueprint Class Editor interface
      1. The Toolbar panel
      2. The Components panel
      3. The My Blueprint panel
      4. The Details panel
      5. The Viewport panel
      6. The Event Graph panel
    5. Adding Components to a Blueprint
    6. Summary
    7. Quiz
  10. Chapter 2: Programming with Blueprints
    1. Storing values in variables
    2. Defining the behavior of a Blueprint with events and actions
      1. Events
      2. Actions
      3. The execution path
    3. Creating expressions with operators
      1. Arithmetic operators
      2. Relational operators
      3. Logical operators
    4. Organizing the script with macros and functions
      1. Creating macros
      2. Creating functions
      3. Step-by-step example
      4. Macros versus functions versus events
    5. Summary
    6. Quiz
  11. Chapter 3: Object-Oriented Programming and the Gameplay Framework
    1. Getting familiar with OOP
      1. Classes
      2. Instances
      3. Inheritance
    2. Managing Actors
      1. Referencing Actors
      2. Spawning and destroying Actors
      3. Construction Script
    3. Exploring the other Gameplay Framework classes
      1. Pawn
      2. Character
      3. PlayerController
      4. Game Mode Base
      5. Game Instance
    4. Summary
    5. Quiz
  12. Chapter 4: Understanding Blueprint Communication
    1. Direct Blueprint Communication
    2. Casting in Blueprints
    3. Level Blueprint Communication
    4. Event Dispatchers
    5. Binding Events
    6. Summary
    7. Quiz
  13. Part 2: Developing a Game
  14. Chapter 5: Object Interaction with Blueprints
    1. Creating the project and the first Level
    2. Adding objects to our Level
    3. Exploring Materials
      1. Creating Materials
      2. Material properties and nodes
      3. Adding substance to our Material
    4. Creating the target Blueprint
      1. Detecting a hit
      2. Swapping a Material
      3. Improving the Blueprint
    5. Adding movement
      1. Changing the Actor's Mobility and Collision settings
      2. Breaking down our goal
      3. Readying direction for calculations
      4. Getting relative speed using delta time
      5. Updating location
    6. Changing direction
      1. Testing moving targets
    7. Summary
    8. Quiz
  15. Chapter 6: Enhancing Player Abilities
    1. Adding the running functionality
      1. Breaking down the character movement
      2. Customizing control inputs
      3. Adding a Sprint ability
    2. Animating a zoomed view
      1. Using a timeline to smooth transitions
    3. Increasing the projectile's speed
    4. Adding sound and particle effects
      1. Changing target states with branches
      2. Triggering sound effects, explosions, and destruction
    5. Summary
    6. Quiz
  16. Chapter 7: Creating Screen UI Elements
    1. Creating simple UI meters with UMG
      1. Drawing shapes with Widget Blueprints
      2. Customizing the meter's appearance
      3. Creating ammo and targets eliminated counters
      4. Displaying the HUD
    2. Connecting UI values to player variables
      1. Creating bindings for health and stamina
      2. Making text bindings for the ammo and targets eliminated counters
    3. Tracking the ammo and targets eliminated
      1. Reducing the ammo counter
      2. Increasing the targets eliminated counter
    4. Summary
    5. Quiz
  17. Chapter 8: Creating Constraints and Gameplay Objectives
    1. Constraining player actions
      1. Draining and regenerating stamina
      2. Preventing firing actions when out of ammo
    2. Creating collectible objects
    3. Setting a gameplay win condition
      1. Displaying a target goal in the HUD
      2. Creating a win menu screen
      3. Displaying the WinMenu
      4. Triggering a win
    4. Summary
    5. Quiz
  18. Part 3: Enhancing the Game
  19. Chapter 9: Building Smart Enemies with Artificial Intelligence
    1. Setting up the enemy actor to navigate
      1. Importing from the Marketplace
      2. Expanding the play area
      3. Making the level traversable with a NavMesh asset
      4. Creating the AI assets
      5. Setting up the BP_EnemyCharacter Blueprint
    2. Creating navigation behavior
      1. Setting up patrol points
      2. Creating the Blackboard keys
      3. Creating the variables in BP_EnemyCharacter
      4. Updating the current patrol point key
      5. Overlapping a patrol point
      6. Running the Behavior Tree in the AI Controller
      7. Teaching our AI to walk with the Behavior Tree
      8. Selecting the patrol points in the BP_EnemyCharacter instance
    3. Making the AI chase the player
      1. Giving the enemy sight with PawnSensing
      2. Creating a Behavior Tree Task
      3. Adding conditions to the Behavior Tree
      4. Creating a chasing behavior
    4. Summary
    5. Quiz
  20. Chapter 10: Upgrading the AI Enemies
    1. Creating an enemy attack
      1. Making an attack task
      2. Using the attack task in the Behavior Tree
      3. Updating the health meter
    2. Making enemies hear and investigate sounds
      1. Adding hearing to the Behavior Tree
      2. Setting up the investigating tasks
      3. Creating variables and a macro to update the blackboard
      4. Interpreting and storing the noise Event data
      5. Adding noise to the player's actions
    3. Making the enemies destructible
    4. Spawning more enemies during gameplay
      1. Creating the BP_EnemySpawner blueprint
    5. Creating enemy wandering behavior
      1. Identifying a wander point with a custom task
      2. Adding wandering to the Behavior Tree
      3. Last adjustments and test
    6. Summary
    7. Quiz
  21. Chapter 11: Game States and Applying the Finishing Touches
    1. Making danger real with player death
      1. Setting up a lose screen
      2. Showing the lose screen
    2. Creating round-based scaling with saved games
      1. Storing game information using the SaveGame class
      2. Saving game information
      3. Loading game information
      4. Increasing the TargetGoal
      5. Creating a transition screen to be shown between rounds
      6. Transitioning to a new round when the current round is won
    3. Pausing the game and resetting the save file
      1. Creating a pause menu
      2. Resuming the game
      3. Resetting the save file
      4. Triggering the pause menu
    4. Summary
    5. Quiz
  22. Chapter 12: Building and Publishing
    1. Optimizing your graphics settings
    2. Setting up our game to be played by others
    3. Packaging the game into a build
    4. Build configurations and packaging settings
    5. Summary
    6. Quiz
  23. Part 4: Advanced Blueprints
  24. Chapter 13: Data Structures and Flow Control
    1. Exploring different types of containers
      1. Array
      2. Set
      3. Map
    2. Exploring other data structures
      1. Enumerations
      2. Structures
      3. Data tables
    3. Flow control nodes
      1. Switch nodes
      2. Flip Flop
      3. Sequence
      4. For Each Loop
      5. Do Once
      6. Do N
      7. Gate
      8. MultiGate
    4. Summary
    5. Quiz
  25. Chapter 14: Math and Trace Nodes
    1. World and relative transforms
    2. Points and vectors
      1. Representation of a vector
      2. Vector operations
    3. Introduction to traces and trace functions
      1. Traces for objects
      2. Traces by channel
      3. Shape traces
      4. Debug lines
      5. Example of vectors and trace nodes
    4. Summary
    5. Quiz
  26. Chapter 15: Blueprints Tips
    1. Blueprint Editor shortcuts
    2. Blueprint best practices
      1. Blueprint responsibilities
      2. Managing Blueprint complexities
    3. Using miscellaneous Blueprint nodes
      1. Select
      2. Teleport
      3. Format Text
      4. Math Expression
      5. Set View Target with Blend
      6. AttachActorToComponent
      7. Enable Input and Disable Input
      8. The Set Input Mode nodes
    4. Summary
    5. Quiz
  27. Chapter 16: Introduction to VR Development
    1. Exploring the VR template
    2. The VRPawn Blueprint
    3. Teleportation
    4. Object grabbing
    5. Blueprint Communication using interfaces
    6. Interacting with the menu
    7. Summary
    8. Quiz
  28. Part 5: Extra Tools
  29. Chapter 17: Animation Blueprints
    1. Animation overview
      1. Animation Editor
      2. Skeleton and Skeletal Mesh
      3. Animation Sequence
      4. Blend Space
    2. Creating Animation Blueprints
      1. EventGraph
      2. AnimGraph
    3. Exploring State Machines
    4. Importing the Animation Starter Pack
    5. Adding Animation States
      1. Modifying the Character Blueprint
      2. Modifying the Animation Blueprint
    6. Summary
    7. Quiz
  30. Chapter 18: Creating Blueprint Libraries and Components
    1. Blueprint Macro and Function libraries
      1. A Blueprint Function Library example
      2. Creating the third function and testing
    2. Creating Actor Components
      1. Testing the Actor Component
    3. Creating Scene Components
    4. Summary
    5. Quiz
  31. Chapter 19: Procedural Generation
    1. Procedural generation with the Construction Script
      1. Creating the script to add the instances on the level
    2. Creating Blueprint Splines
      1. A Spline Mesh component
    3. Editor Utility Blueprint
      1. Creating an Actor Action Utility
    4. Summary
    5. Quiz
  32. Chapter 20: Creating a Product Configurator Using the Variant Manager 
    1. The Product Configurator template
    2. The Variant Manager panel and Variant Sets
    3. The BP_Configurator Blueprint
    4. UMG Widget Blueprints
    5. Summary
    6. Epilogue
    7. Quiz
  33. Appendix
    1. Quiz answers
    2. Why subscribe?
  34. Other Books You May Enjoy
    1. Packt is searching for authors like you

Product information

  • Title: Blueprints Visual Scripting for Unreal Engine 5 - Third Edition
  • Author(s): Marcos Romero, Brenden Sewell
  • Release date: May 2022
  • Publisher(s): Packt Publishing
  • ISBN: 9781801811583