Friday, July 6, 2007

Options Menu, Main Menu Background, People Distribution, Grid Problems, Mini-Map, Textbox

I added the options menu to the in-game pause menu. I also made it so when the resolution changes, all forms on-screen retain positions proportionate to what they were previously (ie. forms in the center stay in the center, forms on the right side stay on the right side).

I also added an interesting series of routes in the main menu's background. They are tinted a dark blue. I also added a gradient to the background that goes from a very dark blue at the top to a...slightly lighter dark blue at the bottom.

As I was creating the routes in the main menu background, I began to notice even more anomalies in the way people are distributed. They would often move to one route section and rotate through it rather than filling up the rest of the routes.

I have a large block of code dedicated to deciding where to direct a person when he reaches a node. Should he turn around? Should he go to the first or the second route on the other side? It calculates which route needs people the most and sends them through.

However, this code being large, bugs are inevitable. My last rendition of this game had many bugs and it didn't quite do what I wanted it to. This time around, I thought I'd done a much better job, and I had, but it still wasn't sufficient. Unfortunately, there were a few things I implemented later on that conflicted with the existing code, so I had to go back and figure out a way to make it work. Unfortunately, I was only able to "jerry rig" it.

So, I completely rewrote the code. I now know better what I am doing and was able to create more organized and robust code than before. Everything seems to be working fine if not better than I've yet seen it work. It was very satisfying to see it work so well.

I also noticed a few problems with the way the game interacted with the grid squares. When collision testing a route through a series of grid squares, only the squares it passes through should be tested. It seemed to be working fine until just now when it missed a few squares. Unfortunately, this code was fairly large as well (smaller, but large enough). So I rewrote it, too. The new code is slightly shorter and more robust. So far, it has worked perfectly.

I've begun to create a min-map that displays all routes on the map. I plan to eventually show the fog of war on it. I thought this would make testing easier for the fog of war when I can see it all at once on the mini-map.

Lastly, I perfected the textbox. You can now use the mouse to move the bar. The bar blinks now, too. I also added functionality that allows a control to decide what cursor to display when the mouse is over it. Thus, the usual "I" cursor is used above the textbox.

After the mini-map is as far as it will go, I will do the fog of war. I've let my ideas brew for the last few days before I get to work on it. Only recently has it sounded so feasible. I predict I will be deep into it tomorrow or the next day after the mini-map is complete.

Comment, please.

clevceo

No comments: