How does the -CustomConfig work?

Hi, I’m trying to use custom configurations depending on platform and storefront in order to make crossplay to work with EOS. I noticed and tried to use the -CustomConfig parameter but with no luck to actually make it work. It includes correctly and package them but they won’t load in a packaged game.

I have followed the instructions from this post:

https://forums.unrealengine.com/t/override-defaultengine-ini-values-when-packaging/1814289

My Config directory layout:

Config/
├── Custom/
│      └── EOS/
│      │      └── DefaultEngine.ini
│      └── Steam/
│      │       └── DefaultEngine.ini
│      └── SteamEOS/
│               └── DefaultEngine.ini
├── DefaultEngine.ini

My Target.cs file

public class MyGameTarget : TargetRules
{
    public MyGameTarget(TargetInfo Target) : base(Target)
    {
      CustomConfig = "EOS";
      Type = TargetType.Game;
      DefaultBuildSettings = BuildSettingsVersion.V5;
      ExtraModuleNames.AddRange( new string[] { "MyGame" } );
      IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
      bWithPushModel = true;
    }
}

My build command line:

RunUAT.bat BuildCookRun -project=<My Project Path> -CustomConfig=EOS -saveconfigoverrides -platform=Win64 -clientconfig=Development -iterate -cook -build -cook -pak -stage -archive -archivedirectory=C:\Builds

My Log file during the build:

Including config file C:\Projects\MyGame\Config\Custom\EOS\DefaultEngine.ini
Excluding config file C:\Projects\MyGame\Config\Custom\Steam\DefaultEngine.ini
Excluding config file C:\Projects\MyGame\Config\Custom\SteamEOS\DefaultEngine.ini

So everything looks nice and dandy but when I fire up the game it hasn’t read/merged/included the custom DefaultEngine.ini :frowning:

Any suggestions why this isn’t working or how I should proceed?

Hello!

The forum post you referenced seems to depend on custom engine modifications. The post references a blog post which itself references a custom GH repo. We can’t comment on how that engine customization should be used.

The default CustomConfig feature involves multiple targets which themselves results in a separate package for each store config. The Lyra sample is a good example of how it works. It defines 3 extra targets: LyraGameEOS, LyraGameSteam and LyraGameSteamEOS. When launching BuildCookRun, the target can be selected by adding -target=LyraGameXXX.

I see that you are using the iterative cooking mode (-iterate). This mode should only be used for local iteration and never on build machines for official builds. The mode has issues with the detection of dependencies with can result in content not being cooked when it was changed. Version 5.6 now offers the Incremental cook feature which is better at tracking the different dependencies that affect the cooked content. The feature is Experimental in 5.6 and some bugs where addressed in version 5.7 which sees the feature tagged as Beta.

Regards

Martin

-CustomConfig maps on TargetRules.CustomConfig when running UBT. It is used as the default value for the field. That “default” value will get overwritten if the project’s target rules class is setting the field. It would be easy to set a target rules to support both cases, the actual default for that member is an empty string the code could check if the value is already set and use that instead of setting it.

You would use that argument as part of the -ubtargs when the extra targets are not created.. The extra targets are making it more explicit and easier for team members to generate local packages as they are available in the Platform menu at the editor level.

[mention removed]​ Thanks for the reply.

Since the Lyra more or less just sets the CustomConfig in the Target.cs.

Could it be an option to alter it by sending in a -ubtarg?

Do I need the parameter -CustomConfig=X when building or I’m I fine by just setting it within the Target.cs?

[mention removed]​ thanks for clearing everything up for me :slight_smile: