Custom config doesn't appear in packaged game

I created custom config by below C++ code

UCLASS(Config = Game) class MYCONFIG_API UMySettings : public UObject { GENERATED_BODY()
UPROPERTY(config, EditAnywhere, Category = "Basic", meta = (DisplayName = "Test")
	bool TestBool;

}

I can see the properties appear in [ProjectFolder]\Saved\Config\Windows\Game.ini and edit them via UE editor (I implemented an editor module for it). But in packaged game, there is a Game.ini after I ran the .exe file but it’s always empty, the game also always runs on default config I assigned in the C++ constructor.

I tried using defaultconfig and GlobalConfig but nothing changed. Did I miss something?

Hi Howard,

Your setup is correct. The packaged game saved ini files actually only contain values which are different from the default. If TestBool changes at runtime during the game, you should then see it written to your Game.ini file.

/TD

Hi, thanks for the info. Now my question became: how do I carry my custom config that had been modified in Project Settings to packaged game?

I can alter the config by GetMutableDefault() during runtime, that solved my problem in a different way. But I’m still wondering how to carry the custom config from Project Setting to a packaged game.

Hey, so based on the setup you mentioned above, you would need to open your Game/Config/DefaultGame.ini and add the following:

[/Script/MyConfig.MySettings]
TestBool=True

When you have made these changes, you will need to repackage your game. These settings will be applied to the default object on load.

/TD