Skip to content

Multiplayer

Some immersive applications are built to allow multiple Participants to interact in a shared world. When multiple sessions have the same LobbyId, it allows our system to logically group these sessions together with minimal client side effort.

We are gradually integrating out-of-the-box support for the most common multiplayer frameworks. For more information, please refer to our page on components.

Networking Structure

The Cognitive3D SDK is not designed to record multiple sessions from a centralized server. It is designed to run on a client.

Lobby Id

Participants with the same LobbyId indicates they were present together in a multiplayer experience. The LobbyId value can be any string value, such as a RoomId from a persistent server or a unique GUID generated by a host. Please get in contact to discuss your implementation details.

Example

An pseudocode implementation:

//SERVER
string LobbyId;
void GenerateLobbyId()
{
    //this can be any value shared between clients
    LobbyId = System.Guid.NewGuid().ToString();

    //send to all players
    Network.RPC("SetLobbyId",RPCTarget.AllBuffered,LobbyId);
}

//CLIENT
//called on each client to set matching lobby id
[RPC]
void SetLobbyId(string lobbyId)
{
    Cognitive3D.Cognitive3D_Manager.SetLobbyId(lobbyid);
}

intercom If you have a question or any feedback about our documentation please use the Intercom button in the lower right corner of any web page.