Now config variables are read, with defaults substituted if no variable or no config at all. Instead fail in such cases. Then all major game parameters are only in the config file and no longer duplicated as defaults in the code. Modification needed only in once place.
The problem with this is that config file is mandatory, so the binary is no longer enough to play the game. Either is has to be started in the main game directory, or ~/.LambdaConfig has to be created (by the game at startup?) or something like /share/game/LambdaConfig has to be installed as a part of the package, but it'd only work for Unices and with root. Perhaps auto-creating ~/.LambdaConfig is the best solution, with the main game archive directory as a failsafe.
Also implement dumping config from a savegame as a text config file. Should be very easy. Essential for debugging savegames sent by players to see under what config they were played.
The problem with this is that config files are dynamically typed and in a quite simplistic type system.
An alternative is to have a Haskell file containing all defaults, typed properly, and generate a config file from that, if none is found in the expected locations. Then dumping such defaults gives a default config file for comparison with user-modified one, e.g., to spot misspelled options.
I still think having it all in one place is a good idea. Part of the config options will be game rules, which are best balanced together. Part will be relatively unimportant UI, etc., options. The largest part will be monster, tile, room, object definitions, which will refer to each other and which will be automatically play-balanced, taking them all into account in the balancing computations. After balancing they will be dumped as Haskell (difficult) or config (trivial) files.
add a command to dump current configuration; closed by 208fc62
Also rewritten the default config file to make diffing with dumps easier.