I wrote an example of basic NPC movement AI for a class I TA.
The NPCs chase or flee from the player based on their race (Giant or Pygmy) and their proximity to the player. When they aren't chasing or fleeing they meander about with some sense of purpose/momentum.
You can check it out on GitHub, or download the game rom to play with.