Difference between revisions of "Ini File"

From The Official Visionaire Studio: Adventure Game Engine Wiki
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Description ==
+
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 very comfortable way to predefine the settings of the started game via an .ini-file.
 
  
===Generally===
+
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.
  
The .ini-file and the player have to be in the same directory. The filename of the .ini-file has to be 'config.ini'.
+
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]].
The parameter names and values are case in-sensitive. Except the file name which is case sensitive. The order of the parameters is unimportant and does not have any effect.
 
  
'''Parameters of the config.ini-file''':
 
  
FULLSCREEN = {yes|no}
+
== Parameters of the config.ini file ==
  
*yes - starts the game in fullscreen
+
=== Basic parameters ===
*no - starts the game in a window
 
  
INTRO = {yes|no}
+
<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}
 +
</syntaxhighlight>
 +
*'''yes''': Start the game in fullscreen.
 +
*'''no''': Start the game in a window.
 +
 
 +
 
 +
<syntaxhighlight lang="ini">
 +
RESOLUTION = {Auto|Desktop|Game|Custom}
 +
</syntaxhighlight>
 +
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.&nbsp;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.&nbsp;e. as with '''Desktop''' option) is activated if a wide-screen display is detected.
 +
* '''Custom''': Should only be defined if '''FULLSCREEN = no'''. i.&nbsp;e: '''RESOLUTION = 640x480'''.
 +
 
 +
 
 +
<syntaxhighlight lang="ini">
 +
INTRO = {yes|no}
 +
</syntaxhighlight>
 +
* '''yes''': Show the intro movie on start-up.
 +
* '''no''': Don't show the intro movie.
  
* 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.
 
If the game file does not have an intro movie, this parameter can be ignored.
  
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.
+
<syntaxhighlight lang="ini">
 +
LANGUAGE = {German|English...}
 +
</syntaxhighlight>
 +
Choose in which language the game is to be started. Type in the exact name of the language as configured in the editor.
  
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.
+
<syntaxhighlight lang="ini">
 +
LOGLEVEL = {Info|Warning|Error}
 +
</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.
  
===New options with Visionaire 3.3===
 
RESOLUTION = Auto|Desktop|Game
 
  
This option allows activation of support for wide-screen displays. If '''Game''' option is used then 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. In case the option '''Desktop''' is used 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. In case  the option '''Auto''' is used (default) wide-screen support (i.e. as with '''Desktop''' option) is activated if a wide-screen display is detected.
+
=== Advanced parameters ===
  
LOGLEVEL = Info|Warning|Error
+
<syntaxhighlight lang="ini">
 +
MUSICVOLUME = {0 to 100}
 +
</syntaxhighlight>
 +
Sets the music volume to the given value.
  
Sets the log level for log messages. With '''Error''' option only error messages are written to the log file. With '''Warning''' option error and warning messages are written to  the log file. With '''Info''' everything is written to the log file.
 
  
===New options with Visionaire 4.0===
+
<syntaxhighlight lang="ini">
 +
SOUNDVOLUME = {0 to 100}
 +
</syntaxhighlight>
 +
Sets the sound volume to the given value.
  
MUSICVOLUME = 0 to 100
 
  
*sets the music volume to the given value
+
<syntaxhighlight lang="ini">
 +
SPEECHVOLUME = {0 to 100}
 +
</syntaxhighlight>
 +
Sets the speech volume to the given value.
  
SOUNDVOLUME = 0 to 100
 
  
*sets the sound volume to the given value
+
<syntaxhighlight lang="ini">
 +
MOVIEVOLUME = {0 to 100}
 +
</syntaxhighlight>
 +
Sets the movie volume to the given value.
  
SPEECHVOLUME = 0 to 100
 
  
*sets the speech volume to the given value
+
<syntaxhighlight lang="ini">
 +
GLOBALVOLUME = {0 to 100}
 +
</syntaxhighlight>
 +
Sets the global volume to the given value.
  
MOVIEVOLUME = 0 to 100
 
  
*sets the movie volume to the given value
+
<syntaxhighlight lang="ini">
 +
USETEXTUREFORWIDESCREEN = {yes|no}
 +
</syntaxhighlight>
 +
*'''yes''': Use framebuffer with texture. ''(default)''
 +
*'''no''': Use framebuffer without texture.
  
GLOBALVOLUME = 0 to 100
 
  
*sets the global volume to the given value
+
<!--<syntaxhighlight lang="ini">
 +
BRIGHTNESS = {0|100|200}
 +
</syntaxhighlight>
 +
Sets the brightness of the game
  
USETEXTUREFORWIDESCREEN = {Yes|No}
+
*'''0''': completely black
 +
*'''100''': normal ''(default)''
 +
* up to 200 which was completely
  
*yes - DEFAULT - using framebuffer with texture
+
-->
*no - using framebuffer without texture
+
<syntaxhighlight lang="ini">
 +
RESIZEABLE = {yes|no}
 +
</syntaxhighlight>
 +
*'''no''': Window is not resizable. ''(default)''
 +
*'''yes''': Window is resizeable.
  
BRIGHTNESS = 0|100|200
 
  
*0 completely black
+
<syntaxhighlight lang="ini">
*100 DEFAULT and normal
+
LOCKCURSOR = {disabled|enabled}
*up to 200 which was completely
+
</syntaxhighlight>
 +
*'''disabled''': The cursor can be moved out of the game (window) and onto the OS desktop. ''(default)''
 +
*'''enabled''': The cursor gets locked inside the game (window).
  
==1st Example==
 
FULLSCREEN = no
 
INTRO = no
 
LOGLEVEL = Error
 
  
 +
== config.ini examples ==
 +
<syntaxhighlight lang="ini">
 +
FULLSCREEN = no
 +
INTRO = no
 +
LOGLEVEL = Error
 +
</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.
 
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.
  
==2nd Example==
 
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 log file messages.log.
+
<syntaxhighlight lang="ini">
 +
FULLSCREEN = yes
 +
INTRO = yes
 +
FILE = demo/demo.vis
 +
LANGUAGE = English
 +
LOGLEVEL = Info
 +
</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 lang="ini">
 +
FILE = data.vis
 +
FULLSCREEN = no
 +
RESIZEABLE = yes
 +
RESOLUTION = 640x480
 +
LOGLEVEL = Info
 +
</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.
* '''<ved/vis file>''' The last parameter can determine the filename of the game.
+
* '''-r|--resolution=auto|desktop|game''': See the RESOLUTION parameter for an explanation.
New with Visionaire 3.3:
+
* '''-ll|--loglevel=info|warning|error''': See the LOGLEVEL parameter for an explanation.
* '''-r|--resolution=auto|desktop|game''' This option allows activation of support for wide-screen displays. If '''game''' option is used then 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. In case the option '''desktop''' is used 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. In case the option '''auto''' is used (default) wide-screen support (i.e. as with '''desktop''' option) is activated if a wide screen display is detected.
+
* '''<ved/vis file>''': The last parameter can determine the filename of the game.
* '''-ll|--loglevel=info|warning|error''' Sets the log level for log messages. With '''error''' option only error messages are written to the log file. With '''warning''' option error and warning messages are written to the log file. With '''info''' everything is written to the log file.
+
 
  
 
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}}

Latest revision as of 19:23, 26 April 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.


RESIZEABLE = {yes|no}
  • no: Window is not resizable. (default)
  • yes: Window is resizeable.


LOCKCURSOR = {disabled|enabled}
  • disabled: The cursor can be moved out of the game (window) and onto the OS desktop. (default)
  • enabled: The cursor gets locked inside the game (window).


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