I probably mentioned before (or maybe I didn’t) that the monster AI in HamQuest was rather simplistic. It was essentially the following:
1. Flip a coin
2. If it lands on heads, move the creature randomly
3. If it lands on tails:
3a. If creature y > player y, move north, and done
3b. If creature y < player y, move south, and done.
3c. If creature x < player x, move east, and done.
3d. If creature x > player x, move west, and done.
Naturally, while this gets the monsters generally towards the player over time, it mostly just made the monsters line up, and it was easy to manipulate their movement, especially because they could not move through items.
So, I implemented a very simply A* based system that allows the monsters to look at the “how far away am I ” value of its neighboring cells, and move to the one with the lowest value.
And I tried it out, and the monsters swarmed the player, quickly overwhelming and killing him.
So I put the random factor into the movement again, but made it a different chance of random movement for the various monsters. Goblins and thieves move more randomly, whereas the undead move dead on for the player. The summoner and necromancer move the most randomly, as their job is to throw monsters at the player.
I also haven’t won a game in a really long time, and I have NEVER managed to kill a dragon.