unreal.GameUserSettings

class unreal.GameUserSettings(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: Object

Stores user settings for a game (for example graphics and sound settings), with the ability to save and load to and from a file.

C++ Source:

  • Module: Engine

  • File: GameUserSettings.h

Editor Properties: (see get_editor_property/set_editor_property)

  • on_game_user_settings_ui_needs_update (OnGameUserSettingsUINeedsUpdate): [Read-Write] On Game User Settings UINeeds Update

apply_hardware_benchmark_results() None

Applies the settings stored in ScalabilityQuality and saves settings

apply_non_resolution_settings() None

Apply Non Resolution Settings

apply_resolution_settings(check_for_command_line_overrides) None

Apply Resolution Settings

Parameters:

check_for_command_line_overrides (bool) –

apply_settings(check_for_command_line_overrides=True) None

Applies all current user settings to the game and saves to permanent storage (e.g. file), optionally checking for command line overrides.

Parameters:

check_for_command_line_overrides (bool) –

confirm_video_mode() None

Mark current video mode settings (fullscreenmode/resolution) as being confirmed by the user

enable_hdr_display_output(enable, display_nits=1000) None

Enables or disables HDR display output. Can be called again to change the desired nit level

Parameters:
  • enable (bool) –

  • display_nits (int32) –

get_anti_aliasing_quality() int32

Returns the anti-aliasing quality (0..4, higher is better)

Return type:

int32

get_audio_quality_level() int32

Returns the user’s audio quality level setting

Return type:

int32

get_current_hdr_display_nits() int32

Returns 0 if HDR isn’t supported or is turned off

Return type:

int32

classmethod get_default_resolution() IntPoint

Returns the default resolution when no resolution is set

Return type:

IntPoint

get_default_resolution_scale() float

Gets the desired resolution quality based on DesiredScreenWidth/Height and the current screen resolution

Return type:

float

classmethod get_default_window_mode() WindowMode

Returns the default window mode when no mode is set

Return type:

WindowMode

classmethod get_default_window_position() IntPoint

Returns the default window position when no position is set

Return type:

IntPoint

get_desktop_resolution() IntPoint

Returns user’s desktop resolution, in pixels.

Return type:

IntPoint

get_foliage_quality() int32

Returns the foliage quality (0..4, higher is better)

Return type:

int32

classmethod get_frame_pace() int32

Gets the current frame pacing frame rate in fps, or 0 if none

Return type:

int32

get_frame_rate_limit() float

Gets the user’s frame rate limit (0 indiciates the frame rate limit is disabled)

Return type:

float

get_fullscreen_mode() WindowMode

Returns the user setting for game window fullscreen mode.

Return type:

WindowMode

classmethod get_game_user_settings() GameUserSettings

Returns the game local machine settings (resolution, windowing mode, scalability settings, etc…)

Return type:

GameUserSettings

get_global_illumination_quality() int32

Returns the global illumination quality (0..4, higher is better)

Return type:

int32

get_last_confirmed_fullscreen_mode() WindowMode

Returns the last confirmed user setting for game window fullscreen mode.

Return type:

WindowMode

get_last_confirmed_screen_resolution() IntPoint

Returns the last confirmed user setting for game screen resolution, in pixels.

Return type:

IntPoint

get_overall_scalability_level() int32

Returns the overall scalability level (can return -1 if the settings are custom)

Return type:

int32

get_post_processing_quality() int32

Returns the post-processing quality (0..4, higher is better)

Return type:

int32

get_preferred_fullscreen_mode() WindowMode

Returns the user setting for game window fullscreen mode.

Return type:

WindowMode

Gets the recommended resolution quality based on LastRecommendedScreenWidth/Height and the current screen resolution

Return type:

float

get_reflection_quality() int32

Returns the reflection quality (0..4, higher is better)

Return type:

int32

get_resolution_scale_information() -> (current_scale_normalized=float, current_scale_value=int32, min_scale_value=int32, max_scale_value=int32)

Get Resolution Scale Information deprecated: Function ‘GetResolutionScaleInformation’ is deprecated.

Returns:

current_scale_normalized (float):

current_scale_value (int32):

min_scale_value (int32):

max_scale_value (int32):

Return type:

tuple

get_resolution_scale_information_ex() -> (current_scale_normalized=float, current_scale_value=float, min_scale_value=float, max_scale_value=float)

Returns the current resolution scale and the range

Returns:

current_scale_normalized (float):

current_scale_value (float):

min_scale_value (float):

max_scale_value (float):

Return type:

tuple

get_resolution_scale_normalized() float

Gets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue

Return type:

float

get_screen_resolution() IntPoint

Returns the user setting for game screen resolution, in pixels.

Return type:

IntPoint

get_shading_quality() int32

Returns the shading quality (0..4, higher is better)

Return type:

int32

get_shadow_quality() int32

Returns the shadow quality (0..4, higher is better)

Return type:

int32

classmethod get_sync_interval() int32

Get Sync Interval

Return type:

int32

get_texture_quality() int32

Returns the texture quality (0..4, higher is better)

Return type:

int32

get_view_distance_quality() int32

Returns the view distance quality (0..4, higher is better)

Return type:

int32

get_visual_effect_quality() int32

Returns the visual effects quality (0..4, higher is better)

Return type:

int32

is_dirty() bool

Checks if any user settings is different from current

Return type:

bool

is_dynamic_resolution_dirty() bool

Checks if the dynamic resolution user setting is different from current system setting

Return type:

bool

is_dynamic_resolution_enabled() bool

Returns the user setting for dynamic resolution.

Return type:

bool

is_fullscreen_mode_dirty() bool

Checks if the FullscreenMode user setting is different from current

Return type:

bool

is_hdr_enabled() bool

Is HDREnabled

Return type:

bool

is_screen_resolution_dirty() bool

Checks if the Screen Resolution user setting is different from current

Return type:

bool

is_v_sync_dirty() bool

Checks if the vsync user setting is different from current system setting

Return type:

bool

is_v_sync_enabled() bool

Returns the user setting for vsync.

Return type:

bool

load_settings(force_reload=False) None

Loads the user settings from persistent storage

Parameters:

force_reload (bool) –

property on_game_user_settings_ui_needs_update: OnGameUserSettingsUINeedsUpdate

[Read-Write] On Game User Settings UINeeds Update

Type:

(OnGameUserSettingsUINeedsUpdate)

reset_to_current_settings() None

This function resets all settings to the current system settings

revert_video_mode() None

Revert video mode (fullscreenmode/resolution) back to the last user confirmed values

run_hardware_benchmark(work_scale=10, cpu_multiplier=1.000000, gpu_multiplier=1.000000) None

Runs the hardware benchmark and populates ScalabilityQuality as well as the last benchmark results config members, but does not apply the settings it determines. Designed to be called in conjunction with ApplyHardwareBenchmarkResults

Parameters:
  • work_scale (int32) –

  • cpu_multiplier (float) –

  • gpu_multiplier (float) –

save_settings() None

Save the user settings to persistent storage (automatically happens as part of ApplySettings)

set_anti_aliasing_quality(value) None

Sets the anti-aliasing quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_audio_quality_level(quality_level) None

Sets the user’s audio quality level setting

Parameters:

quality_level (int32) –

set_benchmark_fallback_values() None

Set scalability settings to sensible fallback values, for use when the benchmark fails or potentially causes a crash

set_dynamic_resolution_enabled(enable) None

Sets the user setting for dynamic resolution. See UGameUserSettings::bUseDynamicResolution.

Parameters:

enable (bool) –

set_foliage_quality(value) None

Sets the foliage quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_frame_rate_limit(new_limit) None

Sets the user’s frame rate limit (0 will disable frame rate limiting)

Parameters:

new_limit (float) –

set_fullscreen_mode(fullscreen_mode) None

Sets the user setting for the game window fullscreen mode. See UGameUserSettings::FullscreenMode.

Parameters:

fullscreen_mode (WindowMode) –

set_global_illumination_quality(value) None

Sets the global illumination quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_overall_scalability_level(value) None

Changes all scalability settings at once based on a single overall quality level

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic

set_post_processing_quality(value) None

Sets the post-processing quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_reflection_quality(value) None

Sets the reflection quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_resolution_scale_normalized(new_scale_normalized) None

Sets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue

Parameters:

new_scale_normalized (float) –

set_resolution_scale_value(new_scale_value) None

Set Resolution Scale Value deprecated: Function ‘SetResolutionScaleValue’ is deprecated.

Parameters:

new_scale_value (int32) –

set_resolution_scale_value_ex(new_scale_value) None

Sets the current resolution scale

Parameters:

new_scale_value (float) –

set_screen_resolution(resolution) None

Sets the user setting for game screen resolution, in pixels.

Parameters:

resolution (IntPoint) –

set_shading_quality(value) None

Sets the shading quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_shadow_quality(value) None

Sets the shadow quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_texture_quality(value) None

Sets the texture quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_to_defaults() None

Set to Defaults

set_v_sync_enabled(enable) None

Sets the user setting for vsync. See UGameUserSettings::bUseVSync.

Parameters:

enable (bool) –

set_view_distance_quality(value) None

Sets the view distance quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

set_visual_effect_quality(value) None

Sets the visual effects quality (0..4, higher is better)

Parameters:

value (int32) – 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)

supports_hdr_display_output() bool

Whether the curently running system supports HDR display output

Return type:

bool

validate_settings() None

Validates and resets bad user settings to default. Deletes stale user settings file if necessary.