Wednesday, August 5, 2009

Project Update

It's been a while since I've said anything about the game I'm working on. So let me share with you what's going on.

This has been a big learning experience for me. I always thought that the difficult part of game development was the implementation, but that seems really easy now next to game balance. I recently read a great article that talked about how balance is the maximizing of player choices. An unbalanced element is one that removes player choice. For example, there used to be little difference between the riflemen and the machinegunners, the riflemen cost less, so there was no need to ever use anything but the riflemen. That's a choice the player doesn't need to make because using anything but the riflemen was stupid.

I've been focusing on differentiating the different classes, and giving the player reasons to use them. I think I've made some good strides in the right direction. I introduced a new zombie type, the armor zombie, that takes very little direct damage from attacks. Then I made the riflemen do very little direct damage, but they poison the zombie they hit. The armor zombies are just as susceptible to poison damage as any other zombie, so the riflemen are very effective against them. It takes two or three machine gunners to take down the same number of armor zombies that a single rifleman can handle. But at the same time the riflemen don't do enough damage to take down the other zombie types on their own, so you can't rely on nothing but riflemen.

Another change I made was to make the snipers very bad at tracking fast moving zombies, so they can really only hit a zombie that is coming towards them, or walking away from them. They do a lot of damage though, they can do about as much damage as three machine gunners, but they only cost a little more than two, the drawback is that they aren't any good in tight streets, so you can only use them in a few limited areas. This also gives you incentive to create long straight shots for the zombies to run down so that the sniper has a good shot.

Another problem I ran into was resources. Most tower defense type games have you gain resources by killing enemies. The problem I ran into with this was that I had the amount of money dropped by an enemy tied to how tough they are. This lead to situations where the zombies drop money, which means that the player's defenses improve, which means the zombies need to get tougher, which means they drop more money. It was really giving me fits trying to figure out the optimal rate of resource growth versus enemy strength growth. I finally decided to decouple the two, and made it so that the player gets resources from the buildings. Also the player can gain more resources by building factories on the buildings to boost their production. The trick about the factories, is that they improve their own production, and the production of surrounding buildings, but the effects don't stack. So the most economical thing to do is to spread your factories out over a large space. This whole setup does a couple of things, first it increases the players incentive to keep the zombies from capturing too many buildings, because each lost building cuts into their bottom line. Second it encourages careful placement of factories to maximize the number of buildings that they boost. Third, it encourages the player to hold onto large contiguous groups of buildings, they need as much real estate as they can get to maximize their earnings. Finally, it adds more choices, because the player has to decide, will they buy more defensive units, or more factories, or try to hold out in hopes of winning when they finally amass enough money to win.

Overall these changes seem to really be improving things. At the moment I'm reworking the path finding logic. It's a bit clunky, I set it up so that the zombies would favor exploration over building capturing, unfortunately this means that on smaller maps they never get around to capturing buildings.

I'm feeling really good about where things are headed. Once I get the gameplay nailed down a bit more, to where it's fun and challenging, then we'll be able to start work on the artwork again. Then maybe I'll have some pretty screenshots to put up.

Labels: ,

Wednesday, January 7, 2009

Keeping up the momentum

I've gone back to work, so I haven't been able to keep working 12 hours a day on the zombie defense game. But I have kept up the momentum. I made a hard and fast rule for myself that I can't let a day pass without doing something on the game. So far this week I've fixed a couple of bugs, and implemented the losing and winning screens. Things are moving along well. I'm planning for a July release, and it looks like things are on track for that.

I feel that if I can make consistent progress then I should have a well polished product ready for market come July. I'll make periodic updates here on the status as interesting things happen.

Labels: ,

Thursday, January 1, 2009

Game Cow Week: Day 4

Today wasn’t quite as productive as the other days. But I still got some good stuff done. I had to do a lot of debugging, and code refactoring. I expect that I’ll have to do more of that as time goes on because the code base is getting a lot larger, and more complicated. Additionally, when I wrote some earlier code I was making assumptions that no longer hold true. It’s been interesting producing so much code in such a short time.

I spent a fair amount of time reworking the defender classes. I added some methods to calculate line of sight so that I could have the defenders hold their fire until they can actually see a zombie. I also modified the defenders so that when they are standing on buildings they can’t shoot immediately around themselves. This is a gameplay move, it gives you a reason to put defenders out on the streets, because they can shoot zombies that are up close, rather than just ones that are farther away. I also added some code so that the defenders have accuracy stats, and their weapons also have accuracy stats. This along with some other changes allowed me to implement three different defender classes. There’s the rifleman, they fire in three round bursts that do decent damage, and their accuracy isn’t great, but it’s okay. There’s a sniper, that has a really long range, good accuracy and damage, but they shoot slower, and only shoot one bullet at a time, so they can only hit one zombie at a time. Then there’s the saw (squad assault weapon) soldier, he sprays the bullets, with low accuracy, and pretty crummy damage, but he puts out a whole lot of fire.

Today marked the first day where it really started to feel fun. As I was setting out the different troopers, and trying to figure out the best spots to put them to stop the zombie hordes it was really fun. Hopefully I’ll be able to improve on that as I add more features in the coming days. I’m hoping to finish up the humans tomorrow, adding experience points, and morale to the mix. I’m also planning on reworking how soldier deployment works some, and putting limits on how many soldiers can be deployed. If time allows I’m also going to be working on polishing up the interface some. Adding some menus, and adding methods to display story text, and information about individual soldiers.

