Lead Developer, Stardock Entertainment
Published on December 17, 2004 By CariElf In GalCiv Journals
The most noticeable thing that I did this week was the options window. Currently, it's just a listbox of checkboxes and their labels, just so that we can test with the various options on and off. I also added some of the ship movement/end turn options back in and tested those. The ship movement and end turn code seems to be working much better than it did in GC1; there were always a few oddities in that code before.

I added in the options to turn on anti-aliasing, which really makes the screen look nice. We have code in the engine to find the best video settings for your hardware, and I have an option in the engine to use the recommended setting by default. But for some reason, none of the machines that I ran it on recommended using anti-aliasing, and they all had different video cards. It worked with the same code on those same machines with Political Machine, so I don't know what's up. Maybe Microsoft changed something between DirectX 9.0b and DirectX 9.0c. I'll have to investigate that, but for now, manually setting anti-aliasing works so I just added it to my bugs database and went to the next thing.

One area of the code that we've always had trouble with is keyboard input code. We've always kind of bludgeoned it into mostly working. I tried using DirectInput once, but it didn't help us any and it was slower than using the windows messages. We have a technology from LightWeight Ninja called inputmaps that we didn't fully utilize in GC1 because GC isn't as dependant on keyboard input as LightWeight Ninja is. In LWN, it was used to send the same input message whether the player was using a keyboard, joystick, or a game controller. In GC1 we may as well have used the windows messages because we only used it to rename the keyboard messages; for example, 'C' was mapped to GCMAIN_KEY_CENTER, and when that message was processed, the 'camera' would center on the selected ship. I realized that for GC2, we could use the key maps to handle the key messages more efficiently. I gave each screen a pointer to a keymap and when it's unhidden, it will add it to the top of the active key maps list. Then, when it's hidden, it will be removed from the list. So the long chain of "if this window is unhidden then send the key message to it, else if that window is unhidden..." from GC1 can be replaced by a single call to the active key map list which will pass on the message to the topmost active map, which will translate the message and pass it on to the screen in a form that makes sense. I also made two default key callbacks, although we may only end up needing to use the one for popups. So in GC2, ESC will close any window designated as a popup.

I started work on the pictograph code for the planet data screen I converted all the code from GC1 apart from the code that actually drew it, because that code was mostly hardcoded. The new code will be more flexible. However, it means that I have to add support for tiled graphics into our texture painter. Currently, we only support stretching. Tiling, however, will give us some more flexibility. Since we can't support textures larger than 256x256 to avoid running into trouble with certain video drivers, it has to be smart enough to be able to create the tilestamps from multiple textures.

I probably could have gotten the tiling code done yesterday, but my dad called me at 10:30 to tell me that he was having an irregular heartbeat and that his doctor told him that he needed to go to the hospital. This was the second time this has happened in less than two weeks, but it wasn't as bad this time. He couldn't get ahold of Mom, so I drove him. He checked in at the ER at about 11:30 and we were there until about 4, when they released him because his heart wasn't racing like it was the last time. Dad was a lot more noncholant about the whole thing, and irritable about having to (a) leave work and ( sit idly on the hospital bed. Not that I was hysterical, but Dad's father died of a heart attack and so these irregular heartbeats worry me. They've got him on blood thinner and something to keep his heart from racing, but it still worries me.

Today, after working more on the tiling code, I put together an update for Prelude to War to fix a few minor things and spent too much time fighting with my laptop because it suddenly developed a bizarre bug where it wouldn't let me paste. Rebooting didn't solve the issue. I shut everything down and ran spy sweeper and now I seem to be able to paste again. I started writing this blog earlier than usual so that I could make sure that I got it done. Now I'm going to go back to working on the tiling code.

Comments
on Dec 17, 2004
Wow! You have been busy...if only I could be so productive
on Dec 18, 2004
Nice to hear some of the nitty gritty stuff. Sounds like you're motoring along very nicely. Hope your dad is fine,

Paul.
on Dec 21, 2004
All my best to you and your dad. My grandfather (mother's side) has had like 5000 hearts attacks so far and he keeps on going. Still we worry every time. I hope he drinks some red wine, it is good.