
When the Keldon Jones AI came out, it caused a sensation. This, then, is the suite of features of the second generation of monster AIs, and the common possession of all modern Angbands. It eventually replaced the monster tracking code.
#Faangband guide code
Although extremely CPU-intensive, and criticized as giving monsters too much of an advantage over the player, the monster flow code made such a difference to monster intelligence as to become almost indispensable. Ben Harrison introduced the famous monster flow, which stored the route distance from the player up to a range of 32 every time the player moved. David Reeve Sward contributed the basic monster learning system we still use today by storing information about character resists and immunities, monsters could learn to probe for missing resists - and then exploit them cruelly! William Tanksley came up with a way for monsters to target the character, which allowed them to track their enemies down in a realistic, limited fashion. When Ben Harrison took over, things started to change. However, at or before version 2.6.2, intelligent monsters were made to cast better spells if desperate, and the first monster terror code appeared. The young Angband added many spells and new features, but made few changes to this basic system. Again, to say that this was crude is less important than to note that, in the conditions of Moria, it worked acceptably. The monster would then try these five choices in order, testing any doors or glyphs, moving as soon as it found a grid it could enter or succeeded in clearing.
#Faangband guide plus
This involved choosing a direction that best approached the character, plus the two directions that flanked it on either side, for a total of five possible directions. Monsters that didn't cast spells entered the movement code. Not only was every spell guaranteed to be used, but monster designers could tweak the frequency of, say, harassment spells against attack spells by changing the number of each.

Although a primitive method, choosing spells at random had the great advantage of keeping the monster true to character. If it passed the spell frequency test, it would pick a spell at random. Each turn, a monster would attempt to cast a spell, if it had any. The first generation AI was mostly the work of Robert Koeneke. If you don't disagree with me at least once in the next six paragraphs, you need to learn more about this subject! LM's) opinion and viewpoint on previous AIs.

You will not be reading the true history here the following is one man's (i.e. The history of coding monster intelligence ("monster AI") in Moria and Angband is a long one. History: Standing on the shoulders of giants The history is interesting reading and written with Leon Marrick's usual mix of enthusiasm and iconoclasm:
#Faangband guide manual
I'm going to quote the development history liberally from this manual as the original is a text document which likely won't format well in your browser.

Leon Marrick has written extensively about it in the comprehensive design manual. Its called 4th generation, because it's the fourth major evolution of the monster AI routines in Angband's history. It's a set of common functions and algorithms used across a number of Angband variants: in addition to Sangband and Oangband (and FAAngband), its been adopted separately by NPPAngband and Unangband, both versions of which have evolved in different directions. Unangband monster artificial intelligence routines have evolved from the Sangband and Oangband's so-called 4GAI which is short-hand for Leon Marrick and Bahman Rabii's "4th generation Artificial Intelligence".

(This article is in six parts: parts one, two, three, four, five and six, and is also available as a PDF).
