Getting Started
Product Overview
Multiplayer Lobby System V2 (Will be called MLS throughout the documentation) is a complete multiplayer lobby system with a built-in, multiplayer ready chat feature. Everything has been built and designed with ease of use in mind.
​
​
In this section of the documentation we will go through the basics of the pack and how to get everything up and running as quick as possible.
Click here if you wish to skip the overview and go straight into setting up the lobby system.
​
​
​
​
The MLS offers a solid base structure to build off of. In this section we'll be going through each part of the structure and find out how they work and what they are meant for.
​
​
​
​
​
​
​
​
​
​
​
Most network related logic is written in one of these classes.
These classes have been divided into two categories:
- Game
- Player
The game section contains most logic regarding game related networking blueprints, and the player, as the name would suggest, contains most logic regarding the player related networking blueprints.
As you will see, both the folders Game and Player contain 4 folders:
-
Base
-
Gameplay
-
Lobby
-
MainMenu
This has been done as a way to separate the different pieces of blueprint from eachother to ensure everything stays nice and organised. The gameplay blueprints will and should be active during gameplay levels, Lobby blueprints during the lobby level and so on..
​
Lets go over each of the classes:
​​
BP_GM_GameMode
The gamemode is used as a way of guiding the game. This is where the way the game should work is defined.
When a player logs in, this is where the PlayerController gets passed and gets told what to do and which pawn to possess.
​
Instead of setting a default Pawn class in the gamemode, instead we set it to none. The gamemode then spawns a pawn for each playercontroller in a separate function and assigns it manually. This allows for more flexibility regarding the spawning and respawning of players.
As you can see in the picture above, once the player logs in, a PlayerController gets passed and gets added to the player list. Then, after a short delay to make sure the PlayerState (we will get to this in a bit) instantiated, we spawn the Pawn and have the new PlayerController possess it as shown in the picture below.
​
​
​
​
​
​
To give you a few examples of what the GameMode should be used for: Starting the game, respawning players, ending a game, calculating a winner, etc.
​
​
BP_GS_GameState
The gamestate is a relatively simple, but very important class. This class stores most of the current match or games information such as:
-
Team scores
-
Round timers
-
Players
-
Ready players
And in our case, it's also responsible for storing the available map list. This list determines the available maps in the map selection (we'll get to this later in the documentation).
​
BP_HUD_HUD
The HUD class is a way of organising most HUD elements. Instead of spawning the widgets directly from the PlayerController, instead you create the widgets from the HUD class and call these functions from the PlayerController.
​
​
BP_PC_PlayerController
The PlayerController is responsible for handling input from the player and deciding which UI to spawn or despawn. Each connected client has its own PlayerController.
​
BP_PS_PlayerState
The PlayerState is responsible for storing player specific, network relevant information such as:​
-
Lives
-
Guild ID
-
Connection type
-
Username
​
​
​
​
​
​
​
This lobby system was designed to be as user friendly as possible and thus requires very little setup.
​
Creating a custom lobby
First of all, you probably want to create your own custom lobby. To do this, go ahead and create a new level. Design it exactly the way you like.
The next step is very important:
Make sure you set the GameMode of your lobby to BP_GM_GameMode_Lobby
as shown in the picture on the right.
This system supports an unlimited amout of players for each lobby, and each player can be placed anywhere throughout the lobby.
​
Adding spawnpoints to your lobby
To add a spawnpoint, navigate to the following blueprint (BP_SpawnPoint):
​
​
​
​
​
​
​
​
​
​
​
Drag this into your lobby scene in the exact order you'd like your players to spawn. The host will spawn on the first instance of a spawnpoint you place, the next player will spawn on the second one and so on..
That's all you have to do regarding spawnpoints. The players will now automatically be spawned at their corresponding locations.
​
To set the camera of the lobby, simply drag in the BP_Camera actor into your scene and position in the way you want.
(Tip: You can click the actor to get a preview of what the camera sees)
​
​
Setting the correct Pawn type
You probably also want your own PlayerCharacter instead of the default Unreal Engine one. Doing this is very simple. Head over to the BP_GM_GameMode_Lobby blueprint.
​
​
​
​
​
​
​
​
​
​
​
In this blueprint you will find the PawnClass variable.
​
​
Make sure you set the default value of this variable to your own PlayerCharacter.
The lobby will now automatically show your own PlayerCharacter instead of the default one.
​
If you ever decide to create a new level for the MainMenu, make sure to also update the MainMenuLevel variable in the BP_GM_GameMode_Lobby blueprint. Beware: this is case sensitive and the name should be copied exactly.
Adding custom maps to your MapSelection
To add your own maps to the map selection (and delete the demo ones), navigate to the BP_GS_GameState_Lobby blueprint.
​
​
​
​
​
​
​
​
​
​
​
In this blueprint you will find the AvailableMaps variable. In this array you can simply store all the names of the maps you wish to be included in the map selection, and the map selection will update automatically. Beware: this is case sensitive and the name has to be copied exactly.
​
​
​
If you wish to change the length of the countdown timer this can simply be done in the Countdown variable in the same blueprint.
​
​
​
​
The MLS features an easy to implement, multiplayer ready chat system.
To allow a player to chat, simply add the AC_ChatComponent to their character as shown in the picture below.
​
​
​
Make sure you only add this component to the PlayerCharacter.
Then, to add the chat to the screen, simply create a widget and add the WBP_ChatBox to the widget. If you already have an existing widget you can add the Chatbox to this widget instead.
​
If you wish to change the chatsound, head over to the AC_ChatComponent blueprint. Here you will find a variable called ChatSound. You can change this to your preferred sound.
​
​
​
​
​
​
​
​
​
​
​
​
Creating your own custom pop-ups has never been easier.
To create a pop-up, simply add a Create Widget node to the character you would like to see the pop-up.
​
​
​
​
​
​
​
After that, you will be met with a bunch of customization options.
Go ahead and fill these out to your liking, and don't forget to add it to the viewport.
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
Title: The title of the pop-up. This will be shown at the top of the pop-up.
​
Content: The main text of the pop-up. This will be shown in the middle of the pop-up.
​
Color: The color of the top bar of the pop-up.
​
Auto Despawn: Should the pop-up automatically despawn after a set amount of time?
​
Despawn Time: If Auto Despawn is set to true, how long should the pop-up be on screen before despawning?
​
Open Sound: The sound the pop-up makes when it gets spawned.
​
Close Sound: The sound the pop-up makes when it despawns.
​
Has Accept Button: Whether or not the pop-up should have an accept button. The accept button will despawn the pop-up as soon as it's clicked.
​
​
​
​
​
Structure




Setting up









Chat component



Pop-Ups


