Book Image

Unreal Engine 5 Game Development with C++ Scripting

By : ZHENYU GEORGE LI
Book Image

Unreal Engine 5 Game Development with C++ Scripting

By: ZHENYU GEORGE LI

Overview of this book

Unreal Engine is one of the most popular and accessible game engines in the industry, creating multiple job opportunities. Owing to C++ scripting's high performance, advanced algorithms, and engineering maintenance, it has become the industry standard for developing commercial games. However, C++ scripting can be overwhelming for anyone without a programming background. Unreal Engine 5 Game Development with C++ Scripting will help you master C++ and get a head start on your game development journey. You’ll start by creating an Unreal Engine C++ project from the shooter template and then move on to building the C++ project and the C++ code inside the Visual Studio editor. You’ll be introduced to the fundamental C++ syntax and essential object-oriented programming concepts. For a holistic understanding of game development, you’ll also uncover various aspects of the game, including character creation, player input and character control, gameplay, collision detection, UI, networking, and packaging a completed multiplayer game. By the end of this book, you’ll be well-equipped to create professional, high-quality games using Unreal Engine 5 with C++, and will have built a solid foundation for more advanced C++ programming and game development technologies.
Table of Contents (18 chapters)
1
Part 1 – Getting Started with Unreal C++ Scripting
6
Part 2 – C++ Scripting for Unreal Engine
12
Part 3: Making a Complete Multiplayer Game

What this book covers

Chapter 1, Creating Your First Unreal C++ Game, guides you quickly through creating a new C++ game project based on the Shooter template in Unreal. This chapter also introduces how to convert an existing Blueprint game project into a C++ game project.

Chapter 2, Editing C++ Code in Visual Studio, provides basic information on how to use the powerful integrated development environment Microsoft Visual Studio to edit C++ code. This chapter not only presents the editing skills needed but also demonstrates how to create a calculator application in C++.

Chapter 3, Learning C++ and Object-Oriented Programming, goes deeper into C++ programming based on the previous chapter’s calculator project. This chapter covers the fundamental C++ syntax, data types, flow control, and so on. C++ object-oriented programming is also introduced in this chapter.

Chapter 4, Investigating the Shooter Game’s Generated Project and C++ Code, explores the details of the generated shooter game project, including the project files’ structure and the source files. In this chapter, the C++ code lines are briefly explained, so that you gain an overall understanding of how C++ code works.

Chapter 5, Learning How to Use the UE Gameplay Framework Base Classes, instructs you on how to create our new top-down game project, Pangaea. You will be guided on how to create the game actors, DefenseTower, for instance, and the game character, PlayerAvatar classes, for instance, as well as defining actor properties and functions in C++.

Chapter 6, Creating Game Actors, provides steps to write code and set up the main character for the Pangaea game. It includes setting up the character, creating the animation instance, defining the state machine, and synchronizing the animations.

Chapter 7, Controlling Characters, provides methods of controlling game characters. This includes configuring the input map, handling player input, and effectively processing the reactions of the player character. Additionally, you will be introduced to the AI controller and the navigation system for controlling non-player characters.

Chapter 8, Handling Collisions, discusses the engine’s collision system and its configurations for game interactions. To handle collision events – attack hits and projectile hits, for example – you will learn how to configure actor colliders and triggers. Using ray casts to check whether a projectile hits the target is also introduced in this chapter.

Chapter 9, Improving C++ Code Quality, presents how to employ software engineering practices during code refactoring and refinement. This chapter implements class generalization, caching, and pooling methods to improve the game code’s quality and performance.

Chapter 10, Making Pangaea a Network Multiplayer Game, starts by introducing the fundamental concepts related to multiplayer games, including servers, clients, and multiplayer modes. You will be guided step by step through converting the single-player Pangaea game into a multiplayer game.

Chapter 11, Controlling the Game Flow, intends to make Pangaea a complete multiplayer game, which has a main menu as the lobby, so that players can decide whether they want to start a host or join a game session. C++ and Blueprint scripting skills for user interface operations are also revealed in this chapter.

Chapter 12, Polishing and Packaging the Game, provides resources, methods, and suggestions on how to polish games from both visual experience and product quality aspects. This chapter also provides steps for configuring and packaging the Pangaea project to be an executable standalone game for distribution.