Can't run built server - Possible "bug"

Hello.

I found interesting moment.

My project has some of my C++ code.

If I compile game executable file (MyGame.exe), it’s will be in e:\MyGame\Binaries\Win64\ and if I will start this file (e:\MyGame\Binaries\Win64\MyGame.exe), it’s started well and everything in it working fine.

But if I compile exe file of the game server (MyGameServer.exe), it’s will get an error message

Assertion failed: GDefaultMaterials[Domain] != NULL [File:e:\UnrealEngine\Engine\Source\Runtime\Engine\Private\Materials\Material.cpp] [Line: 359] 
Cannot load default material 'engine-ini:/Script/Engine.Engine.DefaultMaterialName'


KERNELBASE.dll
MyGameServer.exe!FOutputDeviceWindowsError::Serialize() [e:\unrealengine\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:103]
MyGameServer.exe!FOutputDevice::Logf__VA() [e:\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:94]
MyGameServer.exe!FDebug::AssertFailed() [e:\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:421]
MyGameServer.exe!UMaterialInterface::InitDefaultMaterials() [e:\unrealengine\engine\source\runtime\engine\private\materials\material.cpp:361]
MyGameServer.exe!FEngineLoop::PreInit() [e:\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:1553]
MyGameServer.exe!GuardedMain() [e:\unrealengine\engine\source\runtime\launch\private\launch.cpp:117]
MyGameServer.exe!GuardedMainWrapper() [e:\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
MyGameServer.exe!WinMain() [e:\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
MyGameServer.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
KERNEL32.DLL
ntdll.dll
ntdll.dll

if it will be started from e:\MyGame\Binaries\Win64\MyGameServer.exe location.

But if I copy file MyGameServer.exe to the sub directory of the packaged game (e:\Package3\WindowsNoEditor) - e:\Package3\WindowsNoEditor\MyGame\Binaries\Win64\ and if I start it from e:\Package3\WindowsNoEditor\MyGame\Binaries\Win64\MyGameServer.exe, it’s works well, without any error messages.

Is it possible fix this issue to make possible to start MyGameServer.exe from e:\MyGame\Binaries\Win64\ directory?

Thank you!

:heart:

Hey ,

As stated here:

https://wiki.unrealengine.com/Standalone_Dedicated_Server#Windows

If you use the Unreal Frontend to cook your project, you need to move the: GameServer.exe to the cooked/platform/game/binaries/platform folder before running it.

Alternatively, if you package your game via the editor you would move it to: WindowsNoEditor/GameName/Binaries/Platform.

Thank you for submitting a bug report, however at this time we believe that the issue you are describing is not actually a bug with the Unreal Engine, and so we are not able to take any further action on this. If you still believe this may be a bug, please provide steps for us to reproduce the issue, and we will continue our investigation.

I’m experiencing this issue in 4.17.
The dedicated server crashes on startup when trying to load the default material.
i’ve tried packaging to a .pak file aswell as to a loose content files. also tried removing the WorldGridMaterial from my game, including the editor content and rerouting the DefaultMaterial path from the BaseEngine.ini file to something that is included in the packaged content for sure.
Nothing helped. I’m stuck here. Any help is appreciated.

any luck on this? same exact issue

This helped me so much! Thank you. I just couldn’t figure this out, searching the forums for a day.

Why is the Server exe file not exported to the packaging directory in the first place though?