Skip to content

Multiplayer Reference

Allow players to connect to lobbies and play together. Read more explanations about it.

Actions

Disable variable synchronization
Disable synchronization of the variable over the network. It will not be sent to other players anymore.

End Lobby Game
End the lobby game. This will trigger the "Lobby game has just ended" condition.

Get message variable
Store the data of the specified message in a variable. Use with the condition 'Message has been received' to know when the message has been properly processed by the host.

Leave Game Lobby
Leave the current game lobby. This will trigger the "Player has left" condition on the other players, and the "Lobby game has ended" condition on the player leaving.

Open Game Lobbies
Open the game lobbies window, where players can join lobbies or see the one they are in.

Remove ownership of variable
Remove the ownership of the variable. It will still be synchronized to other players, but the host owns it.

Send custom message to other players
Send a custom message to other players in the lobby, with an automatic retry system if it hasn't been received. Use with the condition 'Message has been received' to know when the message has been properly processed by the host.

Send custom message to other players with a variable
Send a custom message to other players in the lobby containing a variable, with an automatic retry system if it hasn't been received. Use with the condition 'Message has been received' to know when the message has been properly processed by the host.

Player variable ownership
Change the player owning the variable.

Allow players to close the lobbies window
Allow players to close the lobbies window. Allowed by default.

Take ownership of variable
Take the ownership of the variable. It will then be synchronized to other players, with the current player as the owner.

Conditions

Current player number in lobby
Compare the current player number in the lobby (1, 2, ...).

Any player has left
Check if any player has left the lobby.

Lobby game has just ended
Check if the lobby game has just ended.

Lobby game has just started
Check if the lobby game has just started.

Custom message has been received from another player
Check if a custom message has been received from another player. Will be true only for one frame.

Player has left
Check if the player has left the lobby.

Lobbies window is open
Check if the lobbies window is open.

Lobby game is running
Check if the lobby game is running.

Player is host
Check if the player is the host. (Player 1 is the host)

Player variable ownership
Compare the player owning the variable.

Number of players in lobby
Compare the number of players in the lobby.

Expressions

Expression Description
Multiplayer::CurrentPlayerNumber() Return the current player number in the lobby (1, 2, ...).
Multiplayer::CurrentPlayerPing() Get the ping of the current player in the lobby.
Multiplayer::CurrentPlayerUsername() Get the username of the current player in the lobby.
Multiplayer::MessageData(string) Returns the data received when the specified message was received from another player.
string Message name
Multiplayer::MessageSender(string) Returns the player number of the sender of the specified message.
string Message name
Multiplayer::PlayerPing(number) Get the ping of the player in the lobby.
🔢 Number The position of the player in the lobby (1, 2, ...)
Multiplayer::PlayerUsername(number) Get the username of the player in the lobby.
🔢 Number The position of the player in the lobby (1, 2, ...)
Multiplayer::PlayerVariableOwnership(variable) Return the player owning the variable.
🗄️ Any variable Variable
Multiplayer::PlayersInLobbyCount() Return the number of players in the lobby.

Multiplayer object

Allow the object to be synchronized with other players in the lobby.

Behavior actions

Enable (or disable) the synchronization of a behavior
Enable or disable the synchronization of a behavior over the network. If disabled, the behavior's current state will not be sent to other players anymore.

Remove object ownership
Remove the ownership of the object from the player. It will still be synchronized to other players, but the host owns it.

Player object ownership
Change the player owning the object.

Take ownership of object
Take the ownership of the object. It will then be synchronized to other players, with the current player as the owner.

Behavior conditions

Is object owned by current player
Check if the object is owned by the current player, as a player or the host.

Player object ownership
Compare the player owning the object.

Behavior expressions

Expression Description
Object.MultiplayerObject::PlayerObjectOwnership() Return the player owning the object.

This page is an auto-generated reference page about the Multiplayer feature of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop features here.