Announcement

Collapse
No announcement yet.

How to create Rocket build that can deploy Dedicated Server of game?

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

  • How to create Rocket build that can deploy Dedicated Server of game?

    I recently compiled my own version of UE4 from GitHub (promoted branch) and created Rocket Build out of it, which is perfectly working and I am able to cook/package my game. However when it comes to creating Dedicated Server, build keeps failing.

    Here is the message:

    Any idea how can I make my custom build to support building Dedicated Server for game.
    Attached Files
    Unreal Nexus - Create Share and Experience!
    Unreal Engine 4 World-Wide User Map

    [PLUGIN] Aws Gamelift Client Plugin
    [TOOL] Create your own binary release of UE4 from GitHub source
    [Marketplace] Vehicle Soccer Template
    [Marketplace] Objective Waypoint System
    My UE4 Tutorials and Misc Tools

    Lead Programmer at YetiTech Studios
    Your Friendly Neighborhood
    Satheesh PV (a.k.a RyanJon2040) | Twitter, Instagram, Facebook, LinkedIn, YouTube, Google+

  • #2
    Originally posted by ryanjon2040 View Post
    I recently compiled my own version of UE4 from GitHub (promoted branch) and created Rocket Build out of it, which is perfectly working and I am able to cook/package my game. However when it comes to creating Dedicated Server, build keeps failing.

    Here is the message:

    Any idea how can I make my custom build to support building Dedicated Server for game.
    Rocket builds purposefully strip out server binaries, so it isn't possible afaik. Rocket builds are being phased out, anyway.

    I talk about how to use the new BuildGraph system in this thread. There's likely a way to add the server binaries/target to the BuildConfiguration.xml that it uses, but haven't figured that part out yet!

    Comment


    • #3
      Anyone had any luck building a dedicated server after using BuildGraph to package the engine?

      I've tried adding a new node for Compile UE4Server Win64 (copy/paste with rename of the "Compile UE4Game Win64" node), but I get a lot of errors from BuildGraph and then run into the same problem of not finidng the .generated files when trying to build the server.

      Comment


      • #4
        I'm curious about this as well! I tried similar, but there's something we're missing

        Comment


        • #5
          I just got a response about this on UDN. Trying this now - hopefully it works!

          https://udn.unrealengine.com/questio...uildgraph.html

          Comment


          • #6
            Originally posted by Craig Downs View Post
            I just got a response about this on UDN. Trying this now - hopefully it works!

            https://udn.unrealengine.com/questio...uildgraph.html
            That site isn't accessible, could you copy paste the response here?

            Comment


            • #7
              Your error there is from duplicating the #UE4Game Win64 Includes tag if you've copied the whole node and only changed some of the Game references to Server. Each tag name can only be produced by one node.


              If you do create a whole new node for server then that won't automatically be included in the installed build, there is a list later on of its requirements and it will then use tagged build products to include them in the build. Instead of modifying that, it might be easiest to duplicate just the compile lines that build UE4Game, so you'd end up with something like:


              <Compile Target="UE4Game" Platform="Win64" Configuration="Development" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>
              <Compile Target="UE4Game" Platform="Win64" Configuration="Shipping" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>
              <Compile Target="UE4Server" Platform="Win64" Configuration="Development" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>
              <Compile Target="UE4Server" Platform="Win64" Configuration="Shipping" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>

              Depending on what configurations you need (you could add client as well etc.)


              This may also need a code change to support configurations other than game properly, in InstalledBuild.cs (~ln99) we search for target receipts for different configurations but always using UE4Game as the target name. You'd need to change that so that it loops through UE4Game, UE4Server and UE4Client so that it picks them up and lets you use them in the installed build. I'll add a task about adding support for this by default.

              Comment


              • #8
                Originally posted by Craig Downs View Post
                Your error there is from duplicating the #UE4Game Win64 Includes tag if you've copied the whole node and only changed some of the Game references to Server. Each tag name can only be produced by one node.


                If you do create a whole new node for server then that won't automatically be included in the installed build, there is a list later on of its requirements and it will then use tagged build products to include them in the build. Instead of modifying that, it might be easiest to duplicate just the compile lines that build UE4Game, so you'd end up with something like:


                <Compile Target="UE4Game" Platform="Win64" Configuration="Development" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>
                <Compile Target="UE4Game" Platform="Win64" Configuration="Shipping" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>
                <Compile Target="UE4Server" Platform="Win64" Configuration="Development" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>
                <Compile Target="UE4Server" Platform="Win64" Configuration="Shipping" Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>

                Depending on what configurations you need (you could add client as well etc.)


                This may also need a code change to support configurations other than game properly, in InstalledBuild.cs (~ln99) we search for target receipts for different configurations but always using UE4Game as the target name. You'd need to change that so that it loops through UE4Game, UE4Server and UE4Client so that it picks them up and lets you use them in the installed build. I'll add a task about adding support for this by default.
                Thanks for this, Craig! Will be looking into it at some point, but trying to not to get distracted from game code by all of these build system shinies Let me know if it works out, otherwise I'll have a crack at it.

                Comment


                • #9
                  Well it looks like I've got a BuildGraph engine that can generate dedicated servers now!

                  I was getting some include errors after making the changes I posted above, and was told to add the last line posted below to add the UE4Server folders to the includes.

                  <!-- Tag the generated includes for this target -->
                  <Tag Files="Engine/Intermediate/Build/Win64/UE4/Inc/...;Engine/Plugins/.../Intermediate/Build/Win64/UE4/Inc/..." With="#UE4Game Win64 Includes"/>
                  <Tag Files="Engine/Intermediate/Build/Win64/UE4Server/Inc/...;Engine/Plugins/.../Intermediate/Build/Win64/UE4Server/Inc/..." With="#UE4Game Win64 Includes"/>

                  Comment


                  • #10
                    Big thanks to [MENTION=421696]Craig Downs[/MENTION]! Thanks a lot Craig. With your help I can make custom rocket builds that can deploy dedicated server game.

                    For anyone else, I am uploading the InstalledEngineBuild.xml (4.15) that makes this possible. Copy this to \Engine\Build\ folder (make a backup first).
                    Attached Files
                    Unreal Nexus - Create Share and Experience!
                    Unreal Engine 4 World-Wide User Map

                    [PLUGIN] Aws Gamelift Client Plugin
                    [TOOL] Create your own binary release of UE4 from GitHub source
                    [Marketplace] Vehicle Soccer Template
                    [Marketplace] Objective Waypoint System
                    My UE4 Tutorials and Misc Tools

                    Lead Programmer at YetiTech Studios
                    Your Friendly Neighborhood
                    Satheesh PV (a.k.a RyanJon2040) | Twitter, Instagram, Facebook, LinkedIn, YouTube, Google+

                    Comment


                    • #11
                      Originally posted by ryanjon2040 View Post
                      Big thanks to [MENTION=421696]Craig Downs[/MENTION]! Thanks a lot Craig. With your help I can make custom rocket builds that can deploy dedicated server game.

                      For anyone else, I am uploading the InstalledEngineBuild.xml (4.15) that makes this possible. Copy this to \Engine\Build\ folder (make a backup first).
                      Hey Ryan I know in your post you say 4.15 however I'm trying this with a 4.14 build and its not actually letting me build (in editor) for dedicated server as it hasn't included the -server target. Did you end up making any changes to InstalledBuild.cs?

                      Comment


                      • #12
                        Originally posted by Kanibel View Post
                        Hey Ryan I know in your post you say 4.15 however I'm trying this with a 4.14 build and its not actually letting me build (in editor) for dedicated server as it hasn't included the -server target. Did you end up making any changes to InstalledBuild.cs?
                        It should also work with 4.14. How are you building your game dedicated server? Are you using Project Launcher in editor to create dedicated server?

                        You can use this app to create rocket build (with your modified InstalledEngineBuild.xml). After its done open your project in your new rocket build and from Windows -> Project Launcher you can create a new custom profile for your project. Then under cooking make sure you have WindowsServer and WindowsClient (Optional).



                        Here are the settings I use for my project.


                        If you still have problems, could you please send me the original InstalledEngineBuild.xml from 4.14. I'll modify it and send it back to you.
                        Attached Files
                        Unreal Nexus - Create Share and Experience!
                        Unreal Engine 4 World-Wide User Map

                        [PLUGIN] Aws Gamelift Client Plugin
                        [TOOL] Create your own binary release of UE4 from GitHub source
                        [Marketplace] Vehicle Soccer Template
                        [Marketplace] Objective Waypoint System
                        My UE4 Tutorials and Misc Tools

                        Lead Programmer at YetiTech Studios
                        Your Friendly Neighborhood
                        Satheesh PV (a.k.a RyanJon2040) | Twitter, Instagram, Facebook, LinkedIn, YouTube, Google+

                        Comment


                        • #13
                          It should also work with 4.14. How are you building your game dedicated server? Are you using Project Launcher in editor to create dedicated server?

                          You can use this app to create rocket build (with your modified InstalledEngineBuild.xml). After its done open your project in your new rocket build and from Windows -> Project Launcher you can create a new custom profile for your project. Then under cooking make sure you have WindowsServer and WindowsClient (Optional).
                          Ahh I see I was trying to use the default options found here:
                          Click image for larger version

