配置文件
All global engine-related and project-related settings are grouped and stored in separate configuration files. Each configuration file is an XML file that stores settings of a certain type. The set of configuration files is as follows:所有与全局引擎相关和与项目相关的设置都被分组并存储在单独的配置文件中。每个配置文件都是一个XML文件,用于存储某种类型的设置。配置文件集如下:
- *.boot - this is the main boot configuration file. *.boot 是主要的启动配置文件
- *.config - this file stores all custom application settings. *.config 文件存储所有自定义应用程序设置
- *.controls - this file stores controls configuration. *.controls 文件存储控件配置
- *.user - this file stores various personal settings, such as helpers (wireframe, profiler, etc.). *.user 文件存储各种个人设置,例如助手(线框,分析器等)
The settings from these files are read by the Engine on the application start-up and used for engine initialization.这些文件中的设置由引擎在应用程序启动时读取,并用于引擎初始化。
By default, the set of default configuration files is created automatically on project creation in the project's data/configs folder available as a separate configs section of the Asset Browser.默认情况下,默认配置文件集将在项目创建时自动在项目的data/configs文件夹中创建,该文件夹可作为资源浏览器的单独configs部分使用。
The *.boot configuration file stores the information about location of other configuration files for convenience. The path to the boot configuration file is set by using the -boot_config command-line option on the application start-up. *.boot配置文件存储有关其他配置文件位置的信息,以方便使用。通过在应用程序启动时使用-boot_config命令行选项来设置启动配置文件的路径。
The paths to the configuration files 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: 到配置文件的路径可以是绝对路径或相对路径。绝对路径始终按原样使用。如果指定了相对路径,则按以下方式搜索配置文件:
-
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: The engine will check the my_config.boot file in the following folder:
bin/main_x64d.exe -project_name "my_project" -boot_config "configs/my_config.boot"
- On Windows, C:/Users/<username>/my_project/data/configs/
- On Linux, /home/<username>/.my_project/data/configs/
引擎将检查以下文件夹中的my_config.boot文件:bin/main_x64d.exe -project_name "my_project" -boot_config "configs/my_config.boot"
- Windows, C:/Users/<username>/my_project/data/configs/
- Linux, /home/<username>/.my_project/data/configs/
- By default, the path to the configuration file will be checked relative to the -data_path.默认情况下,将相对于-data_path检查配置文件的路径。
- If the configuration file isn't found, the engine will try to create a default file relative to the data folder or in the project folder specified in the -project_name.如果找不到配置文件,则引擎将尝试创建相对于data文件夹或-project_name中指定的项目文件夹的默认文件。
Startup Configuration启动配置#
This is the main configuration file containing the following Engine startup parameters:这是包含以下引擎启动参数的主要配置文件:
- Paths to GUI skin, log-file, system and UnigineEditor cache files. 到GUI外观,日志文件,系统和UnigineEditor缓存文件的路径
- Boot and Splash screen settings. 开机和启动画面的设置
- Extern defines. 外部定义
- Console commands. 控制台命令
- Startup command-line parameters and a group of world manager settings. 启动命令行参数和一组世界管理设置
- Information about location of other configuration files.其他配置文件位置的信息
Expand the following spoiler to see an example of boot configuration file:展开下面的剧透以查看引导配置文件的示例:
<?xml version="1.0" encoding="utf-8"?>
<boot version="2.17" autosave="0">
<gui_path>core/gui/</gui_path>
<engine_log>log.txt</engine_log>
<system_script>core/unigine.usc</system_script>
<cache_path/>
<system_cache>unigine.cache</system_cache>
<editor_cache>editor.cache</editor_cache>
<video_app>auto</video_app>
<sound_app>auto</sound_app>
<extern_define/>
<console_command/>
<window_title>Project Name</window_title>
<plugin_paths>
<path>plugins/</path>
<path>../extra/plugins/</path>
</plugin_paths>
<extern_plugins>
<plugin>OpenVR</plugin>
<plugin>AdditionalPlugin</plugin>
</extern_plugins>
<console>
<async_log_mode>0</async_log_mode>
<async_log_priority>0</async_log_priority>
<background_update>0</background_update>
<config>configs/default.config</config>
<console_font>core/gui/console.ttf</console_font>
<console_size>16</console_size>
<controls_config>configs/default.controls</controls_config>
<filesystem_mmap>1</filesystem_mmap>
<process_priority>1</process_priority>
<profiler_font>core/gui/font.ttf</profiler_font>
<profiler_size>13</profiler_size>
<splash_screen>0</splash_screen>
<starting_world>my_world</starting_world>
<swap_delay_warning>0</swap_delay_warning>
<swap_delay_warning_time>200</swap_delay_warning_time>
<textures_cache_preload>1</textures_cache_preload>
<user_config>configs/default.user</user_config>
<video_adapter>0</video_adapter>
<video_debug>0</video_debug>
<video_debug_shaders>0</video_debug_shaders>
<main_window_fullscreen>0</main_window_fullscreen>
<main_window_size>1600 900</main_window_size>
<main_window_resizable>1</main_window_resizable>
<main_window_auto_restart>1</main_window_auto_restart>
<main_window_borders>1</main_window_borders>
<main_window_fullscreen_display>0</main_window_fullscreen_display>
<main_window_fullscreen_display_mode>0</main_window_fullscreen_display_mode>
<world_manager_images_memory>128</world_manager_images_memory>
<world_manager_meshes_memory>128</world_manager_meshes_memory>
</console>
<screen>
<width>570</width>
<height>400</height>
<background_color>0, 0, 0, 0</background_color>
<transform>0.5, 0.33, 0.5, 0.5</transform>
<threshold>16</threshold>
<texture>textures/boot_screen.png</texture>
<font>fonts/boot_screen_font.ttf</font>
<text>
<![CDATA[
<p align="center">
<font color="#606060" size="16">
<xy y="%100" dy="-20"/>Project Name
</font>
</p>
]]>
</text>
<messages>
<engine_init>Custom message for engine initialization.</engine_init>
<file_system_init>Custom message for file system initialization.</file_system_init>
<materials_init>Custom message for materials initialization.</materials_init>
<properties_init>Custom message for properties initialization.</properties_init>
<plugins_init>Custom message for plugins initialization.</plugins_init>
<shaders_compilation>Custom message for shaders compilation.</shaders_compilation>
</messages>
</screen>
</boot>
By default, the configs/default.boot file is used. To run the application with another boot configuration file, specify the path to it using the -boot_config command-line option.默认情况下,使用configs/default.boot文件。要使用另一个启动配置文件运行该应用程序,请使用-boot_config命令行选项指定其路径。
The boot configuration file has the following structure:启动配置文件具有以下结构:
<boot version="2.12" autosave="0">
<cli_option>value</cli_option>
...
<console>
<console_command>value</console_command>
...
</console>
<screen>
...
</screen>
</boot>
The application start-up options can be set via both the command-line and the boot configuration file. The CLI options specified on the application start-up always take precedence over the ones stored in the configuration file.可以通过命令行和启动配置文件设置应用程序启动选项。在应用程序启动时指定的 CLI选项始终优先于配置文件中存储的选项。
The configuration file contains the following parameters:配置文件包含以下参数:
- The autosave attribute enables automatic saving of start-up configuration to the file on loading, closing, and saving the world, as well as on the Engine shutdown.使用autosave属性,可以在加载,关闭和保存世界以及引擎关闭时自动将启动配置保存到文件中。
- A set of start-up CLI options:
- window_title - title to be set for the application window. window_title 用于设置应用程序窗口的标题。
-
plugin_paths - a list of paths to directories that contain plugins.
<plugin_paths> <path>plugins/</path> <path>../extra/plugins/</path> </plugin_paths>
All specified plugin paths (plugin_path) will be ignored, if at least one -plugin_path is specified in the command-line. plugin_paths 用于设置包含插件的目录路径的列表。All specified plugin paths (plugin_path) will be ignored, if at least one -plugin_path is specified in the command-line.All specified plugin paths (plugin_path) will be ignored, if at least one -plugin_path is specified in the command-line.<plugin_paths> <path>plugins/</path> <path>../extra/plugins/</path> </plugin_paths>
All specified plugin paths (plugin_path) will be ignored, if at least one -plugin_path is specified in the command-line.如果在命令行中至少指定一个-plugin_path,则所有指定的插件路径(plugin_path)将被忽略。 -
extern_plugins - a list of plugin libraries to be loaded.
extern_plugins 设置一个列表要加载的插件库。
<extern_plugins> <plugin>FBXImporter</plugin> <plugin>CADImporter</plugin> <plugin>OpenVR</plugin> </extern_plugins>
<extern_plugins> <plugin>FBXImporter</plugin> <plugin>CADImporter</plugin> <plugin>OpenVR</plugin> </extern_plugins>
-
The console section contains the console variables to be defined at the engine start-up:
- The screen section lists the boot screen parameters. screen部分列出了开机画面的参数。
To read values from the configuration file and write them back, use functionality of the BootConfig class.要从配置文件中读取值并将其写回,请使用BootConfig类的功能。
Application Configuration应用配置#
This file stores all custom application settings. By default, the configs/default.config file is used. To use another configuration file, specify the path to it in the boot configuration file.此文件存储所有自定义应用程序设置。默认情况下,使用configs/default.config文件。要使用另一个配置文件,请在启动配置文件中指定其路径。
The configuration file has the following format:配置文件具有以下格式:
<config version="2.12" autosave="1">
<item name="option_name" type="option_type">option_value</item>
...
<item name="option_name" type="option_type">option_value</item>
</config>
Expand the following spoiler to see an example of application configuration file:展开下面的剧透以查看应用程序配置文件的示例:
<?xml version="1.0" encoding="utf-8"?>
<config version="2.13" autosave="1">
<player_avatar>soldier</player_avatar>
<skip_curscenes>1</skip_curscenes>
<bulletshell_lifetime>100</bulletshell_lifetime>
</config>
The autosave attribute enables automatic saving of configuration settings to the file on loading, closing, and saving the world, as well as on the Engine shutdown.使用autosave属性可以在加载,关闭和保存世界以及引擎关闭时自动将配置设置保存到文件中。
Each item corresponds to one setting:每个 item 都对应一个设置:
- 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_name 与引擎和项目相关的设置的名称。它与相应的 console 变量的名称相同。
- option_type - a type of the setting: bool, int, float, string.option_type 设置的类型:bool, int, float, string。
Controls Configuration控件配置#
This file stores keyboard control keys and settings defining the mouse behavior. These settings are configured via the UnigineEditor (Windows -> Settings -> Runtime -> Controls).此文件存储键盘控制键和定义鼠标行为的设置。这些设置是通过UnigineEditor(Windows -> Settings -> Runtime -> Controls)进行配置的。
By default, the configs/default.controls file is used. To use another configuration file, specify the path to it in the boot configuration file.默认情况下,使用configs/default.controls文件。要使用另一个配置文件,请在启动配置文件中指定其路径。
The controls configuration file has the following format:控件配置文件具有以下格式:
<controls version="2.12" autosave="1">
<controls_always_run>1</controls_always_run>
<controls_mouse_handle>0</controls_mouse_handle>
<controls_mouse_inverse>0</controls_mouse_inverse>
<controls_mouse_sensitivity>1</controls_mouse_sensitivity>
<keys>
<119/>
...
</keys>
<buttons>
<0/>
...
</buttons>
</controls>
Expand the following spoiler to see an example of controls configuration file:展开下面的剧透以查看控件配置文件的示例:
<?xml version="1.0" encoding="utf-8"?>
<controls version="2.13" autosave="1">
<controls_always_run>0</controls_always_run>
<controls_mouse_handle>0</controls_mouse_handle>
<controls_mouse_inverse>0</controls_mouse_inverse>
<controls_mouse_sensitivity>1</controls_mouse_sensitivity>
<keys>
<119/>
<115/>
<97/>
<100/>
<268/>
<269/>
<266/>
<267/>
<113/>
<101/>
<270/>
<259/>
<0/>
<281/>
<282/>
<288/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
</keys>
<buttons>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<1/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
<0/>
</buttons>
</controls>
The parameters are:参数为:
- The autosave attribute enables automatic saving of controls configuration to the file on loading, closing, and saving the world, as well as on the Engine shutdown. autosave属性可在加载,关闭和保存世界以及引擎关闭时自动将控件配置保存到文件中。
- controls_always_run - sets the Always Run option. controls_always_run 设置Always Run选项。
- controls_mouse_handle - sets the Mouse Handle option. controls_mouse_handle 设置Mouse Handle选项。
- controls_mouse_inverse - sets the Invert Mouse option. controls_mouse_inverse 设置Invert Mouse选项。
- controls_mouse_sensitivity - sets the Mouse Speed option. controls_mouse_sensitivity 设置Mouse Speed选项。
- keys - a set of key bindings to the STATE_* states of the Control class. keys 到STATE_* Control类的状态。
- buttons - a set of mouse button bindings to the STATE_* states of the Control class. buttons 一组鼠标按钮绑定到STATE_* Control类的状态。
To manage the controls configuration, use functionality of the ControlsApp class or classes derived from the Controls class.要管理控件配置,请使用ControlsApp类或从Controls类派生的类的功能。
User Configuration用户配置#
This file stores various personal settings, such as helpers (wireframe, profiler, etc.). By default, the configs/default.user file is used. To use another configuration file, specify the path to it in the boot configuration file.此文件存储各种个人设置,例如助手(线框,分析器等)。默认情况下,使用configs/default.user文件。要使用另一个配置文件,请在启动配置文件中指定其路径。
The user configuration file has the following format:用户配置文件具有以下格式:
<?xml version="1.0" encoding="utf-8"?>
<config version="2.19.0.2" autosave="1">
<parameter>value</parameter>
...
</user>
Expand the following spoiler to see an example of user configuration file:展开下面的剧透查看用户配置文件的示例:
<?xml version="1.0" encoding="utf-8"?>
<user version="2.19.0.2" autosave="1">
<console_height>75</console_height>
<console_key>BACK_QUOTE</console_key>
<console_key_modifier/>
<console_onscreen>0</console_onscreen>
<console_onscreen_font_size>14</console_onscreen_font_size>
<console_onscreen_height>20</console_onscreen_height>
<console_onscreen_time>2</console_onscreen_time>
<console_wrapping>0</console_wrapping>
<materials_reload_event>1</materials_reload_event>
<microprofile_dump_frames>500</microprofile_dump_frames>
<microprofile_enabled>1</microprofile_enabled>
<microprofile_webserver_frames>200</microprofile_webserver_frames>
<physics_show_collision_surfaces>0</physics_show_collision_surfaces>
<physics_show_contacts>0</physics_show_contacts>
<physics_show_joints>0</physics_show_joints>
<physics_show_shapes>0</physics_show_shapes>
<physics_show_shapes_distance>500</physics_show_shapes_distance>
<render_show_alpha_test>0</render_show_alpha_test>
<render_show_ambient>0</render_show_ambient>
<render_show_cascades>0</render_show_cascades>
<render_show_clusters>0</render_show_clusters>
<render_show_collision_mask>0</render_show_collision_mask>
<render_show_collision_mask_bits>-1</render_show_collision_mask_bits>
<render_show_complex_shadow_shader>0</render_show_complex_shadow_shader>
<render_show_decals>0</render_show_decals>
<render_show_dynamic>0</render_show_dynamic>
<render_show_emission>0</render_show_emission>
<render_show_field_mask>0</render_show_field_mask>
<render_show_field_mask_bits>-1</render_show_field_mask_bits>
<render_show_geodetic_pivot>0</render_show_geodetic_pivot>
<render_show_immovable>0</render_show_immovable>
<render_show_intersection>0</render_show_intersection>
<render_show_intersection_mask>0</render_show_intersection_mask>
<render_show_intersection_mask_bits>-1</render_show_intersection_mask_bits>
<render_show_landscape_albedo>0</render_show_landscape_albedo>
<render_show_landscape_mask>0</render_show_landscape_mask>
<render_show_landscape_terrain_vt_streaming>0</render_show_landscape_terrain_vt_streaming>
<render_show_lighting_mode>0</render_show_lighting_mode>
<render_show_lightmap_checker>0</render_show_lightmap_checker>
<render_show_manual_materials>0</render_show_manual_materials>
<render_show_material_mask>0</render_show_material_mask>
<render_show_material_mask_bits>-1</render_show_material_mask_bits>
<render_show_mesh_dynamics>0</render_show_mesh_dynamics>
<render_show_mesh_statics>0</render_show_mesh_statics>
<render_show_navigation_mask>0</render_show_navigation_mask>
<render_show_navigation_mask_bits>-1</render_show_navigation_mask_bits>
<render_show_nodes_interaction_clutter>0</render_show_nodes_interaction_clutter>
<render_show_nodes_interaction_grass>0</render_show_nodes_interaction_grass>
<render_show_nodes_interaction_trigger>0</render_show_nodes_interaction_trigger>
<render_show_non_manual_materials>0</render_show_non_manual_materials>
<render_show_obstacle_mask>0</render_show_obstacle_mask>
<render_show_obstacle_mask_bits>-1</render_show_obstacle_mask_bits>
<render_show_occluder>0</render_show_occluder>
<render_show_physical_exclusion_mask>0</render_show_physical_exclusion_mask>
<render_show_physical_exclusion_mask_bits>-1</render_show_physical_exclusion_mask_bits>
<render_show_physical_mask>0</render_show_physical_mask>
<render_show_physical_mask_bits>-1</render_show_physical_mask_bits>
<render_show_physics_intersection>0</render_show_physics_intersection>
<render_show_physics_intersection_mask>0</render_show_physics_intersection_mask>
<render_show_physics_intersection_mask_bits>-1</render_show_physics_intersection_mask_bits>
<render_show_queries>0</render_show_queries>
<render_show_scissors>0</render_show_scissors>
<render_show_shadow_mask>0</render_show_shadow_mask>
<render_show_shadow_mask_bits>-1</render_show_shadow_mask_bits>
<render_show_sound_occlusion_mask>0</render_show_sound_occlusion_mask>
<render_show_sound_occlusion_mask_bits>-1</render_show_sound_occlusion_mask_bits>
<render_show_sound_reverb_mask>0</render_show_sound_reverb_mask>
<render_show_sound_reverb_mask_bits>-1</render_show_sound_reverb_mask_bits>
<render_show_sound_source_mask>0</render_show_sound_source_mask>
<render_show_sound_source_mask_bits>-1</render_show_sound_source_mask_bits>
<render_show_surface_custom_texture>0</render_show_surface_custom_texture>
<render_show_surface_custom_texture_not_available>0</render_show_surface_custom_texture_not_available>
<render_show_surface_custom_texture_not_used>0</render_show_surface_custom_texture_not_used>
<render_show_texture_resolution>0</render_show_texture_resolution>
<render_show_textures>0</render_show_textures>
<render_show_textures_number>7</render_show_textures_number>
<render_show_textures_offset>0</render_show_textures_offset>
<render_show_transparent>0</render_show_transparent>
<render_show_triangles>0</render_show_triangles>
<render_show_vertex_color>0</render_show_vertex_color>
<render_show_viewport_mask>0</render_show_viewport_mask>
<render_show_viewport_mask_bits>-1</render_show_viewport_mask_bits>
<render_show_voxel_probe_visualizer>0</render_show_voxel_probe_visualizer>
<render_show_world_shadow_casters>0</render_show_world_shadow_casters>
<screenshot_extension>tga</screenshot_extension>
<show_fps>0</show_fps>
<show_profiler>0</show_profiler>
<show_profiler_charts>1</show_profiler_charts>
<show_profiler_generic>0</show_profiler_generic>
<show_profiler_memory>0</show_profiler_memory>
<show_profiler_physics>0</show_profiler_physics>
<show_profiler_render>1</show_profiler_render>
<show_profiler_thread>0</show_profiler_thread>
<show_profiler_world>0</show_profiler_world>
<show_visualizer>0</show_visualizer>
<visualizer_fix_flicker>1</visualizer_fix_flicker>
<world_handler_3d>0</world_handler_3d>
<world_handler_distance>500</world_handler_distance>
<world_show_handler/>
<world_show_spatial>0</world_show_spatial>
<world_show_visualizer/>
<console_bindings/>
</user>
The autosave attribute enables automatic saving of user configuration settings to the file on loading, closing, and saving the world, as well as on the Engine shutdown.使用autosave属性可以在加载,关闭和保存世界以及在引擎关闭时将用户配置设置自动保存到文件中。
The following console variables are defined in the user configuration file:在用户配置文件中定义了以下控制台变量:
To control the user configuration file, use functionality of the UserConfig class.要控制用户配置文件,请使用UserConfig类的功能。