Godot Version
v4.5.stable
Question
I am implementing multiplayer mode in my game using GodotSteam plugin. My goal right now is to create a lobby, then request a list of all the current lobbies and see myself there. And it doesn’t really work.
MRE:
var app_id = 480
func _ready() -> void:
OS.set_environment("SteamAppId", str(app_id))
OS.set_environment("SteamGameId", str(app_id))
print("Steam init: " + str(Steam.steamInit()))
Steam.lobby_created.connect(_on_lobby_created)
Steam.lobby_match_list.connect(_on_lobby_list_loaded)
Steam.createLobby(Steam.LOBBY_TYPE_PUBLIC, 2)
func _process(_delta: float):
Steam.run_callbacks()
func _on_lobby_created(_connect: int, _lobby_id: int):
Steam.requestLobbyList()
func _on_lobby_list_loaded(lobby_list: Array):
print(lobby_list)
As you can see I create a public lobby and then, when Steam is done creating it, I request a list of all the visible lobbies. Since I am using Spacewar, I expect a bunch of other developers’ and pirates’ lobbies in the list as well as mine. But I get an nothing:
Steam init: true
[]
This behaviour is not really stable. Yesterday I tried the same thing and I did see my lobby. Which makes it even harder to troubleshoot.
I am not sure if this is the best place for this kind of question, but I imagine most of the devs have worked with Steam in some way, so maybe I am not the first to face this problem.