Monday, 25 February 2013

INI parser

So, we need to add configuration file into our game. Every configuration of the game: total number of monsters, window size, player position, monsters' name, and so on must be read from this configuration file. In other words, if one wants to tweak those number, all one need to do is tweak the configuration file.

Indeed there are a lot of free configuration parser or INI file parser available on internet. One that Joe suggested us to use is libconfig. I wasn't planning to use it. I was planning to use libConfuse. This site summarize the popular config/INI file parser available: http://arxiv.org/pdf/1103.3021.pdf.

The document gave me one of the reason I didn't want to use libconfig. Besides, I saw this comment on internet about libconfig: libconfig doesn't have strict set of options. One other reason was I want to use different library than the others just for comparison. But... sadly I have to drop my persistence using libConfuse. I couldn't make my GameEngine recognize the libConfuse. I indeed built libConfuse as static library like my GameEngine. Still, I got the link error :(

In the end, as guessed, I was using libconfig. Maybe using libconfig wasn't a bad idea at all. It was the same as what Joe's using. Furthermore, since it was the same as his, shall we need to add more configuration in this file, there shouldn't be any restriction by the third library.

No comments:

Post a Comment