Name:	WindowsServer.PNG
Views:	1
Size:	13.0 KB
ID:	1120861

                          Which is when it gives me this error:
                          Click image for larger version

Name:	ErrorServer.PNG
Views:	1
Size:	5.0 KB
ID:	1120862

                          Unfortunately I tried your method above but still get the same issue.

                          Here's my InstalledEngineBuild.xml. I've made a few adjustments but nothing that should affect this.
                          InstalledEngineBuild.zip

                          Comment


                          • #14
                            Originally posted by Kanibel View Post
                            Ahh I see I was trying to use the default options found here:


                            Which is when it gives me this error:


                            Unfortunately I tried your method above but still get the same issue.
                            Looks like you are missing server target for your project. Did you create YourProjectNameServer.Target.cs build file? In YourProjectFolder/Source folder you will have YourProjectName.Target.cs file. In addition to this, you will need YourProjectNameServer.Target.cs file. You can use the below code but make sure to change YourProjectName to your actual project name:

                            PHP Code:

                            using UnrealBuildTool
                            ;
                            using System.Collections.Generic;


                            public class 
                            YourProjectNameServerTarget TargetRules
                            {
                                public 
                            YourProjectNameServerTarget(TargetInfo Target)
                                {
                                    
                            Type TargetType.Server;
                                    
                            bUsesSlate false;
                                    
                            UEBuildConfiguration.bUseLoggingInShipping true// If you want logging in shipping build
                                
                            }


                                
                            //
                                // TargetRules interface.
                                //


                                
                            public override void SetupBinaries(
                                    
                            TargetInfo Target,
                                    
                            ref List<UEBuildBinaryConfigurationOutBuildBinaryConfigurations,
                                    
                            ref List<stringOutExtraModuleNames
                                    
                            )
                                {
                                    
                            OutExtraModuleNames.AddRange( new string[] { "YourProjectName" } );
                                }
                                    
                                
                            // Obsolete from 4.15+
                                
                            public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatformOutPlatforms)
                                {
                                    
                            // It is valid for only server platforms
                                    
                            return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatformsfalse);
                                }

                            See this documentation for more information: https://docs.unrealengine.com/latest...m/TargetFiles/
                            Last edited by ryanjon2040; 01-04-2017, 01:56 AM. Reason: Documentation link added
                            Unreal Nexus - Create Share and Experience!
                            Unreal Engine 4 World-Wide User Map

                            [PLUGIN] Aws Gamelift Client Plugin
                            [TOOL] Create your own binary release of UE4 from GitHub source
                            [Marketplace] Vehicle Soccer Template
                            [Marketplace] Objective Waypoint System
                            My UE4 Tutorials and Misc Tools

                            Lead Programmer at YetiTech Studios
                            Your Friendly Neighborhood
                            Satheesh PV (a.k.a RyanJon2040) | Twitter, Instagram, Facebook, LinkedIn, YouTube, Google+

                            Comment


                            • #15
                              Looks like you are missing server target for your project. Did you create YourProjectNameServer.Target.cs build file? In YourProjectFolder/Source folder you will have YourProjectName.Target.cs file. In addition to this, you will need YourProjectNameServer.Target.cs file. You can use the below code but make sure to change YourProjectName to your actual project name:
                              Oh my god, of course! Feel like a complete idiot, thank you!

                              Comment

                              Working...
                              X