In this part of the tutorial, you learn how to set up simulated players to test your project at scale.
Watch the video for this part of the tutorial:
Map06_SimulatedPlayers with two real players and two simulated players
6 - Simulated Players
Before you play this map, make sure you set the number of simulated players you want in the Editor Preferences.
A simulated player is a client-worker instance that is controlled by simulated player logic, as opposed to real player input. You can use simulated players to test your game at scale.
A very simple simulated player (
BP_SimulatedPlayer) moves around in this map.
To set up simulated players, you create a character class specifically for them and add custom behaviour to this class. To create behaviours for your simulated players, you use native Unreal Engine simulated players and behavior trees.
In this tutorial, the Blueprint Classes
Game/AI/BT_Wander define the simulated players.
When you use simulated players in your own games, you must specify which Blueprint Class to use for the simulated players in each map. To do this, set the following properties:
- In the Blueprint Class for your simulated players, set IsSimulate to
- In the Game Mode Blueprint Class for your map, in Simulated Pawn Class, select the Blueprint Class for your simulated players
You don’t need to do this in the tutorial, because these properties are already set for you.
Image: The Game Mode Blueprint Class
BP_Map06GameMode used for the map
Map06_SimulatedPlayers. Note that Simulated Pawn Class is already set
In this tutorial, you run simulated players on a local deployment. To test your game at scale, you need to run simulated players in a cloud deployment. For more information, see Simulated players.
To view the simulated players tutorial, follow these steps:
- Open the Example Project in the Unreal Editor.
- In the Content Browser, open InGameTutorial > Maps > Map06_SimulatedPlayers.
- To stop your existing local deployment, in the GDK toolbar, click Stop Deployment.
- Go to Edit > Editor Preferences > Level Editor > Play.
- In Number Of Simulated Players, enter
When you start the game, the GDK will spawn additional client windows for the simulated players. There might be a delay before the simulated players start moving.
- In the Unreal toolbar, click Play.
- Play the game.
You’ve finished the in-game tutorial.
- Follow the Offloading tutorial: in this you set up the Example Project to run on multiple server-worker instances.
- If you have an existing Unreal multiplayer project, you can follow the detailed porting guide to get it onto the GDK.
- If you want to start a project from scratch, follow the setup tutorial for the Starter Template to set up a blank project using the GDK.
- To set up your project for mobile game-client development, see the documentation on mobile set up for Android or iOS.
2020-08-12 Page added with editorial review
Updated about a year ago