Tower Defense Game November Update

For this update, we have a couple of new turrets. We have 9/10 done. Only one left to do.

The Carrier turret/tower is finally done. I went way overboard on that one and there was no need. I took the A* navigation system I had in my first (un game and moved it over to this game. It is only used by the UFO’s. It is extremely long range and is the costliest tower. You start with 4 UFO’s and get an extra one for each level (maximum 3 levels, green, yellow and red). Here is the level 3 Carrier tower.

The UFO’s fly around and attack groups of enemies. There must be at least 4 enemies close to each other. So you cannot use it for single enemies.

Anyhow, the A* navigation system that I brought over was converted to be 3D (not just 2D) and I had to add a bunch of restrictions so it didn’t do weird zig zagging. It still has a somewhat erratic pattern, but it looks cool and they’re UFO’s. I like that they fly a little bit weird. I added new sound effects for flying and shooting. I thought finding a sound effect for a UFO flying around would be easy. It’s a UFO. You could use literally anything as no one knows what a “real” UFO would sound like. But I didn’t want it to be too annoying. I went through ALL the sounds I have a license (or free) and only found one sound I kind of liked. I think it came out really good. But we’ll have to see once people play test it.

Here’s a shot of the UFO’s attacking.

Sorry for the blurry screenshot, but they move somewhat fast. As you can see, they rotate around a center point as they fly around. Once they’re near their targets, they will tilt toward the enemy and shoot. The fire and smoke on the right is where the UFO’s were located when they took their last shot.

Next is the Fire Turret. This one I had a lot of trouble deciding what I wanted to do with it. This tower can hit many targets at once. But anything with a fire effect (fire and laser towers) doesn’t do much damage to shielded units. Still, I wanted an AOE (area of effect) tower that was cheaper than the main AOE tower (still remaining to be done). Each tower has 3 levels. So I wanted them to all be slightly different. Not just do more damage. So I thought if I make level 1 have 4 slots, they would shoot out of opposing slots, shut off, then the other two slots could fire. For level 2, four perpendicular slots could fire at once and then the diagonals could fire. For level 3, all 8 directions could fire at once. This is exactly what I did and level 3 looked especially cool.

But I didn’t like it.

One problem was that I didn’t want it to shoot through adjacent towers. This is fixable, but what if there are towers on both sides. The shooting would no longer alternate. What do I do then? A similar problem happens if there is only a road on either side of the turret. If it alternates the shooting, half of the time, it’s doing absolutely nothing and looks rather silly.

Then I realized I already had invisible collision areas all around the tower to detect when to shoot. So I could have the slots shoot independently of each other. But I could limit how many could fire at a time. So level 1 is 2 out of 4. Level 2 is 4 out of 8. And Level 3 is all 8 can fire at once. Problem solved. The best part is that I don’t need to check that a flame will hit a wall or neighbouring tower because it only shoots in a direction where an enemy was detected. The sides where there are no roads or have a tower will never fire.

The nice thing about this approach is that the flames ignite in order. And then the first one will stop and the next one where the enemy is located can ignite. It basically follows the enemies around.

Here is a screenshot just before the first set of flames will turn off (at the top left of the fire tower). Once that one shuts off, the one in the direction of the enemy will ignite and destroy it. This is a level 1 tower so 2 out of 4 slots are firing.

And that brings us to the last topic, setting the enemies on fire. Towers that set enemies on fire are the fire tower (above) and the laser tower. You can see in the screenshot above the enemy is on fire. What this means is that the enemy takes damage for a little while even after the turret has stopped shooting or is out of range. Here is another example.

The laser tower on the right has just shot some enemies and you can see some of them are on fire indicating they are still taking damage.

This was fairly difficult to do at first. But once you know how to do it, it is quite easy. Here I used a free fire effect package from the Epic Marketplace. But if you use it out of the box, what happened is that the flames would produce a long winding firewall wherever the enemies travelled. It was kind of funny looking. Here’s what I mean.

You can see the trail of fire and distortion lingers behind the enemies. The fix is easy. In Niagara, you can set each effect to use local space. Those will stay on the enemy. So the fire and distortion use local space. And the smoke and embers can use global space since I wanted those to stay behind.

I picked and altered three of these fire effects to try and avoid all the enemies looking exactly the same when they are on fire.

I said in an earlier blog entry that I was done everything on the technical side. That’s not entirely true. I still haven’t fixed the issue if you try to built a tower where an enemy is located. Also if you block the enemy’s path from reaching the exit. I’ll have to deal with that very soon.

One more tower left to do. Then it’s menus and config screens. I really need a setting for the volume 🙂 After that is making levels. I have a few ideas already.

 

Posted in Uncategorized.

Leave a Reply

Your email address will not be published. Required fields are marked *