Episode 16: Enemies

In episode 9 I talked about the entities in the game. In the next few episodes I’m going to dissect them in a bit more detail. Note that I already discussed enemy AI in episode 12, so I’m going to skip it here.

Presets

As I mentioned in other episodes, enemies are vessels that are created by the EntityFactory from presets. Because I wanted to keep the game simple, and also because the menu only has room for 16 items, I tried to come up with a naming scheme for the presets that would be kinda consistent and give a hint as to what the enemy is. Here are the presets I ended up with (plus a little description of what they do):

  • Scout: a small, fast ship that flies past the player and has little or no weapons
  • Patroller: a small, moderately fast ship that flies past the player, turns toward the player, and has decent weapons
  • Raider: a somewhat small ship that moves laterally toward the player, stops in front of the player and fires its weapons for a bit, then flies past the player
  • Instigator: a medium-sized ship that moves laterally toward the player, stops in front of the player and fires its weapons for a bit, and fires powerful weapons
  • Frigate: a medium-sized ship that moves laterally toward the player, flies past the player, and fires powerful weapons
  • Cruiser: a large, slow ship that flies past the player while firing powerful weapons
  • Destroyer: a large, slow ship that doesn’t move forward at first, moves laterally toward the player while firing its powerful weapons, then flies past the player
  • Warship: a very large, slow ship that doesn’t move forward at first, fires very powerful weapons, then flies past the player
  • Kamikaze: a somewhat small, fast ship that flies past the player, moves laterally toward the player, turns toward the player, and has no weapons
  • Transport: a large, slow ship that flies past the player and has no weapons
  • Barge: a very large, slow ship that flies past the player, moves laterally away from the player, and has no weapons
  • Mortar: a small turret that scrolls past the player while firing decent weapons
  • Artillery: a somewhat small turret that scrolls past the player, turns toward the player, and fires powerful weapons when facing the player
  • Gunpod: a medium-sized turret that scrolls past the player and spins in circles while firing powerful weapons
  • Howitzer: a medium-sized turret that scrolls past the player while firing powerful weapons

Here’s what some of the enemies look like:

Scout

Frigate

Warship

Kamikaze

Barge

Artillery

 

Items & Stats

The items that these enemies use are actually the same items that the player uses (except turrets, which have ships the player can’t get). However, I had to make it a fair fight, so I added multipliers to make the enemies weaker. For example, I made the enemy weapon damage about 10% of what it would normally be. Here’s how it worked:

This was a decent solution, but I ended up getting rid of the multipliers and going with minimum and maximum stat values based on the enemy’s level, then multiplied according to its rarity. This let me more tightly control the stats of enemies more precisely. Here’s how it works:

Enemies also have a value, which is the amount of money the player receives for destroying the enemy. They also have a chance to create a drop when killed. I’ll talk more about the game’s economy and drops in coming episodes.

Leave a Reply