Download

Steam Dedicated Server created with wrong steam app id, Not joinable

I’m in need of help with getting my dedicated server searchable on Steam. I’ve went through all the steps and advice I could find on setting up a dedicated server (been at it for over a week). It works when the Steam client is off, but otherwise, I cannot join/find the server (whether through FindSessions, or direct IP join).

I populated the Application->Dedicated Server tab in the base game, and I created a dedicated server tool under my base game in Steamworks, but I do not see it the master Servers list when launched. If I populate the Application->Dedicated Server tab of the dedicated server tool itself, I WILL see it in the list, but it is still not joinable/findable by the base game (when running on another machine/steam account). Furthermore, If I check the server with https://api.steampowered.com/ISteamA…*&format=json, I see it listed, but the “appid” listed is the app id of the tool, and not the base game, which is incorrect, no?

If I create a listen server from the base game launched on steam, it works as expected, and is searchable by other players. Its just the dedicated server tool that seems not to work.

Not only can I not search for the dedicated server, but I also cannot join it by direct IP either.

Note: The steam_appid.txt I add to beside the dedicated server executable holds the ID of the base game. Any and all helps/hint would be greatly appreciated!

So with the help of Psychonic in the Steamworks development Discussion group, I learned that my problem could be solved with a hack of setting the environment variables for SteamAppId and SteamGameId to the base game before initializing the Steam API (on the dedicated server). I did this by putting the following code snippet at the top of void FOnlineSubsystemSteamModule::LoadSteamModules() in OnlineSubsystemModuleSteam.cpp, ~line 118.


FPlatformMisc::SetEnvironmentVar(TEXT("SteamAppId"), TEXT("base_game_app_id"));
FPlatformMisc::SetEnvironmentVar(TEXT("SteamGameId"), TEXT("base_game_app_id"));

This allowed me to launch the dedicated server tool such that it would “spoof” (so to speak) the base game, allowing for connections to it. He mentioned that this is a technique used on some of Valve’s own games. So its nasty, but it works.

is “SteamAppid” what i have to write or is it the actual id?

sorry, “base_game_app_id” is the actual id, “SteamAppId” is the key to the env var, so it would look like:



FPlatformMisc::SetEnvironmentVar(TEXT("SteamAppId"), TEXT(##your_game's_actual_base_game_app_id##));
FPlatformMisc::SetEnvironmentVar(TEXT("SteamGameId"), TEXT(##your_game's_actual_base_game_app_id##));