GUI - Coding and some Hex(es)

After having done the layout for the GUI, I started to implement a new skinned control into the already existing GUI-part of the project. Basically it’s a control consisting of different parts and every part has it’s own texture (overlay, the whole control has it’s own background) and is activated (rendered) as soon as the mouse cursor enters it’s polygonal area. The area itself is specified as a polygon, so you can recreate every complex shape that such a control can have. But to make things easier for me I also added functions to create the polygonal areas from basic primitives like spheres and stuff. Adding this was no real hard task, since I already had a rather finished OpenGL-GUI (including windows, buttons, listboxes, buttons, panels, memos, images, etc.) from back when I started to project in 2003, and although the code was 3 years old it was clean and almost up to my current coding-standards. There were only two things in that old code I didn’t like. First, back then I used objects instead of classes (just file it under “lazyness”) and so I also had no basic GUIItem-class, which e.g. made me render the different objects types in a separate loop. But I changed both those points and now all object types are derived from the TGUIItem-class, which contains most basic things like the drawing function and so on. Nowadays this is the way I always implement something like that, especially since it makes the code look cleaner and also makes using it easier, but that was 3 years ago, so no big deal, especially if I compare it to other code I wrote 4 or 5 years ago. That means for now the coding part of the GUI is finalized, and I just need to finish the graphics and put them into the game, and as usual (at least for my later projects) I use XML-files for defining the objects in the GUI (and in the different windows), so no need to change a single line of code for making changes to the GUI-layout.

And now to another part of the game, that I already planned back when I started with it. You can see a screenshot of the turn-based fights on the left. I still am not totally sure if I should put it in or not. Back then I planned to open up this 3D hex-battlefield in which the players had to fight against each other as soon as one player attacks the region of another player and depending on the outcome of this fight, the attacker would overtake this region or not. Just think of it as a very light version of SSI’s Panzer General. So if I decide to put it in, I’ll also add an option of just letting the CPU calculate the outcome of the fight, so the player can decide if he want’s to have a real turn-based fight (gameplay over time) or just want to see the final result (time over gameplay), with the first option giving the player more control over the outcome of the battle. But well, as mentioned I’ll still think about it and see if this will make it into the final game or not.