INI Files in extended Platforms folders are not all staged.

Recently I decided to move my WindowsEngine.ini and DedicatedServerEngine.ini files into the higher priority /Platforms/<PLATFORM>/Config extended folder. However this resulted in the settings within WindowsEngine.ini having priority over DedicatedServerEngine.ini

I checked my understanding of the Hierarchy that the Engine is following was correct

Lower priority locations are searched first, DedicatedServerEngine has priority over WindowsEngine.

LogConfig: Display: Looking for file: ../../../<PROJECT>/Config/Windows/WindowsEngine.ini

LogConfig: Display: Looking for file: ../../../<PROJECT>/Config/DedicatedServerEngine.ini

Higher locations then searched, DedicatedServer is missing from staged builds and if left in the original spot the Extended WindowsEngine has taken over priority.

LogConfig: Display: Looking for file: ../../../<PROJECT>/Platforms/Windows/Config/WindowsEngine.ini

LogConfig: Display: Found ../../../<PROJECT>/Platforms/Windows/Config/WindowsEngine.ini!

LogConfig: Display: Looking for file: ../../../<PROJECT>/Platforms/DedicatedServer/Config/DedicatedServerEngine.ini

So - it failed to find the higher priority DedicatedServerEngine.ini even though it was looking in the expected spot and it’s present in the project path prior to staging.

I tracked it down to CopyBuildToStagingDirectory.Automation.cs which doesn’t check to see whether we’re staging a DedicatedServer so it never adds the virtual “DedicatedServer” platform to the list of INI files to stage. I call it a virtual platform due to the config file loader doing the check for dedicated server and if so adding it as a special platform which is why it searched the extended directory for it.

I can fix it like this. My question is … is that the correct thing that needs doing ( i.e. an oversight on staging ) or should the original location of DedicatedServer<TYPE>.ini be added later in the hierarchy?

// Initialize platform extensions to stage.

var PlatformExtensionsToStage = new List<string>();

{

string PlatformExtensionName = ConfigHierarchy.GetIniPlatformName(SC.StageTargetPlatform.PlatformType);

PlatformExtensionsToStage.Add(PlatformExtensionName);

// CHANGE BEGIN - DedicatedServer didn’t have the extension path we need to stage

if (SC.DedicatedServer)

{

PlatformExtensionsToStage.Add(“DedicatedServer”);

}

// CHANGE END DedicatedServer now has the extension path we need to stage

DataDrivenPlatformInfo.ConfigDataDrivenPlatformInfo Info = DataDrivenPlatformInfo.GetDataDrivenInfoForPlatform(SC.StageTargetPlatform.PlatformType);

if (Info != null && Info.IniParentChain != null)

{

PlatformExtensionsToStage.AddRange(Info.IniParentChain);

}

}

Steps to Reproduce
First you need different settings for at least one item in both <PROJECT>/Config/Windows/WindowsEngine.ini and <PROJECT>/Config/DedicatedServerEngine.ini

Move WindowsEngine.ini into <PROJECT>/Platforms/Windows/Config/WindowsEngine.ini

Note that now the engine (I used the editor) will accept as the latest settings from WindowsEngine.ini and not DedicatedServerEngine.ini

Move DedicatedServerEngine.ini to <PROJECT>/Platforms/DedicatedServer/Config/DedicatedServerEngine.ini

Note that DedicatedServerEngine.ini is no longer staged.

Hi,

The code you shared appears fine but the Windows platform was not ported to support the Platform extension. There are likely other issues related to moving files in there. I recommend that you leave the ini under Project\Config.

Regards,

Martin