8 September 2012
I was thinking about how the towers in other TD games fired their ammunition. As I thought about creating an ammo that traverses from the tower toward the enemy, I realise that there is a high chance that the ammo would “miss” the target because the target is constantly moving forward. Although the ammo will not miss if its velocity is high enough, what if the game has enemies that move extremely fast? I was thinking about what would happen if towers shot at creeps that moved too fast for them to aim at.
So, I decided to think about the other TD games I played.
GemCraft has an amazing ammunition trajectory. All the towers in the game use orbs, and if I recall correctly, the orbs are actually fired in the OPPOSITE direction from where the creeps are positioned. After firing, the orbs then slow down and gradually turn around back at the enemy, and then go full speed at the enemy. I think the orbs are actually fired in random directions 360 degrees around the tower, but their targetting system is coded such that they will always hit the creep because the ammunition will accelerate toward the target, and will eventually hit it no matter how fast it moves.
The only time the ammunition does not hit the target is when the target is killed by another tower, OR is banished (reaches the end of the path). Because they use magical orbs and not “bullets”, it does not seem stupid for their orbs to disappear in mid-air. I cannot apply this technique to my game because I use lasers and bullets in some of my towers.
Bloons is rather different from most other TD games I see. It has actual collision detection. If the monkey shoots a dart and misses the bloon it is supposed to hit, the dart does not just disappear. It continues moving on until it hits another bloon behind, or until it is out of the screen. It only disappears if it collides with the creep.
I don’t think collision detection is something I want to do because it can be quite irritating for the player if an extremely fast creep spawns and starts ninja-ing its way toward the end, dodging all the bullets like in Matrix.
Some other miscellaneous games
There was this TD game I played long time ago that used towers with muzzle flash. The towers just have a flash at their muzzle and it looks like they fired something. But there are no bullets. This is possible something I can use for some towers. It does save some work because I don’t have to do bullets, but eventually, I cannot have every tower in the game look like they aren’t shooting anything. So, I decided to look up one game instead of just recalling all the TDs I played.
Flash Element TD 2
This is one of the earliest TD games I played. I liked it very much and I decided to try playing through it. Their towers shoot ammo as usual but they always seem to hit the creeps because the creeps are kind of slow compared to the speed the ammo are travelling at. Then, I started to become more observant when the faster creeps appeared. I noticed that no matter what, I could not see any “misses” or any ammo being wasted.
I felt like using FRAPS and recording the gameplay to observe it frame by frame what was going on, but it beame quite obvious to me after another minute of observation. The ammo would still ALWAYS travel toward their target even though it is not meant to be. It looks like the bullet they shoot are heat-seeking and curve toward the target. Indeed, most TD games probably incorporate this, and I should have guessed so from the start. With that, I think I have an idea how to create the ammo now.
Today, I tried to do a screen which manages the towers that the player owns. Basically I was aiming to be able to select towers, navigate through the inventory of towers and have the game print out the statistics of those towers, such as their health and damage values.