I always wanted to do a tower defense since I played my first one in Warcraft III. The logic behind the tower is quite easy, but behind the creeps there is a lot of things to take in consideration. Especially when you can create a maze with the towers.
You have to use path-finding, there are so many different path-finding solutions. The most common is A* path-finding. There is a lot of documentation about it on the web. By chance someone already wrote an A* implementation for ImpactJS. So I started with this. I was really happy because in a few hours of work I already had the whole maze implementation.
But after a few days, I stumble on a issue. Because it’s a maze tower defense. I wanted to have lots of towers and lots of creep. I find boring the TD with 10 creeps to kills. The issue was about performances. The path was calculated after each map modification (add/remove tower) for each creep! At more than 50ish creeps on the screen it take a few seconds to calculate the path so it’s unplayable. ( Try it yourself : http://doobdargent.com/alpha/maze_WIP/ )
I had to find a new solution. I asked on reddit, and assassin10 had the greatest idea for my game. Since my game is tiled, I should store on each tile, the distance till the exit. That’s the technique used in painting software for the bucket tool. It’s called the flood fill algorithm.
So every creeps just have to look for the lowest distance values on the tile neighbor. It’s way faster because the game calculate only the distance value on each tile for each exit. ( Try it yourself : http://doobdargent.com/alpha/distanceMap/ )
My friend Draknox made the art of the towers and the main screen. For the towers, he’d drawn them on a paper with a pen then applied a digital oil filter. The result is nice for a 40×40 size. I kind of damaged the images by coloring them, sorry about that.
I made the creeps, 6 types, using Aseprite.
Unfortunately I didn’t have the time to balance it, so after the level 6 it’s either too hard or too easy. Depends on the player.
I didn’t have much feedback because I think most people think it’s botched, and that is true. I had lots of personal things (mostly good) that required my attention. I will one day, when my current projects are over, will remake it with either libgdx or webgl. So the performance will be even better. I’ll also find a pixel art artist and a sound artist too.
The feedback I had :
- Too fast
- Too small
- UI not friendly
- Exit should be within the map
[ Play it here ]