This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Программирование
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Configuration File

The engine configuration file (*.cfg) is an XML file that stores all global engine-related and project-related settings. These settings are read by the engine on the application start-up and used for engine initialization. By default, the configuration file unigine.cfg is created automatically on project creation.

A path to the configuration file is set by using the -engine_config command-line option on the application start-up.

Notice
If the configuration file is stored in an .ung package, it won't be loaded and, therefore, the engine won't be initialized. However, when the file system is initialized, you can set the configuration file stored in the package via the config_load console command.
A path can be both absolute or relative. An absolute path is always used as is. If a relative path is specified, searching of the configuration file is performed as follows:
  1. If the -project_name CLI option is set, the project folder in the User profile will be checked first for the configuration file. At that, only the name of the specified file will be checked. For example, if you run the application as follows:
    Shell commands
    bin/main_x86d.exe -project_name "my_project" -engine_config "configs/engine.cfg"
    The engine will check the engine.cfg file in the following folder:
    • On Windows, C:/Users/<username>/my_project/
    • On Linux, /home/<username>/.my_project/
  2. Then the specified path to the configuration file will be checked relative to the binary executable.
  3. Then the path to the configuration file will be checked relative to the data_path.
  4. Next the path to the configuration file will be checked relative to the first sub-folder of the data folder (for example, it is the data/unigine_project/ folder for projects created via UNIGINE SDK Browser).
  5. If the configuration file isn't found, the engine will try to create a default file relative to the binary executable or in the project folder specified in the -project_name. This default configuration file will contain renderer settings.

Configuration File Format#

The configuration file has the following format:

Source code (XML)
<config version="2.2.1">
	<item name="option_name" type="option_type">option_value</item>
	...
	<item name="option_name" type="option_type">option_value</item>
</config>

Each item corresponds to one setting:

  • option_name - a name of the engine-related and project-related setting. It is the same as a name of the corresponding console variable.
  • option_type - a type of the setting: bool, int, float, string.

To read values from the configuration file and write them back, use functionality of the Config class. Use the appropriate methods depending on the type of the target item.

Setting Startup Options via Configuration File#

The application start-up options can be set via both the command-line and the configuration file.

The CLI options specified on the application start-up always take precedence over the ones stored in the configuration file. Some of the CLI options can be changed through the console, so they are automatically stored in the configuration file (this way, after the application is quit, they will be restored on the next start-up). However, there are command-line options that don't change the configuration file, namely:

Notice
You can specify the required options manually by editing the *.cfg file.

For example, if you specify the -video_app command-line option on the application start-up, the corresponding setting video_app in the configuration file will be ignored.

Notice
All multiple plugin paths (plugin_path) will be ignored, if at least one -plugin_path is specified in the command-line.
Last update: 27.12.2018
Build: ()