Thursday, September 18, 2008

Field of Vision

The past two nights I've spent some time on my Field of Vision algorithm. Last night I wrote the initial algorithm, and got it running inside the game. Today I fixed a bug in the algorithm (hard to believe there was only one), cleaned up, and comment the code. I'm using both the Midpoint Circle Algorithm and the Bresenham's Line Algorithm together to calculate the field. It stores the field with each point keyed based on how far away from the original point the field was calculated for. This will turn out to be extremely useful when I want to apply effects to different points based on how far away they are from the origin.

The algorithm is built as a grid worker. This allows it to be used by any other object in the system, and fields that have been calculated that may never change can be reused without recalculating. The grid worker class has grown to be immensely useful, and is now probably the most common base class in the system.

I'm writing this post because I don't know where I'm going to go from here. There is still a lot of ground to be laid, but I'm trying to figure out what gives me the most bang for my buck. The current goal is to get a basic working game going, so with that in mind I'll probably work on dungeon depth and persistence. Hopefully that goes as well as the field of vision code did!

Tuesday, September 16, 2008

Some Progress

I've been working on the game every now and then, and in the past week or so quite a bit. My new laptop is helping out with this increased productivity, as I can now code while watching television!

The main thing I've been focusing on is getting my code ready for being placed on a repository. As I may have mentioned I plan on open sourcing my code. Since I'm writing my game on the skeleton application that comes with the SDK I'm using, it has required me to rewrite a lot of things in skeleton application that don't really have much to do with the game. Mostly I'm talking about player saving and things like that. I'm happy to report that all the code in my game is now my own so it's ready to upload when I decide.

As far as the game itself I've only gotten hit detection to work. This was actually only a one line thing, and I'll need to revisit this one line later on. For now it's nice to see this working and it feels much more like a game. Now that I have a bunch of boring code out of the way I'll be able to add more to the actual game. There are still a few things I want to add before I make the code available to all. Once those are added I want to do a small code and comment review before uploading the first version.

Once it's uploaded I won't be publicly telling anyone about it, for now it's mostly so I have the code backed up on another server. Once I have a better represented game I'll probably point people in the direction of the code as well so they can see how it works. I'm hoping people can provide some feedback on the code as well, as I'm sure there are ways of doing things that I don't know about.