1. Help Center
  2. Getting Started
  3. Online Multiplayer Features

How To Create A Global Lobby

Creating lobbies where players gather before online multiplayer games with Diarkis is simple and easy. A global lobby is where all connected players gather together.

What Diarkis Modules We Need

To a global lobby, we use Diarkis Room, Diarkis Group, and Diarkis MatchMaker.

What A Global Lobby Can Do

Here are some of many things that a global lobby can do.

  • Send and Receive Global Notifications
  • Creating rooms (game sessions)
    • Multiplayer Game Using Diarkis Room
    • Multiplayer Game Using Diarkis P2P
  • Listing of available rooms to join by categories
  • Random Matchmaking

Sending And Receiving Global Notifications

Diarkis Group has a feature called Static group. This feature allows you to create static groups that does not go away and keeps the same group IDs.

Have all players join this static group and you will be able to send and receive global notifications via static group.

Creating Rooms (Game Sessions)

With Diarkis Room, players may freely create rooms to start a multiplayer game session with other players in the lobby. 

Here is the instruction on how to create a room.

The player may assign a category to the room and let other players find your room.

Multiplayer Game Session With Diarkis Room

With Diarkis Room, all joined players will be using Diarkis Room's built-in feature of BroadcastTo and/or MessageTo to synchronize between the player clients. 

Multiplayer Game Session With Diarkis P2P

With Diarkis P2P, all joined players will be sharing their client addresses via Diarkis Room's BroadcastTo and pass them to Diarkis P2P to start peer-to-peer connections.

NOTE: Diarkis P2P supports only Diarkis UDP Client.

How to get client's own client address (C# Client SKD)

string clientAddress = diarkisUDPClient.GetAddress();

Listing of Available Rooms To Join By Categories

Diarkis Room can assign a type (category) to a room and the clients can search a list of rooms by assigned type (category).

Players can see the list of available rooms by the category and select a room to join and start the multiplayer game.

How To Assign A Category To A Room

Only the player who created the room may assign a category to the room.

Here is the instruction on how to create a room.

NOTE: The example below uses C# Client SDK.

// For example, category = 1 means difficulty HARD
uint category = 1;

// Room name that you may assign to the room
string roomName = "For hardcore players only";

// Any information that you may want to assign to the room
string roomMetadata = "No noob allowed lol";

// Capture the server response of room.Register
room.OnRegister += (bool success, byte[] message) =>
{
// This event is the response of room.Register
}

// This is how to assign the category to a room that the client has already joined
room.Register(category, roomName, roomMetadata)

How To Retrieve A List of Available Rooms By A Category

NOTE: The example below uses C# Client SDK.

// For example, category = 1 means difficulty HARD
uint category = 1;

// This controls how many rooms to retrieve
uint howManyItemsToRetrieve = 10;

// This capture the server response to receive the list of rooms
room.OnFindRoomsByType += (bool success, List<RoomListItem> rooms) =>
{
// Loop the list to work your magic!
for (int i = 0; i < rooms.Cont; i++)
{
string roomID = rooms[i].GetID();
string roomName = rooms[i].GetName();
string roomMetadata = rooms[i].GetMetadata();
}
}

// This is how to request for the list of rooms
room.FindRoomsByType(category, howManyItemsToRetrieve);

Random Matchmaking

Diarkis MatchMaker allows you to create flexible and scalable random matchmaking.

To set up and create matchmaking, please read here.