Opened 11 years ago
Last modified 3 years ago
#1810 new enhancement
Improve configuration system
Reported by: | historic_bruno | Owned by: | leper |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | Dunedan | Patch: |
Description (last modified by )
- Unify command line options, config files, overrides, and console/GUI
- Organize config files, possibly like INI files
- Support overriding user config, preventing other based on system capabilities, etc. - important for graphics config
- Allow e.g. hotkey sets
- Create decent API for scripts to access and modify config
- Some settings might take precedence over others, e.g. high/medium/low graphics settings vs. shadow map detail, filtering, etc.
- Better detection of GPU/driver capability, see also #145
- Support mod config files
- Examples: a mod that overrides default camera settings, or a mod that defines its own completely new settings
See IRC discussion on 2013-01-03 around 17:41. Some thoughts from Philip here.
Change History (13)
comment:1 by , 11 years ago
follow-up: 5 comment:2 by , 11 years ago
Yes, that's a good idea too. Would it be enough to display the contents of readme.txt or similar? Or should it be integrated with the config system itself?
We could have a data file or script that defines all the possible options and descriptions, then we'd never have to worry about maintaining a separate list. As a bonus, it would also allow us to reject invalid options. We'd have to consider the impact on modding (what if a mod needs to add new options?) and development (what if you want to play with a new option while the game is running, via hotloading).
comment:3 by , 11 years ago
I guess the integrated approach would give us something like what fabio suggested here without cluttering up the actual config files.
comment:4 by , 11 years ago
I guess the "schema" could be defined in XML, while the actual config files could be .ini or something equally simple.
comment:5 by , 11 years ago
Replying to historic_bruno:
Yes, that's a good idea too. Would it be enough to display the contents of readme.txt or similar? Or should it be integrated with the config system itself? We could have a data file or script that defines all the possible options and descriptions, then we'd never have to worry about maintaining a separate list. As a bonus, it would also allow us to reject invalid options. We'd have to consider the impact on modding (what if a mod needs to add new options?) and development (what if you want to play with a new option while the game is running, via hotloading).
I like the contents of readme.txt because it explains the commandline options. If someone wants help on all of the available configuration options in the config files then there can me another method (for instance in linux you would use the man pages or info pages for details but the --help option just shows overviews like your readme file). Whatever is done the help should only be kept in one place (preferably the act of adding a command line option would force the person to add the help information. Using a library like Boost.Program_options might be useful instead of custom string parsing. It allows you to specify the description and helps in handling the help option.
comment:6 by , 11 years ago
A man page should eventually be provided since it's usually required by some linux distributions. Debian man pages (0ad and pyrogenesis, the latter being a link to the former) are available here: http://anonscm.debian.org/viewvc/pkg-games/packages/trunk/0ad/debian/
Having the man page generated by the same process by WFG itself would be nice, so it will available to all Linux distributions and can be keep updated from a single place.
comment:12 by , 3 years ago
Description: | modified (diff) |
---|
I'd also appreciate a command line option to specify the location of the config file. That'd make some testing with multiple configs much easier.
comment:13 by , 3 years ago
Cc: | added |
---|
I would also like to have a --help command line option which would print out info about command line options and then exits. This is the convention most programs use (at least on linux).