Crash when GameUserSettingsClassName points to a Blueprint

When GameUserSettingsClassName points to a Blueprint that derives from my C++ UMyGameUserSettings, packaged Development/Test builds crash on startup.

From the callstack it looks like:

  • In 5.6 the Blueprint UMyGameUserSettings is created via the new linker / async loading path, on a non-game thread.
  • During construction, UGameUserSettings calls a console variable accessor that uses GetValueOnGameThread, which asserts IsInGameThread() and crashes in Development/Test.
  • In Shipping this assert is compiled out, so the Shipping build does not crash.
  • If I set GameUserSettingsClassName to the C++ class (/Script/MYPROJECT.MyGameUserSettings) instead of the Blueprint, there is no crash.

Questions:

  1. Is using a Blueprint (derived from a C++ subclass of UGameUserSettings) as GameUserSettingsClassName officially supported in 5.6?
  2. Is there any recommended workaround for 5.6, or should we stick to a pure C++ GameUserSettingsClassName for now?

Steps to Reproduce

  1. Create a C++ class derived from UGameUserSettings and make it Blueprintable:
// MyGameUserSettings.h

UCLASS(Config=GameUserSettings, ConfigDoNotCheckDefaults, Blueprintable)
class MYPROJECT_API UMyGameUserSettings : public UGameUserSettings
{
    GENERATED_BODY()

public:
    UMyGameUserSettings(const FObjectInitializer& ObjectInitializer);

    UPROPERTY(Config, BlueprintReadWrite, Category="MySettings")
    float ExampleSetting{1.0f};
};

// MyGameUserSettings.cpp

#include "MyGameUserSettings.h"

UMyGameUserSettings::UMyGameUserSettings(const FObjectInitializer& ObjectInitializer)
    : Super(ObjectInitializer)
{
}

2. In the editor, create BP_MyGameUserSettings (Blueprint) based on UMyGameUserSettings and save it, e.g. /Game/Blueprints/BP_MyGameUserSettings.

3. Set GameUserSettingsClassName to this Blueprint, e.g. in DefaultEngine.ini:

[/Script/Engine.Engine]
GameUserSettingsClassName=/Game/Blueprints/BP_MyGameUserSettings.BP_MyGameUserSettings_C

(or via Project Settings → Game User Settings Class).

4. Package the project for Windows in Development (or Test) and run the packaged .exe.

→ Crash on startup.

5. Change GameUserSettingsClassName to the C++ class:

GameUserSettingsClassName=/Script/MYPROJECT.MyGameUserSettings

→ Development/Test build starts fine.

6. Package Shipping build with the Blueprint again as GameUserSettingsClassName.

→ Shipping build does not crash.

Hi Kirill,

Following your steps to reproduce, I am unable to get the crash. Packaging the project (after all the setup) for Windows in Development, then running the exe results in me entering the level with no crash during start up.

Would you be able to share an example repro project and the call stack?

Is using a Blueprint (derived from a C++ subclass of UGameUserSettings) as GameUserSettingsClassName officially supported in 5.6?

-Using Blueprints derived from a C++ subclass in general should be supported as denoted in this example doc. That being said, I was unable to find specifics for GameUserSettingsClassName and the closest I found was this document that discusses how saving and loading works in Parrot. I can get that looked into if you’re still running into the crash.

Is there any recommended workaround for 5.6, or should we stick to a pure C++ GameUserSettingsClassName for now?

-If it continues to crash, it is recommended to stick to C++ as many of the discussions (example 1 and example 2) look into inheriting from GameUserSettings and adding custom variables through C++.

Please let me know if this helps, thank you!

Regards

Hi,

I wanted to check-in to see if the above information helped out, or if the issue is still occurring for you and you’re able to share the call stack / repro project

Please let me know, thank you!

Regards