Difference between revisions of "Ini File"

From The Official Visionaire Studio: Adventure Game Engine Wiki
m
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 a '''config.ini''' file. 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)|here]].
 
  
== General ==
+
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''':
+
 
<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 - starts the game in fullscreen
+
*'''yes''': Start the game in fullscreen.
*no - starts the game in a window
+
*'''no''': Start the game in a window.
<syntaxhighlight>
+
 
INTRO = {yes|no} -- If the game file does not have an intro movie, this parameter can be ignored.
+
 
 +
<syntaxhighlight lang="ini">
 +
RESOLUTION = {Auto|Desktop|Game|Custom}
 
</syntaxhighlight>
 
</syntaxhighlight>
* yes - Show the intro movie on start-up.
+
This option allows activation of support for wide-screen displays.
* no - Don't show the intro movie.
+
 
<syntaxhighlight>
+
* '''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.
FILE = {game.ved}
+
* '''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>
 
</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 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.
+
* '''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.
  
===New options with Visionaire 3.3===
+
 
<syntaxhighlight>
+
<syntaxhighlight lang="ini">
RESOLUTION = Auto|Desktop|Game|Custom
+
LOGLEVEL = {Info|Warning|Error}
 
</syntaxhighlight>
 
</syntaxhighlight>
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.
+
Sets the log level for log messages written to the '''messages.log''' file.
{| class="ts"
+
* '''Error''': Only error messages are written to the log file.
|-
+
* '''Warning''': Error and warning messages are written to the log file.
| ''A Custom resolution should only be defined if '''fullscreen = no'''. i.e: '''resolution = 640x480'''.''
+
* '''Info''': Everything is written to the log file.
|}
+
 
<syntaxhighlight>
+
 
LOGLEVEL = Info|Warning|Error
+
=== Advanced parameters ===
 +
 
 +
<syntaxhighlight lang="ini">
 +
MUSICVOLUME = {0 to 100}
 
</syntaxhighlight>
 
</syntaxhighlight>
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.
+
Sets the music volume to the given value.
  
===New options with Visionaire 4.0===
+
 
<syntaxhighlight>
+
<syntaxhighlight lang="ini">
MUSICVOLUME = 0 to 100
+
SOUNDVOLUME = {0 to 100}
 
</syntaxhighlight>
 
</syntaxhighlight>
*sets the music volume to the given value
+
Sets the sound volume to the given value.
<syntaxhighlight>
+
 
SOUNDVOLUME = 0 to 100
+
 
 +
<syntaxhighlight lang="ini">
 +
SPEECHVOLUME = {0 to 100}
 
</syntaxhighlight>
 
</syntaxhighlight>
*sets the sound volume to the given value
+
Sets the speech volume to the given value.
<syntaxhighlight>
+
 
SPEECHVOLUME = 0 to 100
+
 
 +
<syntaxhighlight lang="ini">
 +
MOVIEVOLUME = {0 to 100}
 
</syntaxhighlight>
 
</syntaxhighlight>
*sets the speech volume to the given value
+
Sets the movie volume to the given value.
<syntaxhighlight>
+
 
MOVIEVOLUME = 0 to 100
+
 
 +
<syntaxhighlight lang="ini">
 +
GLOBALVOLUME = {0 to 100}
 
</syntaxhighlight>
 
</syntaxhighlight>
*sets the movie volume to the given value
+
Sets the global volume to the given value.
<syntaxhighlight>
+
 
GLOBALVOLUME = 0 to 100
+
 
 +
<syntaxhighlight lang="ini">
 +
USETEXTUREFORWIDESCREEN = {yes|no}
 
</syntaxhighlight>
 
</syntaxhighlight>
*sets the global volume to the given value
+
*'''yes''': Use framebuffer with texture. ''(default)''
<syntaxhighlight>
+
*'''no''': Use framebuffer without texture.
USETEXTUREFORWIDESCREEN = {Yes|No}
+
 
 +
 
 +
<syntaxhighlight lang="ini">
 +
BRIGHTNESS = {0|100|200}
 
</syntaxhighlight>
 
</syntaxhighlight>
*yes - DEFAULT - using framebuffer with texture
+
Sets the brightness of the game
*no - using framebuffer without texture
+
 
<syntaxhighlight>
+
*'''0''': completely black
BRIGHTNESS = 0|100|200
+
*'''100''': normal ''(default)''
 +
* up to 200 which was completely
 +
 
 +
 
 +
<syntaxhighlight lang="ini">
 +
RESIZEABLE = {yes|no}
 
</syntaxhighlight>
 
</syntaxhighlight>
*0 completely black
+
*'''no''': Window is not resizable. ''(default)''
*100 DEFAULT and normal
+
*'''yes''': Window is resizeable.
*up to 200 which was completely
+
 
<syntaxhighlight>
 
RESIZEABLE = YES|NO
 
</syntaxhighlight>
 
*no - DEFAULT - window is not resizable
 
*yes - window is resizeable
 
  
==Example 1==
+
== 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.''
+
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.
 +
 
  
==Example 2==
+
<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 log file messages.log.''
+
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.
  
== Example 3 ==
+
 
<syntaxhighlight>
+
<syntaxhighlight lang="ini">
 
FILE = data.vis
 
FILE = data.vis
 
FULLSCREEN = no
 
FULLSCREEN = no
 
RESIZEABLE = yes
 
RESIZEABLE = yes
 
RESOLUTION = 640x480
 
RESOLUTION = 640x480
LOGLEVEL = info
+
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.''
+
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:
<syntaxhighlight>
+
 
visplayer.exe -f -ll=warning demogame.ved
+
visplayer.exe -f -ll=warning demogame.ved
demogame.exe -w --resolution=auto
+
demogame.exe -w --resolution=auto
</syntaxhighlight>{{toc}}
+
 
 +
 
 +
{{toc}}

Revision as of 16: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