Coding under the hood

And another post without screenshots. That’s because I’ve mainly done stuff under the hood, so there isn’t really much to show with a screenshot this time.

First I implemented save games. You may think that it’s not the best idea to implement such a feature at this early stage, but for this type of game it’s really necessary. To make it concrete I’ll use army feature of the game as an example : If I want to test this part of the game I would have to open up the army management dialogue, create a new army, assign it to a region and thest e.g. moving the army around or attacking an enemy region. But with savegames it’s just a single click for loading a game with a premade army that’s already assigned to a region. I know that savegames will change drastically during developement, but in some of my older projects testing some gameparts took much longer due to the lack of saving and loading games and that’s a mistake I didn’t want to do again.

Second I continued work on the hexagonal battlefield which is shown as soon as you attack an enemy nation with your army. Contrary to one of the “older” screenshots it’s now an own gameview and not just a window that opens up. It also has it’s own user interface to show e.g. your units (with stats) and you can also see the units involved in the battle, so there isn’t too much left for finishing this part of the game.

And most of the time has been spent finding and fixing bugs and annoyances within the different parts of the game. This is something I always do during my bigger projects : I stop adding new stuff and search annoyances and bugs in the current codebase and then fix them before continuing. I prefer this over having those in the game until I’m finished and then having to fix them at the end of developement. One rather annoying bug I fixed was occuring in the GUI, where it could lead to the modal message dialogue to visually disappear. In the end this meant that the user couldn’t close it and thereore couldn’t continue to play. But besides this, I didn’t find any huge bug (or even a showstopper) and fixed some smaller quirks in e.g. the way that you assign and move armies around the map.

And I also coded my own selection method. As you may remember, in one of my older postings I wrote that the newer series 90-drivers from nvidia make OpenGL’s selection mode crawl to a very few fps. And since even the newest one I tried (92.61) didn’t fix this, I implemented my own selection with a simple color selection. So instead of using OpenGL’s selection I render a very simplified version of the scene where the different objects (regions) have different colors, read back the color under the cursor from the framebuffer and select the object based on that color. Works exactly as good as OpenGL’s selection mode, is faster and I don’t have to care for driver-related problems.

Ah well, that’s it for now. This posting grew bigger than I first intended, but as you see I’m slowly approaching a point in PjW where progress doesn’t anymore directly “turn” into progress on screenshots. But that’s not stopping me from continuing to post, though you may get a few less screenshots in the future ;)