Unreal Engine 5 Game Development with C++ Scripting Become a Professional Game Developer and Create Fully Functional, High-Quality Games

Expand your UE5 game development skills by leveraging C++ scripting and improve your game development abilities by building a game from scratch Purchase of the print or Kindle book includes a free PDF eBook Key Features Learn C++ programming as well as C++ scripting for Unreal Engine 5 Practice the...

Full description

Bibliographic Details
Other Authors: Li, George, 1995- author (author), Roberts, E. Wyn, author
Format: eBook
Language:Inglés
Published: Birmingham, England : Packt Publishing [2023]
Edition:First edition
Subjects:
See on Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009764838006719
Table of Contents:
  • Cover
  • Title Page
  • Copyright and Credits
  • Foreword
  • Contributors
  • Table of Contents
  • Preface
  • Part 1 - Getting Started with Unreal C++ Scripting
  • Chapter 1: Creating Your First Unreal C++ Game
  • Technical requirements
  • Understanding C++ scripting in Unreal
  • What is the difference between C++ and Blueprint?
  • When do you use C++?
  • What is the difference between C++ programming and C++ scripting?
  • Creating your C++ Shooter project from a template
  • Installing Visual Studio 2022
  • Ensuring your UE has the source code installed
  • Launching the UE5 editor through the Epic Games Launcher
  • Creating the MyShooter C++ project
  • Associating VS with UE5 as the default source code editor
  • Opening the C++ source code in VS (optional)
  • Converting an existing Blueprint project to a C++ project
  • Summary
  • Chapter 2: Editing C++ Code in Visual Studio
  • Technical requirements
  • Launching VS
  • Walking through the VS IDE's UI
  • Code editor
  • Menus
  • Search box
  • Toolbar
  • Solution Explorer
  • Output window
  • Error List window
  • Editing code in VS
  • Controlling the caret (input cursor)
  • The text editing keys
  • Code selection
  • IntelliSense
  • Useful editing hotkeys
  • Practicing C++ coding
  • Creating a new C++ solution in VS
  • Creating the main.cpp file
  • Changing the editor theme
  • Writing the initial code for main.cpp
  • Adding the Calculator class
  • Summary
  • Chapter 3: Learning C++ and Object-Oriented Programming
  • Technical requirements
  • What is C++?
  • Exploring the C++ program structure
  • Defining C++ functions
  • Defining functions with or without parameters
  • Calling functions
  • Writing the main() function
  • Working with a basic calculator program
  • Learning the C++ syntax
  • Using the C++ data types
  • Defining variables
  • Using C++ arrays
  • Using C++ operators
  • Accepting user input.
  • Adding C++ comments
  • Controlling the C++ flow
  • Working on the improved calculator program
  • Creating references and pointers
  • References
  • Pointers
  • Understanding OOP
  • What is OOP?
  • What are classes and objects?
  • Creating classes in C++
  • Creating objects in C++
  • Working on an OOP calculator program
  • Adding constructor and getter functions for the calculator class
  • Creating the CalculatorEx class, which inherits from the Calculator class
  • Summary
  • Chapter 4: Investigating the Shooter Game's Generated Project and C++ Code
  • Technical requirements
  • Understanding the MyShooter C++ project structure
  • Understanding the game program structure
  • Getting familiar with the source code
  • MyShooterCharacter.h
  • MyShooterCharacter.cpp
  • MyShooterProjectile.h and MyShooterProjectile.cpp
  • TP_PickUpComponent.h and TP_PickUpComponent.cpp
  • TP_WeaponComponent.h and TP_WeaponComponent.cpp
  • MyShooter.h and MyShooter.cpp
  • MyShooterGameMode.h and MyShooterGameMode.cpp
  • MyShooter.Build.cs, MyShooter.Target.cs, and MyShooterEditor.target.cs
  • Launching Unreal Editor and opening the game project in Visual Studio
  • Summary
  • Part 2 - C++ Scripting for Unreal Engine
  • Chapter 5: Learning How to Use UE Gameplay Framework Base Classes
  • Technical requirements
  • Creating a Pangaea top-down game project
  • Understanding the gameplay framework base classes
  • Creating game actor classes
  • Creating the ADefenseTower class
  • Creating the AProjectile class
  • Creating the APlayerAvatar class
  • Recompiling C++ projects
  • Using the UPROPERTY macro
  • The UPROPERTY syntax
  • The UPROPERTY specifiers and metadata keys
  • Marking the ADefenseTower, AProjectile, and APlayerAvatar attributes as UE properties
  • Using the UFUNCTION macro
  • The UFUNCTION syntax
  • UFUNCTION specifiers and metadata keys.
  • Tagging ADefenseTower and APlayerAvatar member functions as UFUNCTION macros
  • Adding components to the new actors
  • Including component header files
  • Defining private properties for these two components
  • Adding public getter functions to the components
  • Creating components in the class constructor
  • Creating blueprints from the new actor classes
  • Learning about the Unreal gameplay framework classes
  • Locating and creating gameplay framework classes in Pangaea
  • Learning about the PlayerController class
  • Learning about the GameModeBase class
  • GameState
  • GameInstance
  • Retrieving class instances from your code
  • Using the Cast template function
  • Summary
  • Chapter 6: Creating Game Actors
  • Technical requirements
  • Setting up the player avatar
  • Adding SpringArmComponent and CameraComponent to PlayerAvatar
  • Initializing the player avatar
  • Setting up the character's SkeletalMeshComponent
  • Importing the character model
  • Using the Hero skeletal mesh in BP_PlayerAvatar
  • Replacing the game's player pawn
  • Creating the player avatar's animation blueprint
  • Creating the PlayerAvatarAnimInstance class
  • Creating the ABP_PlayerAvatar blueprint
  • Creating the State Machine on ABP_PlayerAvatar
  • Syncing the movement speed with the animation instance
  • Summary
  • Chapter 7: Controlling Characters
  • Technical requirements
  • Controlling the player character to attack
  • Adding the Attack action to the action map
  • Binding the handler function to the Attack action
  • Implementing the OnAttackPressed() action handler function
  • Implementing the CanAttack() and Attack() functions
  • Processing non-loop animations
  • Implementing the OnStateAnimationEnds function
  • Destroying actors
  • Creating the enemy character
  • Creating the Enemy class
  • Creating the EnemyController class
  • Creating the ABP_Enemy animation blueprint.
  • Creating the BP_Enemy blueprint
  • Testing the game
  • Summary
  • Chapter 8: Handling Collisions
  • Technical requirements
  • Understanding collision detection
  • Setting the collision presets
  • Using collisions for game interactions
  • Downloading and creating the weapon, defense tower, and fireball actors
  • Picking up weapons
  • Spawning a weapon for the enemy
  • Defense tower firing fireballs
  • Moving the fireball and checking whether the target is hit
  • Processing a defense tower hit
  • Summary
  • Chapter 9: Improving C++ Code Quality
  • Technical requirements
  • Refactoring code
  • Combining the PlayerAvatarAnimInstance and EnemyAnimInstance classes
  • Making PangaeaCharacter the parent class of APlayerAvatar and AEnemy
  • Refining code
  • Using caching variables
  • Creating a fireball pool
  • Outputting debug messages
  • Using the UE_LOG macro
  • Printing debug messages to the screen
  • Checking an Actor instance's actual class type
  • Summary
  • Part 3 - Making a Complete Multiplayer Game
  • Chapter 10: Making Pangaea a Network Multiplayer Game
  • Technical requirements
  • Comparing single-player and multiplayer games
  • Launching the multiplayer Pangaea game in the editor
  • Understanding multiplayer game network modes
  • Handling network synchronizations
  • Notifying player attacks with RPCs
  • Syncing actor variables to clients with replications
  • Updating the character health bar with RepNotify
  • Processing hits on the server
  • Spawning fireballs on the server side
  • Summary
  • Chapter 11: Controlling the Game Flow
  • Technical requirements
  • Designing the Pangaea game's flow
  • Creating the UI widgets
  • Creating BP_LobbyWidget
  • Creating BP_HUDWidget
  • Creating BP_GameOverWidget
  • Adding networking functions to PangaeaGameInstance
  • Adding UI widgets to game levels
  • Adding the game timer.
  • Adding the Timer variable to the APangaeaGameState class
  • Making the Timer variable replicable
  • Defining OnTimeChangedDelegate
  • Creating and binding the custom event to OnTimeChangedDelegate
  • Counting down the timer
  • Designating APangaeaGameState as the project's game state class
  • Destroying a base defense tower to win the game
  • Summary
  • Chapter 12: Polishing and Packaging the Game
  • Technical requirements
  • Polishing the game
  • Importing and using high-quality game assets
  • Fixing bugs
  • Profiling and optimization
  • Using Unreal Engine console commands
  • Exploring modes and console commands
  • Executing console commands in C++
  • Packaging the game
  • Configuring the project settings for packaging
  • Making the build a windowed game
  • Avoiding the hardcoded path for finding content
  • Packaging the project
  • What to do next
  • Summary
  • Index
  • Other Books You May Enjoy.