I can confirm that creating and connecting to dedicated servers with Steam works in 4.18.1. Took me about a day to get working (Note: this was only tested with Development builds)
However, the steps I took to get this to work are non-trivial. A quick summary:
First get your normal Steam integration with lobbies working
Replace any usage of STEAM_SUBSYSTEM with your own macro FName
Assign this plugin as your DefaultPlatformService in DefaultEngine.ini
Set both STEAMPRODUCTNAME and STEAMGAMEDIR to what you set in Steamworks for your project, or “Spacewar” for testing.
There is an issue with GameTags overflowing, so change OnlineSessionAsyncServerSteam.cpp:133 in your plugin to KeyValuePairs.Add(STEAMKEY_OWNINGUSERNAME, “Bob”);// Session->OwningUserName);
Override the GameSession::RegisterServer() as described in the first page of this thread (make sure to set bUsesPresence=false).
Forward port 27015 to your machine.
At this point it should show up in the Steam Server Browser.
To then have clients find the sessions:
Copy and rename FindSessionsCallbackProxy to make your own version in your project
The above also requires your own copy of the FOnlineSubsystemBPCallHelper due to header scoping
In ::Activate() change the presence setting to SearchObject->QuerySettings.Set(SEARCH_PRESENCE, false, EOnlineComparisonOp::Equals);
This will give you a new FindSessions blueprint which searches for Servers instead of lobbies.
Finally, when creating a packaged build, make sure to include a steam_appid.txt next to your .exe in /Binaries/Win64/
Some notes:
it is likely possible to create a minimalistic plugin that doesn’t re-implement everything, but only the required pieces. I have not tried yet.
This is hardcoding the server name (one of the two, the one that doesn’t show in the server browser, but those in the BlueprintSessionResult)
This solution is… hacky at best. However, it does not require any engine modifications.
I’m going to join in this discussion and hopefully resolve my own problem.
I’m on UE4 4.18.3.
I’m using Advanced Sessions 4.18, and I’ve gotten far enough to actually get my server to show up in the Steam Browser. I don’t have my own AppID yet, so I’m using 480 like others.
I’ve been following as many discussions and reading as much as I can from all the dedicated server posts. I didn’t have to do anything near as complicated as Stardidi did. I’ve resolved all my dedicated server issues and it shows up as below. I have no idea where the numbers are coming from for the name, but I do see that “Unreal Test!” is set in OnlineSessionAsyncServerSteam.cpp at the top for STEAMGAMEDESC. I’m also not sure why it says 0/0. Despite these things, I can’t think of any reason why I can’t see the session when doing FindSession. I have no problem finding and connecting to my non-dedicated server that I also create using AdvancedSessions.
Does anyone know what this “bEnabled=false” actually means in the DefaultEngine.ini? Does it need to be set to true or false for a dedicated server?
[OnlineSubsystemSteam]
bEnabled=false
I see some people have it set to true, and some people set it to false. I’m slowly running out of areas to look into because I don’t have any errors left; the problem is I just can’t see it when using FindSession from the AdvancedSessions plugin. I’m missing what I think is a very tiny configuration somewhere. I’m using AdvancedSessions to create the server, and I’m using FindSessions to try and find it, but it’s not showing up for me. I’ve read throughout that I need the FindSessions to look for servers and not lobbies? Do I need to overload a function somewhere?
Same . I can get a dedicated server working without steam, but when I have the steam api loaded on both client and remote server, the client won’t connect to the server and the steam server browser reports: “Server Not Responding” when trying to search for game at server’s public ip.
Looking at the logs for both client and server, there are no errors. SteamNewDriver reports listening on port 7777. Port sniffer (Welcome To Depicus - Home of the Geek) verifies packets received on server from steam server browser on port 7777, also on port 27015 when server is not loaded…when loaded server ties up that port so I can’t run the snif. So packets are getting through, don’t know what to add to get the server to report a game on steam.
Yep exactly my issue. Everything works until I include Steam. I’m questioning whether or not to write my own master server. I’m tired of dealing with the nonsense that is the steam integration for UE4. Setting up dedicated servers and using Steam with it SHOULD NOT be this difficult for an engine that’s been around for a while now and has reached 4.18.
Edit:
I’d be willing to bet that if you integrated that pull request mentioned earlier - it’d work.
I have finally done it - and most important of all - I HAVE REPRODUCED IT!
I deleted my successful version and redid it all!
I was just now able to completely delete my successful project, and go through all the steps again and get it working successfully. So many things I’ve learned.
If you all can just hang on a couple days or so, I’ll have a complete video on YouTube and post again with the link.
What I’ve done: Built a dedicated server in UE4 4.18.3 using the UE4 Source from Github using AdvancedSessions. It launches, it connects to steam. It shows up in the master server list + the LAN tab.
I can search for it and find it in my game on another computer. The only thing I cant do yet is see it on the computer that’s hosting it - This seems to be some sort of Steam authentication issue because a Steam account can’t log into 2 things at once. The other issue I’m now working on is that although I can connect, the dedicated server seems to lose connectivity randomly after a couple of minutes from Steam.
Edit: Just did some more testing and even got it to work on the other computer going the other direction.
Ok guys, I FINALLY finished my video. Sorry it took so long. I hope it helps even just one person.
I’m sure there’s better videos out there, but this is my effort on the subject.
Please find the jump points I made for you guys in the video’s description to make your life easier
I’ve ran into this problem a day or two ago, and it’s cost me two day to find a solution to the problem(due to not having second computer at the moment, and a 0 instead of 1 error somewhere). My testing took a while because me screen wound up smoking and my testing method was shot.I’m not using the Advanced Session Plugin and avoiding blueprints as much as I can for Performance. M. I already had everything set up on steam back-end before had posting anything. Ultimately, Yes more things may be provided by epic but they decided not to and as I see it I seem to understand why(my personal findings). Besides that theirs a extremely easy work-around or not relatively easy if you don’t understand code. I encountered this forum because at first I had an 1 inside of zero type of error which ultimately led to this. But I can positively give this to people who seem to have errors or what not. It works perfectly find, their some work around need if your not a coder maybe be a dead end.
And it’s not steams fault but ue4 for not providing sufficient documentation. I can’t claim to be the world greatest NBA player if I skipped the finals and etc… Can’t claim to be the world class engine if the documentation is poor.
I may have to totally recall this Statement… Ue4 Documentation I still don’t like. But the system works perfectly fine(I Think). At first I had a number error 0 instead of a 1. Now it seems I forgot to add One line of code somewhere which caused my server not to be found(feel kind of silly). Although, the confusion was caused by going through this forum and thinking wow it doesn’t even work??? This must only apply to their blueprint system or something crazy like that. Anyway I think it works fine, I’m happy with the fast work around I did regardless… But I’ll have a definitely answer when I test in a few days(other things on the list right now). I can’t believe I didn’t see that lol… but again this forum threw me off.
My work around is working great.will give a full update later(When I feel like using that portion) for anyone having problems or made a error then go to this forums and think it’s the system
Sooo, I had all of that correct, however, I couldn’t get my server to appear and the session to be joinable unless I failed to destroy and create a new session, not a typo, the only way I could get it to work is to have an on startup destroy session, which fails, and a create advanced session which fails because the default session is still there… but it works… I can connect to it and get into my game… um… I really don’t know how to fix it so I don’t need the destroy/create fake stuff… makes no sense to me
As an update, i did manage to override the default session by putting an advanced session startup in the event init of game instance and that seems to have fixed everything, it’s not complaining about multiple sessions starting up anymore and I can connect to it.
the video was very helpful. the dedicated server is now visible in the internet tab.
The whole thing works for me only with the steam app id 480.
if I use my own steam APP ID, the server will only be displayed under LAN.
Has anyone else the problem? Do I have to unlock my APP ID for dedicated server?
Thank you very much for the video. I followed it step by step (using a blank project on UE 4.18.3 source), but in the end the dedicated server won’t show up in the Steam internet tab. It’s in the LAN tab and if I don’t use steam I can also join the dedicated server. The steam overlay etc is also showing for the client itself. I have double-checked everything, played around with the ports in all kinds of ways and they seem to work. I also tried it on a second computer without success and to have a client on PC1 join the server on PC2, but I’m not even sure if that works at all with IPs (it was unsuccessful). Really don’t know what else to try, any ideas?
Any advice on how to get a server description in my server browser. I’ve really been working this problem, but I can’t seem to get a value key/data pair written that I can read from the client!
Same exact problem . Shows up in LAN but not on Internet…bizarre. Could that be caused by the steam gametags overflow warnings? I don’t think that would stop it from being registered on Steam’s master server.
EDIT - It was my router. It said the ports were forwarded but that was determined to be a lie. Got a new router and forwarded them, bam, shows up in Internet tab and can be joined at least by other players on the network. Gonna try external next.
Does anyone know if it’s possible to use presence (Steam Lobbies) with a dedicated server? Our intent is to have a small number of servers spin up by creating sessions and have players connect to those sessions via FindSessions() in order to get matchmaking without having players create sessions manually. We have the non-presence mode working fine, but would like to leverage Steam Lobbies too.
In case anyone runs into this, I couldn’t get the server to show up in the steam client View -> Servers list until I changed STEAMGAMEDIR and STEAMPRODUCTNAME to be equal to the same string as set in [see steamworks docs].
Has anyone run into that? I tried disabling shootergame’s new packet handler for steam auth as well and get the same issue with or without. The logged IP Address seems to be my connecting client’s internal NATed IP address, not its public facing one, which seems strange.