This is the official AI spoiler for Martin's Dungeon Bash, version 1.3.
Martin's Dungeon Bash uses roguelike geometry, in which space is rigidly quantised into square cells, and the distance from a cell to another cell B, joined to it at either an edge or a corner, is exactly 1. The distance from cell A to a distant cell C is the minimum number of edges and vertices which one must traverse to get from cell A to cell C. The "cardinal directions" of roguespace are the directions in which one can move from one cell to an adjacent cell.
There are five movement selection algorithms used in Martin's Dungeon Bash, as follows:
The "naive" AI is used by "stupid" monsters without ranged attacks who have line of sight to the player. The monster tries, for each of the three adjacent squares which are closer to the player, to get closer to the player.
The "missile" AI is used by any monster with a ranged attack (either shooting or black magic) requiring cardinal alignment which has line of sight to the player. The monster tries to close with the player, preferring to do so along a cardinal if already on one, and to get onto the cardinal if it isn't already on it.
The "smart" AI is used by "smart" monsters without ranged attacks who have line of sight to the player. The monster tries, for each of the three adjacent squares which are closer to the player, to get closer to the player, preferring to find a square which is not on cardinals relative to the player unless that square is also adjacent to the player.
The "drunk" AI is used by "stupid" monster which lack line of sight to the player. The monster tries three randomly selected adjacent squares.
The "seeking" AI is used by "smart" monsters which lack line of sight to the player. If the player is "near" the monster, the monster moves towards the player as best it can; otherwise, the monster moves towards the stairs.