Difference between revisions of "Ini File"
m |
|||
Line 1: | Line 1: | ||
− | + | Visionaire offers a comfortable way to predefine the settings of the started game via a '''config.ini''' file. The .ini file and the player have to be in the same directory. When building (compiling) your game, a basic '''config.ini''' file is automatically added to your export folder. | |
− | Visionaire offers a | ||
− | + | The parameter names and values are case in-sensitive – except for the file name (FILE parameter). The order of the parameters is unimportant and does not have any effect. | |
− | + | For a more dynamic method that utilizes Lua script to read & write custom settings from & to the '''config.ini''' file, please see [[Read/Write_Config.ini_(CMS)|this custom script]]. | |
− | |||
− | + | ||
− | <syntaxhighlight> | + | == Parameters of the config.ini file == |
+ | |||
+ | === Basic parameters === | ||
+ | |||
+ | <syntaxhighlight lang="ini"> | ||
+ | FILE = {game.ved} | ||
+ | </syntaxhighlight> | ||
+ | This parameter allows you to pass over the file, which is to be loaded automatically when starting the player. The file name has to be either specified here in the .ini file or via [[#Command line parameters|command line parameter]] (this is done automatically when the game is started from the editor). The file ending is of no importance, as long as it is valid Visionaire game/project file. Note that the file name is case sensitive. | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="ini"> | ||
FULLSCREEN = {yes|no} | FULLSCREEN = {yes|no} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | *yes | + | *'''yes''': Start the game in fullscreen. |
− | *no | + | *'''no''': Start the game in a window. |
− | <syntaxhighlight> | + | |
− | + | ||
+ | <syntaxhighlight lang="ini"> | ||
+ | RESOLUTION = {Auto|Desktop|Game|Custom} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * | + | This option allows activation of support for wide-screen displays. |
− | * no | + | |
− | <syntaxhighlight> | + | * '''Game''': The game is initialized with the resolution specified in the game. This could lead to problems in full screen mode if e. g. the game has a resolution of 1024x768 and is shown on a wide-screen monitor (it depends on the display or graphics card driver how the image is stretched and if the aspect ratio is kept). Then the whole scene is shown in a different aspect ratio and everything is stretched. |
− | + | * '''Desktop''': The current desktop resolution is used when the game is started in full screen mode. The scene is only stretched as much as possible so that the correct aspect ratio of the game is kept. The remaining space is filled with black bars. | |
+ | * '''Auto''': Wide-screen support (i. e. as with '''Desktop''' option) is activated if a wide-screen display is detected. | ||
+ | * '''Custom''': Should only be defined if '''FULLSCREEN = no'''. i. e: '''RESOLUTION = 640x480'''. | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="ini"> | ||
+ | INTRO = {yes|no} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | * '''yes''': Show the intro movie on start-up. | |
− | <syntaxhighlight> | + | * '''no''': Don't show the intro movie. |
+ | |||
+ | |||
+ | If the game file does not have an intro movie, this parameter can be ignored. | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="ini"> | ||
LANGUAGE = {German|English...} | LANGUAGE = {German|English...} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Choose in which language the game is to be started. Type in the exact name of the language as configured in the editor. | Choose in which language the game is to be started. Type in the exact name of the language as configured in the editor. | ||
− | + | ||
− | <syntaxhighlight> | + | <syntaxhighlight lang="ini"> |
− | + | LOGLEVEL = {Info|Warning|Error} | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Sets the log level for log messages written to the '''messages.log''' file. | |
− | + | * '''Error''': Only error messages are written to the log file. | |
− | + | * '''Warning''': Error and warning messages are written to the log file. | |
− | + | * '''Info''': Everything is written to the log file. | |
− | + | ||
− | <syntaxhighlight> | + | |
− | + | === Advanced parameters === | |
+ | |||
+ | <syntaxhighlight lang="ini"> | ||
+ | MUSICVOLUME = {0 to 100} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Sets the | + | Sets the music volume to the given value. |
− | + | ||
− | <syntaxhighlight> | + | <syntaxhighlight lang="ini"> |
− | + | SOUNDVOLUME = {0 to 100} | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Sets the sound volume to the given value. | |
− | <syntaxhighlight> | + | |
− | + | ||
+ | <syntaxhighlight lang="ini"> | ||
+ | SPEECHVOLUME = {0 to 100} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Sets the speech volume to the given value. | |
− | <syntaxhighlight> | + | |
− | + | ||
+ | <syntaxhighlight lang="ini"> | ||
+ | MOVIEVOLUME = {0 to 100} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Sets the movie volume to the given value. | |
− | <syntaxhighlight> | + | |
− | + | ||
+ | <syntaxhighlight lang="ini"> | ||
+ | GLOBALVOLUME = {0 to 100} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Sets the global volume to the given value. | |
− | <syntaxhighlight> | + | |
− | + | ||
+ | <syntaxhighlight lang="ini"> | ||
+ | USETEXTUREFORWIDESCREEN = {yes|no} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * | + | *'''yes''': Use framebuffer with texture. ''(default)'' |
− | <syntaxhighlight> | + | *'''no''': Use framebuffer without texture. |
− | + | ||
+ | |||
+ | <syntaxhighlight lang="ini"> | ||
+ | BRIGHTNESS = {0|100|200} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * | + | Sets the brightness of the game |
− | * | + | |
− | <syntaxhighlight> | + | *'''0''': completely black |
− | + | *'''100''': normal ''(default)'' | |
+ | * up to 200 which was completely | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="ini"> | ||
+ | RESIZEABLE = {yes|no} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * | + | *'''no''': Window is not resizable. ''(default)'' |
− | + | *'''yes''': Window is resizeable. | |
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | *yes | ||
− | == | + | == config.ini examples == |
− | <syntaxhighlight> | + | <syntaxhighlight lang="ini"> |
FULLSCREEN = no | FULLSCREEN = no | ||
INTRO = no | INTRO = no | ||
LOGLEVEL = Error | LOGLEVEL = Error | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Since no file name was entered, the filename must be specified as a command line parameter. The settings are set to windowed mode and "no intro". Only errors are written to the log file messages.log. | |
+ | |||
− | + | <syntaxhighlight lang="ini"> | |
− | <syntaxhighlight> | ||
FULLSCREEN = yes | FULLSCREEN = yes | ||
INTRO = yes | INTRO = yes | ||
Line 95: | Line 131: | ||
LOGLEVEL = Info | LOGLEVEL = Info | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | When starting the player, the game demo.vis in the sub directory demo is started. The game is shown in full screen mode, game language is English and the intro will be shown. All log messages are written to the '''messages.log''' log file. | |
− | + | ||
− | <syntaxhighlight> | + | <syntaxhighlight lang="ini"> |
FILE = data.vis | FILE = data.vis | ||
FULLSCREEN = no | FULLSCREEN = no | ||
RESIZEABLE = yes | RESIZEABLE = yes | ||
RESOLUTION = 640x480 | RESOLUTION = 640x480 | ||
− | LOGLEVEL = | + | LOGLEVEL = Info |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Window mode. Window can be resized manually. Initial screen size / resolution will be set as 640x480px. All log messages will be written to the '''messages.log''' log file. | |
+ | |||
== Command line parameters == | == Command line parameters == | ||
− | Furthermore, there is the option of adding parameters to the visplayer.exe or the created <game>.exe. This can be done either when the game is started directly on the command line, but also from within a Windows shortcut. Parameters from the config.ini file are overwritten with command line parameters. | + | Furthermore, there is the option of adding parameters to the '''visplayer.exe''' or the created '''<game>.exe'''. This can be done either when the game is started directly on the command line, but also from within a Windows shortcut. Parameters from the '''config.ini''' file are overwritten with command line parameters. |
The parameters are (order is not important): | The parameters are (order is not important): | ||
− | * '''-w|--window''' The game is started in windowed mode (if not specified the game is started in full screen mode). | + | * '''-w|--window''': The game is started in windowed mode (if not specified the game is started in full screen mode). |
− | * '''-ns|--nosounds''' Deactivates sound output. | + | * '''-ns|--nosounds''': Deactivates sound output. |
− | * '''-nv|--novideos''' Deactivates all videos. | + | * '''-nv|--novideos''': Deactivates all videos. |
− | + | * '''-r|--resolution=auto|desktop|game''': See the RESOLUTION parameter for an explanation. | |
− | + | * '''-ll|--loglevel=info|warning|error''': See the LOGLEVEL parameter for an explanation. | |
− | * '''-r|--resolution=auto|desktop|game''' | + | * '''<ved/vis file>''': The last parameter can determine the filename of the game. |
− | * '''-ll|--loglevel=info|warning|error''' | + | |
Examples: | Examples: | ||
− | + | ||
− | visplayer.exe -f -ll=warning demogame.ved | + | visplayer.exe -f -ll=warning demogame.ved |
− | demogame.exe -w --resolution=auto | + | demogame.exe -w --resolution=auto |
− | + | ||
+ | |||
+ | {{toc}} |
Revision as of 15:33, 9 January 2023
Visionaire offers a comfortable way to predefine the settings of the started game via a config.ini file. The .ini file and the player have to be in the same directory. When building (compiling) your game, a basic config.ini file is automatically added to your export folder.
The parameter names and values are case in-sensitive – except for the file name (FILE parameter). The order of the parameters is unimportant and does not have any effect.
For a more dynamic method that utilizes Lua script to read & write custom settings from & to the config.ini file, please see this custom script.
Parameters of the config.ini file
Basic parameters
FILE = {game.ved}
This parameter allows you to pass over the file, which is to be loaded automatically when starting the player. The file name has to be either specified here in the .ini file or via command line parameter (this is done automatically when the game is started from the editor). The file ending is of no importance, as long as it is valid Visionaire game/project file. Note that the file name is case sensitive.
FULLSCREEN = {yes|no}
- yes: Start the game in fullscreen.
- no: Start the game in a window.
RESOLUTION = {Auto|Desktop|Game|Custom}
This option allows activation of support for wide-screen displays.
- Game: The game is initialized with the resolution specified in the game. This could lead to problems in full screen mode if e. g. the game has a resolution of 1024x768 and is shown on a wide-screen monitor (it depends on the display or graphics card driver how the image is stretched and if the aspect ratio is kept). Then the whole scene is shown in a different aspect ratio and everything is stretched.
- Desktop: The current desktop resolution is used when the game is started in full screen mode. The scene is only stretched as much as possible so that the correct aspect ratio of the game is kept. The remaining space is filled with black bars.
- Auto: Wide-screen support (i. e. as with Desktop option) is activated if a wide-screen display is detected.
- Custom: Should only be defined if FULLSCREEN = no. i. e: RESOLUTION = 640x480.
INTRO = {yes|no}
- yes: Show the intro movie on start-up.
- no: Don't show the intro movie.
If the game file does not have an intro movie, this parameter can be ignored.
LANGUAGE = {German|English...}
Choose in which language the game is to be started. Type in the exact name of the language as configured in the editor.
LOGLEVEL = {Info|Warning|Error}
Sets the log level for log messages written to the messages.log file.
- Error: Only error messages are written to the log file.
- Warning: Error and warning messages are written to the log file.
- Info: Everything is written to the log file.
Advanced parameters
MUSICVOLUME = {0 to 100}
Sets the music volume to the given value.
SOUNDVOLUME = {0 to 100}
Sets the sound volume to the given value.
SPEECHVOLUME = {0 to 100}
Sets the speech volume to the given value.
MOVIEVOLUME = {0 to 100}
Sets the movie volume to the given value.
GLOBALVOLUME = {0 to 100}
Sets the global volume to the given value.
USETEXTUREFORWIDESCREEN = {yes|no}
- yes: Use framebuffer with texture. (default)
- no: Use framebuffer without texture.
BRIGHTNESS = {0|100|200}
Sets the brightness of the game
- 0: completely black
- 100: normal (default)
- up to 200 which was completely
RESIZEABLE = {yes|no}
- no: Window is not resizable. (default)
- yes: Window is resizeable.
config.ini examples
FULLSCREEN = no
INTRO = no
LOGLEVEL = Error
Since no file name was entered, the filename must be specified as a command line parameter. The settings are set to windowed mode and "no intro". Only errors are written to the log file messages.log.
FULLSCREEN = yes
INTRO = yes
FILE = demo/demo.vis
LANGUAGE = English
LOGLEVEL = Info
When starting the player, the game demo.vis in the sub directory demo is started. The game is shown in full screen mode, game language is English and the intro will be shown. All log messages are written to the messages.log log file.
FILE = data.vis
FULLSCREEN = no
RESIZEABLE = yes
RESOLUTION = 640x480
LOGLEVEL = Info
Window mode. Window can be resized manually. Initial screen size / resolution will be set as 640x480px. All log messages will be written to the messages.log log file.
Command line parameters
Furthermore, there is the option of adding parameters to the visplayer.exe or the created <game>.exe. This can be done either when the game is started directly on the command line, but also from within a Windows shortcut. Parameters from the config.ini file are overwritten with command line parameters.
The parameters are (order is not important):
- -w|--window: The game is started in windowed mode (if not specified the game is started in full screen mode).
- -ns|--nosounds: Deactivates sound output.
- -nv|--novideos: Deactivates all videos.
- -r|--resolution=auto|desktop|game: See the RESOLUTION parameter for an explanation.
- -ll|--loglevel=info|warning|error: See the LOGLEVEL parameter for an explanation.
- <ved/vis file>: The last parameter can determine the filename of the game.
Examples:
visplayer.exe -f -ll=warning demogame.ved demogame.exe -w --resolution=auto