Game Design 2: Blogpost #2, Enemy AI

For this blog I will be writing about the different AI in our game Behemoth. I am Jonathan Berggren the lead (and only) programmer of Group Siren.

In the concept document for the Behemoth game three types of enemies are described, we decided to use the exact same enemy types, although changing the way they look to fit the different artstyle we decided to have for the game. These enemies are:

  1. The Shooter
  2. The Kamikaze
  3. The Spawner (that we chose to call The Carrier instead)

The AI used for the Shooter is very basic as the enemy doesn’t really do anything complicated. It simple moves slowly into the screen from the right when spawned and then starts to move up and down in an area about the length of half the height of the screen. It has a health variable starting at 100 which means that it dies instantly from a shot from the cannon and takes about 1 second or so to get destroyed using the standard laser. On destruction it will spawn a random amount of energy pellets (between 1 and 10) and have about a 20% chance to spawn each of the three different power-ups (but cannot spawn two at once). The Carrier works almost exactly the same with the small exceptions that:

  • It stops at the right edge of the screen noticeably further away than the Shooters.
  • It has 3 times the health of a Shooter.
  • It spawns Kamikazes instead of firing bullets at the player.

The Kamikaze AI is a bit more interesting as it was somewhat changed during the process of making the game. At the very start the Kamikazes would simply move in a straight line to the left. We felt that we wanted them to feel more different from bullets and so later code was written that causes each Kamikaze to, when spawned, randomly choose either the top or bottom of the right side of the players ship as its target. It would then constantly move forward (as in the direction its face is pointing) while slowly rotating towards its target. The Kamikaze has lower health than the Shooter meaning it is very vulnerable to the laser weapon however it is immune to standard cannon projectiles. It will also on impact with the players Shield lose all of its health upon which it will explode dealing no damage to the player. On impact with the ship it would deal less damage than a Shooter’s bullets but have the added annoyance of disabling the players Shield forcing them to re-enable it using their finite energy making multiple Kamikazes particularly dangerous.

While working on this I decided to write some additional code to make the Kamikaze instead of simply hitting the ship, rotate towards the back of the players Shield after getting behind it. It worked at first but some kind of bug shortly afterwards caused issues with this movement. In hindsight this could probably be fixed but since there was too much other work to be done at the time and this was not an important feature I simple scrapped the code and made the Kamikaze hit the Ship instead of the Shield.

The image bellow shows three Kamikaze enemies who just got spawned out of a Carrier enemy. One of them has just hit the players shield and is exploding while the next two are heading in the same direction towards the players ship.level3

Leave a comment