Book Image

Multiplayer Game Development with Unreal Engine 5

By : Marco Secchi
Book Image

Multiplayer Game Development with Unreal Engine 5

By: Marco Secchi

Overview of this book

If you’re fascinated by the immersive gaming experiences that enable multiple users to engage in collaborative or competitive gameplay, this Unreal Engine 5 game development book is for you. In this book, you’ll learn the foundational principles behind multiplayer games. Starting with a sample project, you’ll learn how to set up a networked system and make it work. Once the prototype of the project is functional, you’ll start adding game logic, including obstacles and AI opponents, to heighten the challenges and engagement, offering a captivating experience for players. Next, you’ll learn how to debug and optimize the project, before finally deploying the game build and integrating it with cloud services such as the Epic Online Services system. By the end of this book, you’ll have the confidence to develop and manage multiplayer experiences using the Unreal Engine environment, taking your newfound programming skills in your upcoming projects.
Table of Contents (22 chapters)
1
Part 1:Introducing Multiplayer Games
5
Part 2:Networking and Multiplayer Games in Unreal Engine
10
Part 3:Improving Your Game
15
Part 4:Deploying Your Game Online

Creating a session

In this section, you will be creating a user interface widget that will let you manage session creation. In particular, the Create Session widget will do the following:

  • Let the player select how many players are allowed to connect in a single session
  • Create the session with the click of a button
  • Open the game level and start the game

The first thing we must do is create the actual widget so, in the Blueprints folder of the Content Browser, do the following:

  1. Right-click and select User Interface | Widget Blueprint. In the pop-up window that appears, select User Widget, as shown in Figure 12.2:
Figure 12.2 – The user widget creation window

Figure 12.2 – The user widget creation window

  1. Name the newly created widget WB_CreateSession and double-click on it to open it.

Now, we will add the visual elements.

Adding the visual elements

Once the editor is open, select the Designer view and do the following:

  1. From the Palette...