Afternoon!
I've been writing a first person platformer recently using LWJGL (OpenGL) and Java, and I've hit a slight snag.
My current approach to all configurable game aspects is to have a static class with a load of variables inside, which can be accessed anywhere in the game using this syntax "constants.MAP_DEPTH" (or whatever).
This is fine, as it can be accessed globally with no speed loss or the jiggery pokery of having to pass a "config" object around all the time. But I've recently come to the conclusion that it'd be nice to have all of the configuration in an external file to promote modding/make life easier when I'm making small changes to the game (rather than recompiling>running constantly..)
How are config files usually approached in game development?
I considered having a static class with a static method which can read the config file and return the contents, but this would mean lots and lots of file reading in the game loop and it's just not really appropriate.
I'm sorry if this is a simple question, but I'm up to about 17 classes now and I'm a wee bit stumped!
Hope you can help.
Ollie.
P.S let me know if I've not worded something too well and I'll try and elaborate somewhat!
lolliver0342
Member Since 17 Dec 2008Offline Last Active Dec 02 2011 09:45 AM

Find content
Not Telling