Dedicated Server Default Map Not Working

For some reason my dedicated server is starting up with the Entry map instead of the map that I have defined.

I am packaing with RunUAT via

"D:\UnrealEngine4.11\Engine\Build\BatchFiles\RunUAT" BuildCookRun -project="%WORKSPACE%\FPSGame\FPSGame.uproject" -noP4 -platform=Linux -serverplatform=Linux -server -serverconfig=DebugGame -cook -allmaps -build -stage -targetplatform=Linux -archive -archivedirectory="D:\UE4Builds\Omniwar"

I removed the -pak flag because I wanted to verify that my maps were actually being packaged.

I have set the ServerDefaultMap in DefaultEngine.ini

[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/Maps/MainMenu.MainMenu
EditorStartupMap=/Game/Maps/Foo
GameInstanceClass=/Script/FPSGame.FPSGameInstance
GlobalDefaultGameMode=/Script/FPSGame.FPSGameModeTDM
ServerDefaultMap=/Game/Maps/Foo

I have also set AllMaps in DefaultEditor.ini since I am building with the -allmaps flag

[AllMaps]
+Map=/Game/Maps/MainMenu
+Map=/Game/Maps/Foo

I have verified that my maps are being packaged.

But for some reason my dedicated server is still starting up with the Entry map.

I have looked through the entire server log and there are no errors saying that it can’t find the map. It just acts like it is supposed to start with Entry and it loads that.

It’s like it is ignoring my ServerDefaultMap settings.

I am running my server with no flags via a systemd

./FPSGameServer-Linux-DebugGame
1 Like

Hey erebel55-

In the Project Settings->Maps&Modes window, do you have your server default map set in the “Game Default Map” drop down? If not, does setting this option to the correct map affect your package? If this is all setup and you are still not getting the starting map that you intend, can you provide additional steps to help me reproduce this issue locally?

, yes that is essentially what the DefaultEngine.ini settings are.
But here is the view from the editor as well.

I have modified the source to log the default map that it is using within GameInstance::StartGameInstance.

It is spitting out the Entry map. So I am digging into that function to have a look.

I added the following to GetGameDefaultMap() and it is returning /Engine/Maps/Entry too…

I have tried specifying the map via cmd line

./FPSGameServer-Linux-DebugGame /Game/Maps/Foo

./FPSGameServer-Linux-DebugGame DEFAULTMAP=/Game/Maps/Foo

But neither of them help.

Looking through the source code, the only place that I see the default map set is here https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp#L801

And that is surrounded by an if clause that looks at command line arguments. How does this work for anyone using ini settings?

So while I’m cooking the correct map is logged (Foo)

However, when I run the dedicated server it is using Entry

I tested my RunUAT build command against MultiplayerShootout and it works fine. The correct map is loaded in that project. With my project I tried changing the map from Foo to a different one and it still loads Entry. So it’s not my map file. I’m running out of ideas :frowning:

As a test I updated my DefaultEngine.ini to look like the following (based off of MultiplayerShootout)

[/Script/EngineSettings.GameMapsSettings]
EditorStartupMap=/Game/Maps/Foo
TransitionMap=
GameInstanceClass=/Script/FPSGame.FPSGameInstance
GameDefaultMap=/Engine/Maps/Entry
GameDefaultMap=/Game/Maps/Foo
GlobalDefaultServerGameMode=/Script/FPSGame.FPSGameModeTDM
GlobalDefaultGameMode=/Script/FPSGame.FPSGameModeTDM
ServerDefaultMap=/Game/Maps/Foo

I am still getting this when I run my dedicated server…

So it’s not updating my GameDefaultMap or my ServerDefaultMap…

I have verified that the correct ini settings are being cooked

Even deleting the GameMapsSettings section from my DefaultEngine.ini doesn’t change anything. Is there something that has to happen for these changes to take effect?

I was finally able to resolve this nightmare of an issue.

There was a DefaultEngine.ini file under Saved/Temp that I think for some reason was being loaded and prioritized ahead of my real one. At least that is what I’m telling myself.

Regardless I resolved the issue by doing the following

  1. Deleted Saved, Binaries, and Intermediate from my local project
  2. Deleted the contents of my jenkins project from the file system
  3. Deleted the contents of UE4Builds\Omniwar (the archived directory specified in my RunUAT command)
  4. Rebuilt
  5. Deleted my LinuxServer directory from my linux machine
  6. Did a rsync of the LinuxServer back to my linux machine

Now everything works fine.
When I update my ini file the changes that effect.
No more issues.

Thanks!

1 Like