How to make options like Change resolution, fullscreen, mouse sensitivity, and more?

So, that’s the question, I need that, and I don’t have any idea on how this works (in BGE.)

Change Resolution should be in trunk soon thanks to Moguri :slight_smile: It will be a python handle (bge.logic.setResolution or something like that).
Fullscreen probably the same, unless it has to enabled by default. Mouse sensitivity should be in your script for mouselook, and other things again use python.

WARNING: Python knowledge needed here

You can use configparser module to make a configuration file that will save settings into variables. Those can be sent to the game engine.

For the resolution thing… blenderplayer can be launched with parameters. In Windows just launch the Blenderplayer.exe to see what kind of parameters does it take. Then you can make a .bat file (or .sh file for Linux) to load your game with parameters you have saved into your configuration file. There are also settings like shading, debugging, 3D mode(stereoscopic rendering) etc.
________________________________________ ->
In my case, I use a launchere I wrote in C++(for Windows and Linux) that will find out your desktop resolution and passes it to the config file. Then it launches the .bat/.sh file with your desktop resolution. Launcher does it only if the game is ran for the first time.
All settings then can be set in the game via Options menu with checkboxes and options lists.

Note: you may also make the game launcher in BGE running in a window lets say 640X480 pixels… it will make the game bigger but it will get your work done faster if you dont have knowledge of C/C++ and SDL graphics library(or QT)

I’ve currently maded a Launcher for my game, with a button called Options, I planned to pick the options from the launcher and apply they as elevation… but I don’t know how… for example Run “Blender.exe” /fullscreen 1950x1680 or any similar thing.

It’s possible?

Yes. Using sys.argv.

Example: Your program is started with a bat file.
Bat file command:

 'blenderplayer.exe lang=en q=1'

To use ‘lang=en’ or ‘q=1’ in your game you can use sys.argv


import sys
print(sys.argv)

this will return a list containing [‘blenderplayer.exe’,‘lang=en’,‘q=1’]

Edit : You can look at this too :http://rpm.pbone.net/index.php3/stat/45/idpl/17276103/numer/1/nazwa/blenderplayer

Shouldn’t ‘blenderplayer.exe lang=en q=1’ be ‘blenderplayer.exe - lang=en q=1’? I think you need the dash in there so they are ignored by the player and passed on to Python. However, I haven’t used this feature, so I don’t have much experience with it.

Also, a lot of things can be changed at runtime (instead of with flags). For example:
window size/resolution: http://www.blender.org/documentation/blender_python_api_2_62_release/bge.render.html#bge.render.setWindowSize
material mode (singletexture, multitexture, GLSL mats): http://www.blender.org/documentation/blender_python_api_2_62_release/bge.render.html#bge.render.getMaterialMode
various GLSL settings (the settings found in the Shading panel under Render properties): http://www.blender.org/documentation/blender_python_api_2_62_release/bge.render.html#bge.render.setGLSLMaterialSetting
anisotropic filtering levels: http://www.blender.org/documentation/blender_python_api_2_62_release/bge.render.html#bge.render.setAnisotropicFiltering