Thursday, March 16, 2006

With a bit more time lately, I've accomplished some more features in the game. I have some what decent group movement. I only support the Line formation which currently is a static width of 5 but I will replace this with a 'Formation' class that will support dynamic formations. The ability is there, I just haven't had time to actually finish it. As it stands now, this drastically reduced the overlap of units. Two units in seperate groups however can still stand on top of each other and for right now, this is a fine feature that I don't mind since once they move again, they won't overlap, even if they end up in the same group.

The other feature, which is sort of shown in the screenshot, is units finding targets. Each unit now searchs for a unit that is within his sight radius and then engages the enemy. Currently, units fire white cubes at each other and have no hitpoints but the target acquiring is there. You still fire when you are moving but this is easily fixable with an enumerated state which is checked. If you move away from the unit, you will stop firing if they go out of your 'sight radius'. This looks really neat in motion as it is one of those 'visible' features of the game that make it more of a game. I am going to leave off changing the cube until we get a real unit in there from Reds. He's hard at work on the lizard man model which has come a very long way. I have seen a few screenshots lately and they are impressive. It'll be a huge day when we can finally switch over from the robot to one of those. He's on vacation now, being a bum, so I don't think there will be any progress towards that goal for a while.

I'm going to tidy this up a bit and then get back to work on the formation code. I want to have a few different formations ready to go which will be selectable through the GUI whenever I get to that stage. Either way, this is a big step towards the end goal and I am very excited about it.

Screenshot: 1280x768x32 - No AA - Default ATI Settings

Saturday, March 11, 2006

Milestone 11: Reached

I haven't posted in a while since University life keeps me really busy. However, a lot has happened since the last post. The first and most important thing would be a new team member, bringing the grand total to two. Reds, as is his online nickname, has joined as an artist/would-be coder. I don't know where his coding skills are but I do know his art skills and I am more than thoroughly impressed. I was originally intending this to be a solo project since I didn't think it would interest anyone else but apparently it did. The art content was a major concern as I was basing the game on free content that I could find online which would not provide a consistent look and feel to the game. Reds has been hard at work on our first unit model which is a lizardman.

Which leads to the second development of the game and that is theme. I had no original theme for it, just two opposing sides, but Reds has come up with Lizards vs Beasts. He thinks he can pull the art off for it and from what I've seen, it'll be amazing so we've decided on that. I am really happy with that decision. He's animating the model right now and it's looking really good. He has seperated the weapon and shield as well as a shoulder pad so that we can use replacable items when you upgrade a unit (a long away feature) which is amazing. In total, I am thoroughly excited to have someone as talented as him join my little hobby project. I think this could be really something interesting.

Now for the milestone itself: Navigation. That's right. I have path finding around the map working. You can select a unit, right click somewhere, and he'll find his way there. Buildings mark themselves on the map as in-passable so any unit can weave in and out of buildings to find his way to the destination. As it stands now, units just walk through each other on their way to the destination which turns out not to be as bad as I thought it would originally be. I may leave this as is.

I'm using the A* algorithm which has many references online, beginning with a GamaSutra article. From google, many more resources can be found. The approach I took was to divide the map up into tiny little tiles, each about 1/4 the size of a unit. This will also allow me to use a mipmapping approach, when the time comes, to the pathfinding so that each "patch" in the terrain will have it's own higher resolution of tiles and I can use the patches as a low resolution test to begin with. This should give a huge speed increase when it's implemented, if we need it.

Each of the buildings automatically marks the tiles on the terrain that it covers so I can have buildings that can more (not sure what right now but the feature is there..) and they are padded a bit to prevent units getting too close. Over all, it works really well. I've eliminated any bugs that I know of but I'm sure Reds will be able to find at least more which is excellent. I have a lot of ideas about optimization for it but currently, its still fast and works great. We'll see how this goes when we have 100 units in the game.

Milestone 12 also has had some progress done towards it (which is actually shown in the screenshot). The milestone was to have formation movement. This turns out to be a lot harder than I initial expected but I've got a very solid base right now to build on. I have a few more features to put in, like various formations, and I think it will mostly be ready for prime time. Currently, I am just using a hard coded formation of the "line" formation with a width of 5 units. The actual formation class will allow the width to vary so that it doesn't create a small width with a huge number of rows but it also doesn't create a large width with only 1 or 2 rows. Somewhere in the middle is the desired option.

In the screenshot, I selected the units and told them to move towards the white box (it's a debug item to show where you click). The units were originally all spaced apart in an uneven manner but they moved into their intended formation when you right click. This keeps units off of one another to a large degree. Obviously, other groups can overlap any other group but this may prove not to be a problem for the most part, depending on how we decide to do unit creation (single units or predefined groups of units which stay in groups). Either way, this was a major feature and it's almost done so I'm happy considering how I haven't had any time what so ever to put into this. This has been through the work of many "I have 20 minutes before class" sessions but it's finally coming together.

Major eatures left in group movement are:
Various formations
Movement to the closest possible destination if desired isn't walkable
Orientation of a formation

Screenshot: 1280x768x32 - No AA - Default ATI Settings