I’ve been working on fixing a couple of bugs. The good news is that the Xbox version is working nice and the garbage has been significantly reduced, which means that I have a constant 60 frames per second on the console.

I’ve been working on a new tileset, so here’s a video showing it. But I want to talk a little on the game’s AI too. Look at the video, at the 7th second you’ll see that the enemy is calling for help (“F1″ he screams), then the guy with a pistol takes the elevator for checking out what’s going on.

I wanted to make the enemies smart enough to make the game challenging and force the player to at least think twice before entering shooting like crazy. That’s why the field of view is restricted, you cant run all the time, and the enemies try to attack in a coordinated way.

If an enemy spots you, he will call the closest partners. Then they try to coordinate by surrounding the player, by blocking the exits from the zone the player is in. Let me explain this with a couple of images:

Game AI Example

Be Stiff Game AI Example

This image shows part of the map in the map editor (I’m using OGMO editor, if someone is interested), the yellow squares represent zones in the map, and the blue squares represent portals (not this kind of portals!). The portals represent a connection between two zones, indicating the enemy which action they should take to move from one zone to another (walk, jump, take an elevator…), so moving from one point to another is just an implementation of the A* algorithm for finding the best path, and tell the enemy to move to all the portals and perform the needed actions until he reaches the destination. The idea was inspired from this great article in Gamasutra.

So, what happens if an enemy spots the player? He calls for help (the “F1″ from the video), and when the help comes, they try to cover all the portals of the zone the player is in. In our example, if the player is spotted in the roof, the enemy will call for help, and they will cover the two portals the player should use in case he wants to flee:

Game AI Anemy Positioning

Game AI Anemy Positioning

If the player kills one of the enemies, the “enemy team” reorganizes itself trying to cover as good as they can the player’s position. If the enemy team realizes that it can’t accomplish its goal (kill the player), it dissolves and then each enemy individually attacks the player (without any kind of coordination).

Pfew! That was a lot of text, anyway this was a quick view on how the AI works, I hope someone finds this interesting.