Separating User Settings out of vegastrike.config

For collaboration on developing the mod capabilities of VS; request new features, report bugs, or suggest improvements

Moderator: Mod Contributor

Post Reply
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Separating User Settings out of vegastrike.config

Post by chuck_starchaser »

The problem:

Currently, when the user runs setup.exe, customizations such screen resolution and sound preferences are stored into vegastrike.config.
But mod-related settings are also stored into vegastrike.config.
This creates a problem with svn updates: Every time mod developers change some mod-related parameters into vegastrike.config, users get a conflicted file in svn. To get the mod-related settings they have to delete the file and then svn-update, which wipes out their personal settings, forcing them to run setup.exe again.


Proposed Solution:

Have a "user_settings.config" file, where user settings are stored separately from mod-related settings.


EDIT:
Possible snafu: Backward compatibility...
One way to solve it could be to put one more parameter in vegastrike.config having the path to the new user_settings.config file.
If the parameter isn't there, it means that the user settings are still contained in vegastrike.config.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

This problem has been around for a long time...

The way settings are done in the game, this is not very easy to change.

The configuration system ought to be rebuilt so that it does not rely on XML comments... maybe even something simple like transforming:

Currently it works like this:

Code: Select all

<!--
#groups resolution ...
#category resolution 32bit_full 32bit_win 16bit_full 16bit_win
...
#set resolution 32bit_full
...
#desc 32bit_full 32 Bit Color, Fullscren
#desc 16bit_full 16 Bit Color, Fullscreen
...
#endheader
-->
<vegaconfig>
...
<!-- #32bit_full 16bit_full -->
<var name="fullscreen" value="true" />
<!-- #end -->
<!-- #32bit_win 16bit_win -->
<var name="fullscreen" value="false" />
<!-- #end -->
...
We might be able to transform it into pure XML so that the settings make sense to an XML parser.

Code: Select all

<vegaconfig>
<groups>
  <group name="resolution">
    <option name="32bit_full" desc="32 Bit Color, Fullscreen" />
    <option name="16bit_full" desc="16 Bit Color, Fullscreen" />
  </group>
</groups>
...
<if name="resolution" value="32bit_full 16bit_full">
  <var name="fullscreen" value="true" />
</if>
<if name="resolution" value="16bit_win 32bit_win">
  <var name="fullscreen" value="false" />
</if>
...
Such logic might not be so hard... Then it should also be relatively easy to have another XML file like this:

Code: Select all

<settings>
  <var name="resolution" value="32bit_full" />
</settings>
Then, we could do something where Vegastrike and VSSetup will be allowed to write to settings.config, and vegastrike.config won't be touched by anything.

Still someone needs to write the new version of vssetup... shouldn't be all that hard, but it will need to include a XML parser. They will also need to be able to write settings.

Also, storing defaults might be a bit painful...
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Sorry I can't help with this; totally out of my league.
I know roughly what a parser is, but never worked with them.
thawn
Explorer
Explorer
Posts: 9
Joined: Sat Feb 23, 2008 5:10 pm

I totally agree!!!

Post by thawn »

I totally agree!

The user settings should be saved in the user directory ( ~/.vegastrike/ under Linux) in fact that kind of works already except that I had the impression that the game gets unstable when I have a ~./.vegastrike/vegastrike.config file.
that way I could upgrade/delete/recompile/move the game without loosing the settings.

In fact couldn't the config parser first parse the default config file and then the user config file overwriting the default settings with the user settings?
Post Reply