Congratulations, you've gone and done it. You've just purchased the easiest to understand and most flexible lobby system on the marketplace, n00dLobby! Now to demonstrate its power and simplicity in this handy guide.
This system should cater for most implementations - i.e. you can spectate the Lobby, or immediately spawn in the Lobby with a controllable character. The same applies for gameplay spawning, so the choice is all yours.
To keep things simple for this guide, we will be assuming you want to spectate the player selection in the Lobby, but you could just as easily spawn in a controllable character by checking the desired checkboxes in the GameInstance > LobbyDefaults > LobbyGameSettings in the Class Defaults
Jump to any section by clicking on the categories below:
Let's begin!
Create a n00dLobby project and Migrate the n00dComponents folder into your own project
Inside the third person template project (representative of your own project), create yourself a GameInstance, a LobbyGameMode, a MenuGameMode, a LobbyPlayerController, and a GameplayPlayerController. We will be using the ThirdPersonGameMode as our GameplayGameMode for this example, and be renaming it to reflect that. This image contains all the BPs that we should have once this section is complete.
In the n00dComponents > n00dPacks > n00dGameplay > n00dLobby > Blueprints > Lobby folder, right click on N00dLobbySpectator and click on CreateChildBlueprintClass.
Drag that into your own folder structure.
Create a data table of type GameplayTagTableRow. Name it DT_MapTags.
Open this data table up and add all your maps found in your Levels folder, with their exact names (see: Level Setup).
Create a data table of type FN00dLobbyCharacterInfo. Name it DT_Characters
Right-click on ThirdPersonCharacter (representative of your own player character) and create the children you wish to use for the characters in your game.
Inside our created DT_MapTags data table, add all the levels you wish to use in here prefixed with Map. - making sure that the level name is exactly the same name as your level.
In DT_Characters, fill out your character classes - making sure to leave the NewRow at the beginning reserved for Character and named Empty. We are filling the character classes at runtime with your defined characters.
Create a Lobby, Menu, and TravelMap Level, and a folder called Levels.
Here we drag and copy the ThirdPersonExample Map into the Levels folder and rename it Level_01. Copy that 3 times so we have 3 levels in this folder (this is just for you to see how it's done, it's very easy to switch levels up once you know how).
In the Menu's Level BP call SetN00dLobbyShowMainMenu on the game instance.
In the world settings of the Menu map, add the MenuGameMode on the override
In the Lobby map add the LobbyGameMode to the override.
In the Lobby Map, add a floor, post process volume, and some lights (modify these to your liking), and drag in the number of N00dLobbyPlayerStarts as desired - we are placing the number corresponding to the Max in the game instance here. So, 6.
In each of your levels, place the default player starts where you need them and tag them appropriately - the PlayerStartTag will be used for mission spawning if that has been selected on the Lobby menu
You also want to override each of your playable levels with the GameplayGameMode in the World Settings
In your project settings, define your Game Instance and the maps shown in the screenshot.
In the GameplayTags settings, reference DT_MapTags in the GameplayTagTableList array
Open your MenuGameMode and add this OnBeginPlay
And make sure your Class Defaults look like this, and close the MenuGameMode as we are finished with it.
Open your LobbyGameMode and add BPC_N00dLobby to the components window
And your Class Defaults should look like this
Add the BPI_N00dLobby interface in the Class Settings. Compile.
Open the N00dLobbyGameMode included in the n00dLobby folder structure, and copy everything you see on the Event Graph and the Interface Graph...
... into the Event Graph of your LobbyGameMode
Right click on ConnectedPlayer and create the variable. Then compile and save.
Navigate to the interface getter functions
And add the following values to the outputs
ConnectedPlayers
AllPlayerControllers
Under Multiple we need to define the lobby component.
Override SpawnDefaultPawnFor and add this node within, making sure to check the bool to indicate this is a lobby spawn.
You may now close this game mode
Open your GameplayGameMode and add BPC_N00dLobby to the components window
Add the BPI_N00dLobby interface in the Class Settings. Compile.
Your Class Defaults should look like this
Open the N00dGameplayGameMode included in the n00dLobby folder structure, and copy everything you see on the Event Graph and the Interface Graph...
... into the Event Graph of your GameplayGameMode
Override SpawnDefaultPawnFor and add this node within.
Compile and save. You may now close all the windows we had open.
There is no ability to put a component in the game instance so we are using interface functions to get what we need from it.
Add the BPI_N00dLobby interface in the Class Settings. Compile.
Open N00dLobbyGameInstance and Ctrl+Drag all of the variables onto the graph and cut them.
Then paste them in MyGameInstance. Right-click on each of them and CreateVariable. Once they are all created you may remove them from the Graph.
Your MyGameInstance should now have these variables. Make sure to fill out the defaults of the values that require it.
For a detailed run-down on which editable values are necessary, please visit the Overview for more information.
Back in the N00dLobbyGameInstance select everything on the Event Graph and paste it in your MyGameInstance. Compile.
Return to N00dLobbyGameInstance and now copy everything from the Interface Graph into your Event Graph
Navigate to each of the interface getters and assign the corresponding value to the output in MyGameInstance. For reference, look at what is used in each of these functions from the N00dLobbyGameInstance. You may also copy paste those if you wanted to.
Also fill in the BanList and PlayerInfo in the Multiple interface getter section
Also make sure to change the Data Table here to your own DT_Characters table.
We are done here. Compile, save, and close both Game Instances
Open up LobbyPlayerController and add BPC_N00dLobby to the components window
Add the BPI_N00dLobby interface in the Class Settings. Compile.
In each of the interface getters, supply the output with the necessary references. Take a look at the N00dLobbyController for what values are used.
Also under multiple we need to define the lobby component
Open N00dLobbyController and copy everything on the Interface Graph...
... and paste it in the Event Graph of LobbyPlayerController
You may now close both lobby controller windows after compilation and saving.
Open up GameplayPlayerController and add BPC_N00dLobby to the components window
Add the BPI_N00dLobby interface in the Class Settings. Compile.
In the GetN00dLobbyLoadedPlayerInfo interface getter, supply the output as needed.
Also under multiple we need to define the lobby component.
Open N00dGameplayController and copy everything on the Interface Graph...
... and paste it in the Event Graph of GameplayPlayerController
You may now close both gameplay controller windows after compilation and saving.
We must now go and define our subsystem in the DefaultEngine.ini. Here is where you'd add your Steam config if desired but we are just adding the default OSS for the example. Add this line to your ini.
For this to take effect you must restart your project.
[OnlineSubsystem]
DefaultPlatformService=Null
That is us. Enjoy the fruits of your labour