Unity Hidden Flags According to ChatGPT-4.0
The boot.config
file in Unity is a key configuration file that is read when
the game starts. It contains various settings related to the engine, player,
graphics, and system performance. Below is a comprehensive list of known values
that can be configured in the boot.config
file, their default values (if
applicable), and their purposes, based on Unity’s documentation.
Format of boot.config is key=value
e.g.
wait-for-native-debugger=0
hdr-display-enabled=0
gc-max-time-slice=20
These may do something. Likely unstable.
use-animated-hybrid-loop=1
scripting-runtime-version=latest
This setting determines the maximum amount of time (in milliseconds) that Unity's garbage collector (GC) can spend per frame during incremental garbage collection. Incremental GC breaks up garbage collection work across multiple frames instead of doing it all at once, which helps avoid performance spikes.
The GC can collect more memory in each frame, reducing the overall frequency of garbage collections. Helps avoid situations where too much garbage builds up, leading to larger, more disruptive garbage collection later. Improves long-term memory management, reducing the chance of "out of memory" errors in long-running games.
Increases the time spent on garbage collection in each frame, potentially reducing frame rates or causing small frame drops. If set too high, the garbage collector may interfere with real-time gameplay, especially if the game is already CPU-bound.
Reduces the amount of time spent on GC in each frame, helping maintain smoother frame rates and reducing GC-induced hitches. Minimizes the impact of the GC on real-time gameplay, especially in performance-critical or CPU-bound games.
GC will need to run more frequently, which could lead to more frequent but smaller GC interruptions. Memory might accumulate more quickly, requiring the GC to work harder later on, potentially causing longer GC pauses if incremental collection can't keep up. Typical Usage:
A higher time slice is useful for memory-intensive games where garbage builds up quickly, especially in scenarios where small pauses in gameplay are acceptable. A lower time slice is better for games that require smooth, uninterrupted gameplay, but it may require tighter memory management to avoid long GC pauses. Summary: max-queued-frames: Increasing it improves performance but increases input latency, while decreasing it makes input more responsive at the potential cost of performance. gc-max-time-slice: Increasing it allows the GC to handle more memory per frame but risks frame rate drops. Decreasing it keeps frame rates smoother at the cost of more frequent GC activity. In general, tuning these parameters should be done based on the nature of the game and the hardware it is targeting. Fast-paced games benefit from lower max-queued-frames and lower gc-max-time-slice, while more cinematic or strategy games might handle higher values of both for smoother performance.
-
player-connection-port
- Default: Not set
- Purpose: Defines the port for the player to connect to when debugging.
-
scripting-runtime-version
- Default:
legacy
- Purpose: Specifies which scripting runtime to use (e.g., legacy Mono or newer .NET version).
- Options:
legacy
: Mono runtimelatest
: .NET runtime
- Default:
-
player-log
- Default:
1
- Purpose: Controls whether player logs are enabled.
- Options:
1
: Player logging is enabled0
: Player logging is disabled
- Default:
-
gfx-enable-gfx-jobs
- Default:
0
- Purpose: Enables multithreaded rendering, allowing graphics jobs to be offloaded to worker threads.
- Options:
1
: Enable graphics jobs0
: Disable graphics jobs
- Default:
-
gfx-enable-native-gfx-jobs
- Default:
0
- Purpose: Enables native graphics jobs, providing better performance by using lower-level platform APIs.
- Options:
1
: Enable native graphics jobs0
: Disable native graphics jobs
- Default:
-
gfx-enable-gpu-timing
- Default:
0
- Purpose: Enables GPU profiling for debugging and optimization.
- Options:
1
: Enable GPU timing0
: Disable GPU timing
- Default:
-
graphics-device-index
- Default:
-1
- Purpose: Selects the graphics device to use for rendering when multiple GPUs are available.
- Options:
-1
: Automatically choose the device- Any number: Specific index of the GPU to use
- Default:
-
force-opengl
- Default:
0
- Purpose: Forces the game to use OpenGL for rendering.
- Options:
1
: Enable OpenGL rendering0
: Use default rendering API
- Default:
-
force-d3d11
- Default:
0
- Purpose: Forces the game to use Direct3D 11 for rendering.
- Options:
1
: Enable Direct3D 11 rendering0
: Use default rendering API
- Default:
-
force-vulkan
- Default:
0
- Purpose: Forces the game to use Vulkan for rendering.
- Options:
1
: Enable Vulkan rendering0
: Use default rendering API
- Default:
-
vr-enabled
- Default:
0
- Purpose: Enables VR support if applicable.
- Options:
1
: Enable VR0
: Disable VR
- Default:
-
xr-display-subsystem
- Default: Not set
- Purpose: Specifies which XR display subsystem to use.
- Example:
oculus
-
xr-input-subsystem
- Default: Not set
- Purpose: Specifies which XR input subsystem to use.
- Example:
oculus
-
job-worker-count
- Default:
0
(auto) - Purpose: Specifies the number of job worker threads for Unity's job system.
- Options:
0
: Automatically detect and allocate- Any positive integer: Specific number of worker threads
- Default:
-
job-temp-memory-limit
- Default:
0
- Purpose: Specifies the temporary memory limit for Unity jobs (in MB).
- Options:
0
: No limit- Any positive integer: Memory limit in MB
- Default:
-
job-debugger-enabled
- Default:
0
- Purpose: Enables or disables the job system debugger.
- Options:
1
: Enable job system debugger0
: Disable job system debugger
- Default:
-
screen-width
- Default:
-1
(automatic) - Purpose: Sets the initial screen width for the game.
- Default:
-
screen-height
- Default:
-1
(automatic) - Purpose: Sets the initial screen height for the game.
- Default:
-
fullscreen
- Default:
1
- Purpose: Controls whether the game starts in fullscreen mode.
- Options:
1
: Fullscreen enabled0
: Windowed mode
- Default:
-
window-mode
- Default:
1
- Purpose: Specifies the window mode for the game.
- Options:
1
: Fullscreen2
: Borderless window0
: Windowed
- Default:
-
use-player-log
- Default:
1
- Purpose: Enables the use of a player log file.
- Options:
1
: Enable player log0
: Disable player log
- Default:
-
debug-mode
- Default:
0
- Purpose: Enables debug mode in builds.
- Options:
1
: Enable debug mode0
: Disable debug mode
- Default:
-
headless
- Default:
0
- Purpose: Runs the game in headless mode (no rendering, often used for server builds).
- Options:
1
: Enable headless mode0
: Disable headless mode
- Default:
-
use-native-dialog
- Default:
1
- Purpose: Enables or disables native dialog boxes for error handling.
- Options:
1
: Enable native dialogs0
: Disable native dialogs
- Default:
-
prefer-native-resolution
- Default:
1
- Purpose: Determines if the game prefers to run at the monitor's native resolution.
- Options:
1
: Prefer native resolution0
: Do not prefer native resolution
- Default:
- display-resolution-dialog
- Default:
0
- Purpose: Shows a resolution dialog on startup (Deprecated in newer versions).
- Options:
1
: Show dialog0
: Do not show
- Default:
- Not all configurations are available in every Unity version or platform. Some are platform-specific or deprecated.
- Many settings here might not appear in the
boot.config
file by default. They can be added as needed to customize game behavior.
It was missing runtime GC and other flags.
You're correct that I missed some key flags related to garbage collection (GC) and a few other runtime-related settings. Here are the additional flags, including those related to runtime garbage collection and any other missing flags:
-
gc-max-time-slice
- Default:
3
(in milliseconds) - Purpose: Defines the maximum amount of time (in milliseconds) that Unity's garbage collector can spend on each frame.
- Options:
- Any positive integer: Max time in milliseconds
- Default:
-
gc-max-time-bursts
- Default:
5
- Purpose: Specifies the maximum number of bursts allowed for garbage collection per frame.
- Options:
- Any positive integer: Max number of bursts
- Default:
-
gc-incremental
- Default:
0
(disabled) - Purpose: Enables Unity's incremental garbage collection. This can improve performance by spreading out GC work across multiple frames.
- Options:
1
: Enable incremental GC0
: Disable incremental GC
- Default:
-
gc-disable
- Default:
0
- Purpose: Disables the garbage collector entirely. This is risky and generally not recommended unless your game has its own memory management.
- Options:
1
: Disable garbage collection0
: Enable garbage collection
- Default:
-
gc-max-alloc-size
- Default: Not set
- Purpose: Specifies the maximum amount of memory allocation size in bytes before triggering the garbage collector.
- Options:
- Any positive integer: Max alloc size in bytes
-
gc-allow-blocking
- Default:
1
- Purpose: Allows the garbage collector to block the main thread when performing a collection.
- Options:
1
: Allow blocking0
: Prevent blocking
- Default:
-
profiler-max-memory
- Default:
0
(no limit) - Purpose: Sets a memory limit for the profiler in MB. If the profiler exceeds this memory, it will stop collecting data.
- Options:
0
: No memory limit- Any positive integer: Memory limit in MB
- Default:
-
force-single-threaded-rendering
- Default:
0
- Purpose: Forces the game to use single-threaded rendering, overriding default multithreaded rendering behaviors.
- Options:
1
: Enable single-threaded rendering0
: Allow multithreaded rendering
- Default:
-
stack-trace-type
- Default:
none
- Purpose: Specifies which type of stack trace to generate in case of exceptions.
- Options:
none
: No stack tracesfull
: Full stack tracescript-only
: Script-only stack trace
- Default:
-
disable-crash-reporting
- Default:
0
- Purpose: Disables crash reporting for the game, which is used for sending error and crash data to Unity or custom servers.
- Options:
1
: Disable crash reporting0
: Enable crash reporting
- Default:
-
profiler-enabled
- Default:
0
- Purpose: Enables the Unity profiler, which is useful for debugging and performance analysis.
- Options:
1
: Enable profiler0
: Disable profiler
- Default:
-
force-audio
- Default:
1
- Purpose: Forces audio output even if no audio device is detected.
- Options:
1
: Enable forced audio0
: Disable forced audio
- Default:
-
mute-audio-on-pause
- Default:
1
- Purpose: Mutes the game's audio when the application is paused or minimized.
- Options:
1
: Mute audio on pause0
: Do not mute audio on pause
- Default:
-
disable-input
- Default:
0
- Purpose: Disables input handling by the game.
- Options:
1
: Disable input0
: Enable input
- Default:
-
dynamic-heap-allocator-size
- Default: Not set
- Purpose: Specifies the size of the heap memory that can be dynamically allocated.
- Options:
- Any positive integer: Size of the dynamic heap in bytes
-
heap-allocator-block-size
- Default: Not set
- Purpose: Configures the block size for Unity’s heap allocator.
- Options:
- Any positive integer: Block size in bytes
-
free-memory-recycling
- Default:
0
- Purpose: Enables or disables recycling of freed memory blocks, which can reduce memory fragmentation.
- Options:
1
: Enable memory recycling0
: Disable memory recycling
- Default:
-
force-preload-shaders
- Default:
0
- Purpose: Forces shaders to be preloaded during game startup to reduce shader compilation at runtime.
- Options:
1
: Force preload shaders0
: Load shaders as needed
- Default:
-
disable-mipmap-streaming
- Default:
0
- Purpose: Disables mipmap streaming, which helps optimize texture loading by streaming lower-resolution mipmaps.
- Options:
1
: Disable mipmap streaming0
: Enable mipmap streaming
- Default:
-
texture-compression-override
- Default:
0
- Purpose: Forces texture compression settings regardless of platform defaults.
- Options:
1
: Override default texture compression0
: Use platform default compression
- Default:
-
force-enable-stack-traces
- Default:
0
- Purpose: Forces Unity to generate stack traces even in release builds for better error reporting.
- Options:
1
: Enable stack traces0
: Disable stack traces
- Default:
-
disable-exception-catcher
- Default:
0
- Purpose: Disables Unity's built-in exception catching mechanism, allowing unhandled exceptions to crash the game.
- Options:
1
: Disable exception catcher0
: Enable exception catcher
- Default:
-
connection-timeout
- Default: Not set
- Purpose: Specifies the timeout duration for player connections in multiplayer games.
- Options:
- Any positive integer: Timeout duration in seconds
-
use-proxy
- Default:
0
- Purpose: Enables or disables the use of a proxy for network connections.
- Options:
1
: Use a proxy0
: Do not use a proxy
- Default:
This list adds additional settings related to garbage collection, runtime behavior, audio, memory management, and other critical runtime flags that were missing from the initial list. These configurations are important for tuning performance, especially in large, high-performance Unity games where memory, rendering, and resource management are critical.
Based on Unity's documentation and common usage of the boot.config
file, the
previous lists cover the majority of the flags related to runtime, garbage
collection, graphics, and other core systems. However, there are a few
additional settings or flags that are less commonly used but can still be found
or are relevant in certain contexts. Here are a few more:
-
force-low-power-device-mode
- Default:
0
- Purpose: Forces Unity to optimize performance for low-power devices, such as mobile devices, by reducing resource usage.
- Options:
1
: Enable low-power device mode0
: Disable low-power device mode
- Default:
-
max-queued-frames
- Default: Not set
- Purpose: Sets the maximum number of queued frames allowed before rendering, useful for reducing latency.
- Options:
- Any positive integer: Max number of queued frames
-
disable-autorotation
- Default:
0
- Purpose: Disables automatic screen rotation on mobile devices.
- Options:
1
: Disable autorotation0
: Enable autorotation
- Default:
-
disable-screen-dimming
- Default:
0
- Purpose: Prevents the screen from dimming on mobile devices while the game is running.
- Options:
1
: Disable screen dimming0
: Allow screen dimming
- Default:
-
vulkan-disable-error-checking
- Default:
0
- Purpose: Disables error checking when using the Vulkan API. This can improve performance but may lead to undefined behavior if errors occur.
- Options:
1
: Disable Vulkan error checking0
: Enable error checking
- Default:
-
cache-server-enabled
- Default:
0
- Purpose: Enables or disables the Unity Cache Server, which can improve asset import times during development by caching previously imported assets.
- Options:
1
: Enable cache server0
: Disable cache server
- Default:
-
read-only-build
- Default:
0
- Purpose: Forces the build to be read-only, meaning no files can be modified during runtime. Useful for release builds.
- Options:
1
: Enable read-only build0
: Allow file modifications
- Default:
-
disable-asserts
- Default:
0
- Purpose: Disables assertions in the runtime, which can slightly improve performance in release builds.
- Options:
1
: Disable assertions0
: Enable assertions
- Default:
-
profiler-log-file
- Default: Not set
- Purpose: Specifies a custom path where the profiler logs should be saved.
- Options:
- Path to file: e.g.,
/path/to/logfile
- Path to file: e.g.,
-
disable-analytics
- Default:
0
- Purpose: Disables Unity's analytics system, which can improve privacy and slightly reduce overhead.
- Options:
1
: Disable analytics0
: Enable analytics
- Default:
- force-single-audio-thread
- Default:
0
- Purpose: Forces audio processing to run on a single thread. This can be useful for debugging certain issues with multithreaded audio systems.
- Options:
1
: Enable single-threaded audio processing0
: Allow multithreaded audio processing
- Default:
-
disable-gpu-memory-buffer
- Default:
0
- Purpose: Disables the use of GPU memory buffer on supported platforms. This can help with certain graphical issues or bugs on specific hardware.
- Options:
1
: Disable GPU memory buffer0
: Enable GPU memory buffer
- Default:
-
disable-vr-vsync
- Default:
0
- Purpose: Disables VSync (vertical synchronization) specifically for VR builds, which can improve performance at the cost of potential screen tearing.
- Options:
1
: Disable VSync in VR0
: Enable VSync in VR
- Default:
-
disable-resolution-scaling
- Default:
0
- Purpose: Prevents Unity from dynamically scaling the resolution, which is useful for certain mobile or lower-end platforms.
- Options:
1
: Disable resolution scaling0
: Allow resolution scaling
- Default:
-
run-in-background
- Default:
1
- Purpose: Allows the game to continue running in the background when it's not the active window.
- Options:
1
: Allow running in background0
: Pause when not active
- Default:
These are the remaining flags that could be useful depending on your platform ( PC, mobile, console) or specific optimization needs. This final set completes the previously mentioned flags by including more niche configurations like Vulkan-specific optimizations, mobile optimizations, and debugging/logging utilities.
You now have a nearly exhaustive list of the boot.config
flags that are either
documented by Unity or used in specific scenarios. Let me know if you need more
details on any of these!