Download

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:

&stc=1

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!

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.

I’m curious about this as well! I tried similar, but there’s something we’re missing :frowning:

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

https://udn.unrealengine.com/questions/316196/dedicated-server-using-buildgraph.html

That site isn’t accessible, could you copy paste the response here?

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 :smiley: Let me know if it works out, otherwise I’ll have a crack at it.

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"/>

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?

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).

&stc=1

Here are the settings I use for my project.

&stc=1

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. :slight_smile:

Ahh I see I was trying to use the default options found here:
76bf0915a9eb3227c6436c0a4803c09009bcd258.png

Which is when it gives me this error:
bb413d8bb397f4bd42025efa05fbc5d37069d493.png

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 (7.62 KB)

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:



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<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
        ref List<string> OutExtraModuleNames
        )
    {
        OutExtraModuleNames.AddRange( new string] { "YourProjectName" } );
    }
        
    // Obsolete from 4.15+
    public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatform> OutPlatforms)
    {
        // It is valid for only server platforms
        return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatforms, false);
    }
}


See this documentation for more information: https://docs.unrealengine.com/latest/INT/Programming/UnrealBuildSystem/TargetFiles/

Oh my god, of course! Feel like a complete idiot, thank you!

Hi there @ryanjon2040
this seems to be broken in 4.19 saying EnableSymStore is unknown. Exit Error 1., Any idea how to fix this? perhaps the keyword is deprecated?

Using older version of InstalledBuilds.xml however gives me different error
ERROR: C:\Users\User\Documents\GitHub\AmmoboxUnrealEngine\Engine\Build\InstalledEngineBuild.xml(104): The ‘FromDir’ attribute is not declared.

Hi @Frozenfire I’ve already fixed it for 4.19+ versions :). You can check out the commit from here: Support for 4.19+ Engine build. · ryanjon2040/UE4-Binary-Builder@1255deb · GitHub

Hi @Frozenfire That keyword has been deprecated. You have to use -set:EmbedSrcSrvInfo=true or false now.

Creating dedicated server supported rocket no longer seems possible with these changes in this thread. I’ve tried to build, but server/client targets are no longer included despite the modified InstalledEngineBuild.xml. There is a new xml file called BuildEditorAndTools.xml in \Engine\Build\Graph\Examples folder that supports UE4Server and UE4Client.

Hey folks!

Sorry to necromance this thread, but I really need help getting the Server Target to work for my built binaries.
At first I was building the dedicated server for my game with the Built from Source version of the Unreal Engine (4.20.3), and it works. Now I am trying to get a Local Built I can distribute inhouse, so everyone can built the Server Target, but does not need to built the engine him-/herself.
I followed all the instructions of the previous posts here and my Local Build actually has the “Development Server” Target. But when I try to use it I get the following error:

UnrealBuildTool : error : Couldn’t find target rules file for target ‘UE4Server’ in rules assembly ‘UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’.
2> Location: E:\Projects\UnrealEngineGit\LocalBuilds\Engine\Windows\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
2> Target rules found:
2>
2> (see …/Programs/UnrealBuildTool/Log.txt for full exception trace)

The “Development Game” Target seems to work withouth problems.
I attached my InstalledEngineBuild.xml file, but I didn’t change anything besides the recommended changes for the Server Target. I even looked at the diff of @ryanjon2040s file and mine.
This is the command I am using to start the UAT Build:

./RunUAT.bat BuildGraph -target=“Make Installed Build Win64” -script=“Engine/Build/InstalledEngineBuild.xml” -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLinux=false -set:WithHTML5=false -set:WithLumin=false -set:WithDDC=false -set:WithWin32=false

Anyone here had the same problem? Do I have to do something since UE 4.20.3 that I didn’t hear of yet?
Looking forward to your help!

Kind Regards,
Stefan

Only after posting I saw the comments here on Page 2 and tried the BuildEditorAndTools.xml file for building with BuildGraph. This has different problems as I described in my AnswersHub Question over here. https://answers.unrealengine.com/questions/850279/view.html
I hope someone can help me. :frowning: