INI Based Settings in C#/XNA

One of my first issues to handle in this, the second phase of development for hades, has been how to store settings. Of course I could have gone an XML approach, but it is not at all what people are accustomed to – we like ini files. Section, Key = Value… NEXT! Well, while the horn may have sounded in terms of figuring this out, putting things into action is a bit more involved, but not too much so.

For those of you who have worked with Unreal or looked at the configuration files for most any linux application you likely found something similar to the following:

[Engine.GameInfo]
DefaultGame=Fulcrum.FulcrumGame
DefaultServerGame=Fulcrum.FulcrumGame
bAdminCanPause=false
MaxPlayers=32
GameDifficulty=+1.0
bChangeLevels=True

This example shows off all of the typical features of an INI file based approach for storing settings, and I am fully intending to use it in Hades, but how do we start? We have to establish a couple of requirements to paint the picture fully…

Continue reading “INI Based Settings in C#/XNA”