Day 12: Learning Lua
January 17, 2010 by pekuja · Leave a Comment
I was going to take a little detour from the current project and make another game. Then as I started to copy parts of my other project to reuse in the new project, I noticed that some parts were such that I couldn’t directly reuse the code because the data was going to be different, so I started thinking of what I could do to make the code generic and just input data into it. This is something I was doing already in an earlier version of my project, but the config file format I was using wasn’t very flexible, so I gave it some thought, and decided on using Lua for my game data files. I want to add scripting capabilities anyhow, so this way I hit two birds with one stone. I also have some thoughts about making some editors for the data I’ll need, such as modifying parameters for animations. Optimally, I would have to do very little redundant boring work, and only focus on stuff that’s new for the project at hand.
Day 4: Config files
January 5, 2010 by pekuja · Leave a Comment
So, today, I wasted a whole bunch of time reconsidering my choice of using SFML. The joystick support is kinda iffy. So, after I did that, I decided it was a waste of time, so I’m still using SFML. I hope the joystick support gets fixed.
Anyways, back to actual coding business. Today I wrote a simple config file system. Basically, I load up a config file, and then I have access to settings by name. I also have a default value in the code, so that the game will still run if there’s no config file. I haven’t added config file saving yet, but I think that’s next. That way, I don’t ever have to manually write the config files, but I just write the default values into the code, and the code generates the config files, which I can then experiment and fiddle with. My goal is to have no data hardcoded into the source code, apart from the fallback default values.
Currently, I have no definite plan for tomorrow. A likely task is improving upon the components I have built so far. Or, you know, work on actual gameplay or levels.