Tower defense game notion

So I have gotten sucked into this cool game, Tower Defense -- apparently there's a whole genre, but this is the one I've been playing with the past couple of days.

It's a Flash game, and the premise is simple. You have a grid with two incoming gates and two outgoing gates. Enemies come in the incoming gates, and you have to kill them before they get to the outgoing gates. You lose one health point for every enemty that gets through. You have 20 health points and no way to get more.

So -- the point of the game is to build defense towers which run automatically. Each enemy you kill nets you a small amount of money, which you can use to build new towers, or upgrade existing ones. (You need to upgrade to keep up with the steadily increasing toughness of the enemies, of course.)

It's fun. I thought of a fun way to do some really cool programming with it. AutoHotKey can find the Flash window, and can scan the screen for whatever you need. It can click things, too. So my notion is to write an AHK front-end to play the game, with an IP connection to a strategy server. The strategy server would then use evolutionary programming to come up with board arrangements, and over time (perhaps a great deal of time, who knows?) you could watch the strategizer get really good at Tower Defense.

Or not.

But it would be fun to try it.

My notion is that the instructions for a given strategy would consist of a series of builds at given coordinates, intermixed with upgrades to the towers built. Each instruction would only execute after there was enough money available for it. So you'd have a string of instructions which would express a given board setup.

To combine strategies, you'd just ... well, I guess you'd just cross the streams, so to speak, taking two (or more?) successful strategies, cut them at a random spot, and splice them together. You might want to have some cleanup rules (you can't upgrade squirter #3 if you didn't build three squirters, for instance.)

And then you'd let it run for a few weeks. You could get other people to download your script and run strategies, too.

It could be very, very cool...

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.