Unreal 4.27.2 Steam SDK 1.51 Can't Find my own session #4.27.2 #Steam #Sessions

Hello. Im using Unreal 4.27.2 and i have created a online game. I been testing it with LAN and no problem, but now that i want to launch it on steam, when i follow all the steps of how to implement the steam online subsystem. I got the overylay and i can create and search for sessions, i find more sessions on the default id 480 but i cant find my own session.

  1. I have activated the online subsystem plugin and online subsystem steam.
  2. I added everything in my defaultEngine.ini
  3. added the line to mygame.build.cs
  4. Have tried adding the files to thirdparty/steamworks/steamv151 with the sdk downloaded from steam and also tried with the one the unreal program give you by default.
  5. I have steam sockets plugin disabled.

I tried with 2 differents PC with 2 differents steam accounts. Both steam are set in the same country.
After nothing worked i had tried with differents version of SDK, differents version of the ini (the version gived by unreal in the steam onlinesubsystem documentation as well of corse)

I already researched all over internet and tried many differents options like making a full rebuild, shipping build, changing the ports, and many more but nothing works.

I also tried deactivated the online subsystem null so i can only create session when im logged to steam to be sure that the session is on steam. But still nothing. I was just about to launch my game and i been triying to solve this for a week now. Please Please HELP.


(this is how i find sessions)

(this is how i create and join sessions this is made in the my custom gameinstance)

Thank you for triying to help me in advice. I changed to false the bInitServerOnClient and then compiled the game on shipping. Now i also get the steam interface and i can search for sessions. But now when i try to host a session i can’t do it. I added the game to the steam library as a non-steam game and when i play i see Spacewar as expected but i cant create a session now because it give me the onFailure exit on the create session node.

Check the game’s logs and see what the issue is. Using the -log command line argument when starting the game’s exe is pretty much necessary when dealing with online stuff. You can make a Shortcut for the exe and add it there, or alternatively, I use a .bat as a launcher that runs my exe with a set of parameters.

@echo off
:: move into the batch script's directory
cd "%~dp0"
:: start the executable
start YourGame.exe -ResX=1280 -ResY=720 -WINDOWED -LOG
1 Like

Thank you again for your answer STRiFE.X

I get this error in the log:

I readed on google something about changing some false-true lines on the OnlineSessionsSettings.h Now is like this:

But still i get the same error on the log and cant create a session.

I tried again with bInitServerOnCliente=true because that way i can at least create session to check the log, this is what i get but i still cant find my session:

Still triying to find a solution to this. I re-created the online system in ue 4.26 and there it works fine i can create and find sessions on Steam without problem. But i cant change my whole project to 4.26 at the engine doesnt let me do it. Help please.

Hello

there is a problem with Steam in 4.27 where you have to set bUseLobbiesIfAvailable to true on the session settings, otherwise you will get the error that you have gotten (failed to initialize game server…). I have seen that you have changed that to true in OnlineSessionSettings.h but you posting C++ code opened in Word doesn’t fill me with confidence that you know what you are doing, just changing the text in the file doesn’t do anything if you don’t recompile the module, I hope you are aware of that. If you are only using Blueprints I don’t think there is a way to fix this (maybe if you’d use the AdvancedSessions plugin).

It is from source or from launcher?

Its from launcher a blueprint project.

How can i recompile the module? i cant use advancedsessions plugin because its not ready yet for 4.27

You would usually build the engine from source, but that would be a bit overkill for such a simple change. I would recommend to just make a custom GameInstance class in C++ to create your session. That would be the easiest solution.

So i have to create a c++ gameinstance inside the editor in the project? After that i have to configure the join sessions and create sessions in a c++ class? Can you please explain me a bit the process? Never did that before. Thank you, you are my last hope.

what is your background? Do you know C++? Do you have an IDE/compiler like Visual Studio installed? I assume your project is already a C++ project because you have the Steam subsystem module included.

I worked before with C Sharp in unity. I have visual studio installed yes and my project is also a c++ project but i dont have nothing writting in c++ yet.

ok, let’s try something else first, especially since we don’t even know for what’s causing your issues in the first place. We will move the Steam subsystem plugin to the project level, that way you can modify the plugin without having to build the whole engine from source and maybe you’ll just have to add one line of C++ code to make it work:

  1. In the directory where you have UE 4.27 installed, go to Engine\Plugins\Online\ and copy the OnlineSubsystemSteam folder to your project folder into Plugins\Online\ as well (you may have to create the plugins folder). So your folder structure should then be like “yourGame”\Plugins\Online\OnlineSubsystemSteam

  2. Regenerate your Visual Studio solution (left-click on the .uproject file of your project and click “Generate Visual Studio project files”).

  3. Open the Visual Studio solution, compile and start the editor. If you have done everything correctly and you open the Plugins dialog in the editor, you should now see the Steam subsystem as project plugin.

  4. Close the editor again and modify OnlineSessionInterfaceSteam.cpp at line 238/239 so it looks like this:

/// Unique identifier of this build for compatibility
Session->SessionSettings.BuildUniqueId = GetBuildUniqueId();
Session->SessionSettings.bUseLobbiesIfAvailable = true; // <---- add this line

Make sure are actually modifying the file in your project’s plugin folder, not the one in the engine plugin folder.

  1. Recompile again, maybe even compile all configurations just to make sure you are not somehow still using old dlls, and then do what you usually do to test Steam. Also make sure you test with the setup that previously gave you the “failed to initialize the game server with Steam” warning since that’s what this is supposed to fix.

Good luck!

4 Likes

Thank you very much for your help! I’m following your steps but i have a few questions.

3 where is the visual studio solution? i dont know where is it to open it.

  1. Where is that file exactly located?

  2. Recompile in shipping build from editor?

Thanks again and sorry about the trouble but i never had this problem before and i never had to do this.

After you click “Generate Visual Studio project files” you should see a file in your project directory with the name of your project and the extension .sln That’s the file you need to open with Visual Studio.

YourProject\Plugins\Online\OnlineSubsystemSteam\Source\Private

Doesn’t really matter how you do it, just make sure you are actually using the updated dlls when you test. The topic is a bit too broad to explain it in a few sentences (google it maybe), but you should be fine if you package the project and then use that to test, in whatever configuration. The engine will usually rebuild the project while packaging.

I followed all the steps.


Now im recompiling the game. i’ll let you know the results. Thank you again.

GRIMTEC, i just can say thank you very much because you just helped me solving my problem. Now i can create session and join without any problem. You are my saviour!! I will add your name to the special thanks credits of the game. It will be on Steam soon and its name is brutal rifters in case u wanna see it. A million times thank you.

Hello again Grimtec. I’m testing to add online in a new project also in 4.27.2. This time im also using VRM4U plugin.

I followed all your steps but this time in this new project the solution didn’t work. Just the same problem as i had in the other project. I can create session but i can find it.

I tought you may know how to solve it too. Thanks again.