Announcement

Collapse
No announcement yet.

Dedicated server with Steam is a joke

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by HeySebi View Post
    Hi. Are these problems still present in the 4.18 version? Would be grateful for an info. Thanks.
    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
    - Copy OnlineSubsystemSteam to your own Plugins directory and modify it in several places to be recognized as a new OnlineSubsystem.
    follow https://wiki.unrealengine.com/Override_Built_In_Plugin
    - 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.
    Last edited by Stardidi; 01-02-2018, 01:09 PM.

    Comment


      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.


      Click image for larger version

Name:	Steam master server list.png
Views:	3
Size:	23.6 KB
ID:	1418208

      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 here that I need the FindSessions to look for servers and not lobbies? Do I need to overload a function somewhere?




      Attached Files

      Comment


        Originally posted by Tailssan View Post
        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.


        Click image for larger version

Name:	Steam master server list.png
Views:	3
Size:	23.6 KB
ID:	1418208

        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 here that I need the FindSessions to look for servers and not lobbies? Do I need to overload a function somewhere?



        You're doing better than me then. Using AdvSess I still can't see it showing up in the steam browser. Mind posting your steps?

        Comment


          Originally posted by Neur0t1c View Post

          You're doing better than me then. Using AdvSess I still can't see it showing up in the steam browser. Mind posting your steps?
          Same here. 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 (https://www.depicus.com/wake-on-lan/wake-on-lan-monitor) 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.

          Stuck.

          Comment


            Originally posted by jfharper View Post

            Same here. 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 (https://www.depicus.com/wake-on-lan/wake-on-lan-monitor) 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.

            Stuck.
            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.
            Last edited by Neur0t1c; 02-10-2018, 06:33 AM.

            Comment


              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 here 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.
              Last edited by Sebatnik; 02-16-2018, 04:10 AM.

              Comment


                Originally posted by Tailssan View Post
                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,.

                Waiting with bated breath

                Comment


                  Should be done with it today. I'm so lazy

                  Comment


                    Originally posted by eXi View Post
                    To use Steam, you "only" need to setup Steam for your Project:

                    http://allarsblog.com/2016/02/26/BasicSteamIntegration/

                    You will use AppID 480, which is Spacewars or so. That's the TestID you are allowed to use.
                    Once you have your game GreenLit, you can change it to yours and modify achievements etc.

                    With AppID 480 you can, first of all, host ONLINE as a ListenServer. This is totally possible in the ShooterGame too.
                    UE4 uses a SubsystemInterface. Means you will call "CreateSession" etc, for all different Subsystems at the same point
                    and UE4 uses the implementation of the Active Subsystem. In your case, that's Steam.

                    So ShooterGame works with Steam (Follow Allars Blog and you will see that you can't use Steam if you try to play in Editor!)

                    This thread here is simply about the Dedicated Server thing.

                    You need to download the Source of the Engine (so not the Launcher one) to get the Option to Build a Dedicated Server (in Visual Studio).

                    This Thread here offers a solution for the Steam Authentication, which (iirc) needs Source changes at the moment. Hence the PullRequest.
                    What is Steam Authentication? A way to make sure that the User who started your Game, actually owns the Game. That's all, at least
                    that's what I mostly saw in the PR by going over it.

                    So this isn't really the place for you to start looking to implement Steam :P this is already the point where you got it working and need
                    to release the game, but you are lacking the Auth for Steam, so everyone could pirate it and play it.
                    Is this actually a open issue? Can you more clarify the issue so that future users won't be lost.

                    Comment


                      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

                      https://www.youtube.com/watch?v=iMNjp5L7_oA

                      I'll help where I can if someone is struggling.
                      Last edited by Sebatnik; 02-28-2018, 12:36 AM.

                      Comment


                        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). M
                        y 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 Tailssan 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.

                        Comment


                          Originally posted by krisgoku2 View Post
                          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). M
                          y 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 Tailssan 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
                          Last edited by krisgoku2; 03-03-2018, 10:59 AM.

                          Comment


                            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

                            Comment


                              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.

                              Comment


                                Originally posted by Tailssan View Post
                                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

                                https://www.youtube.com/watch?v=iMNjp5L7_oA

                                I'll help where I can if someone is struggling.
                                HI

                                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?

                                I'm grateful for every tip.

                                Comment

                                Working...
                                X