Best practice to manage game config options
Posted: Thu Nov 20, 2014 10:05 pm
As I've read on [wiki]Config_Files[/wiki] wiki page that I can define all game settings inside conf.lua file.
If I'm not wrong, all the config i set in conf.lua doesn't affect directly the game, because config is loaded before main.lua starts, so I suppose, the config set before is visibile to the rest of the game code, or I didn't got how config should be used.
If I'm true, how can I read the config i defined in conf.lua into main.lua?
Let's suppose I've prepared in config.lua some data like fullscreen width and height taken from my machine, should I store the data inside some text/json file and then load it into main.lua?
Which is a best practice?
If I'm not wrong, all the config i set in conf.lua doesn't affect directly the game, because config is loaded before main.lua starts, so I suppose, the config set before is visibile to the rest of the game code, or I didn't got how config should be used.
If I'm true, how can I read the config i defined in conf.lua into main.lua?
Let's suppose I've prepared in config.lua some data like fullscreen width and height taken from my machine, should I store the data inside some text/json file and then load it into main.lua?
Which is a best practice?