Instead of a screenshot today, I have a video. Putting out the troopers was so fun, that I decided that there needed to be sound effects, so I added some gun sound effects. The whole thing was so fun to watch that I decided a screen shot just couldn’t do it justice and downloaded a cool open souce video maker and made a video. I stuck on youtube, you can watch it here. I recommend watching it in high quality.

Labels: , ,

Wednesday, December 31, 2008

Game Cow Week: Day 3


I stopped early today, about 5:30, because it was new years, and because I was starting to get burned out. Although after nearly thirty six hours of programming in just three days, it’s not much of a surprise.

I got some good stuff done today. I added barricades, two varieties, that can easily be expanded into three. I set it up so that when you place a barricade it barricades all four sides of the tile, with an empty space inside which you can place defenders. The defenders can then shoot out of the barricade at the passing zombies. I also got the zombies to chase defenders, so if a zombie sees a defender it will attack it, meaning that packs of zombies will move out and swarm around defenders. So if you have a defender behind a barricade, then the zombies will swarm the barricade and beat on it until it falls apart. The path finding works so that the zombies will sometimes decide that it is faster and easier to beat their way through a barrier, rather than going around. Also at times the zombies will be going around a barrier, except for a few who are trying to get at a defender who is inside. When they finally get through the barrier the other zombies will start following the shorter route opened up by the destruction of the barrier.

I also added a water tile. Water tiles slow zombies down, so they will avoid them if possible. I’m thinking it would be fun to have zombies randomly get washed away in the current, and that shouldn’t be too hard to implement. Maybe I’ll do that tomorrow.

Another new feature is two additional types of zombies. Now there are the standard slow zombies, a faster variety that moves about three times as fast, and a big powerful zombie that moves slower than the others, but is much tougher. The big zombies are giving me a little bit of trouble, because they move slower they don’t flow through the level as nicely as the other varieties. I’m going to have to play around with them some to see what I can do to get them to work better.

Tomorrow I’m going to dive into developing the humans more. I think it could be fun to have the human units be unique, something like your units in Fire Emblem, which would better facilitate a story and be pretty unique for a tower defense game. But I don’t know if that will work out. Usually tower defense games require you to have lots of towers out on the play field, and if I have the units be unique I’m probably looking at only about thirty or forty units total over the course of the whole game. A possible solution might be to have a mix of hero units that are unique, and generic grunt units that aren’t unique. I guess time and playtesting will show what will work.

Labels: ,

Tuesday, December 30, 2008

Game Cow Week: Day 2

This morning started off a little rougher. I realized that I needed to rework some of my underlying systems, so I spent most of the morning doing that with little visible result. But the change will pay big dividends in the next couple of days.

What I was doing was having each of the objects using their own timers to update things. This made it really difficult to script anything, because the zombie spawners couldn’t be controlled, and the zombies themselves couldn’t be paused or anything. So I set it up to have one class that has a timer, and it sends tick events to all of the objects that need to be updated. Certainly not anything new, but it works well, and it allowed me to easily implement a pause function. It will also make it easy to put in story events.

The reason I had to add this in today was because I was working on making it so that the user gets a bit of time at the beginning of the level to choose which building to hole up in, and where to place defenses. The way it was working zombies would just start spawning as soon as the level started, but now I’ve got it working on a schedule.

Which brings me to the new features. As seen below in the screen shot you can select which building you want to hole up in. This also necessitated some path finding for the zombies, since they might need to head anywhere in the level. Rather than implementing AI for each of the hundreds of zombies on screen at any time, I set them up to use a technique called potential fields. What I do is use Dijkstra’s algorithm to find the shortest path from any point on the map to the target building. Then I set up each tile on the map with a force vector to push the zombies towards the next closes tile. Almost like the zombies are little scraps of paper being blown about in the wind. It works pretty well for herding hundreds of zombies towards their destination, and assures that even if one gets off the normal path it can still find its way.



I also added in human defenders. In the second screenshot you can kind of see a couple of little blue guys, and you can see some of their bullets that they are shooting at the zombies. They work pretty well, too well in fact. I’m going to have to do some balancing, five or six guys strategically placed can take out thousands of zombies no problem. I’m hoping to tackle that problem some tomorrow.



I’m planning on having the human defenders be subject to attrition, over time their morale drops, and they need to go back to the base for a while. That should make it interesting as the player constantly has to move defenders around, to keep fresh ones near the front lines. Also, at the moment zombies don’t even touch the human defenders, I’m going to have to fix that as well, that will require some interesting programming I think to get nearby zombies to head towards humans. Additionally I’m hoping to implement an experience system. In most tower defense games you level up your defenses by spending resources gained from killing baddies, I’m thinking instead that I want the defenders to level up as they kill zombies, which again will figure into the attrition thing.

So, tasks I’m hoping to look at tomorrow include: zombies attacking defenders, adding in barricades that the player can set up in the streets, different classes of zombies, and different classes of defenders.

By the way, if anyone is curious I’m using the Torque Game Builder. I’ve been really impressed, especially at the speed that I’ve been able to learn it. I looked at it a little bit about a year ago, but it’s been pretty easy to get up to speed on. I don’t actually own a license yet. I’m going to be buying one when I finish the week out.

Labels: ,