Artificial intelligence (AI) is the intelligence of machines and the branch of computer science that aims to create it. AI textbooks define the field as "the study and design of intelligent agents where an intelligent agent is a system that perceives its environment and takes actions that maximize its chances of success. John McCarthy, who coined the term in 1956, defines it as "the science and engineering of making intelligent machines.

Custom AI:

Baldurs Gate runs a custom and complementary AI framework to NWN2 that reduces the CPU and memory cost for monsters and allows us to give them behavioral profiles to match their setup. These require a bit of scripting knowedge to setup and is inspired by the remarkable AI of the original Baldurs Gate games. Especially the sequel was a source of inspiration. When properly setup it allows us to make creatures behave exactly as we want them, with a high degree of intelligence and fully capable of using all weapons and tools in their arsenal.

Internal testing has shown that the AI is extremely resource friendly and effective in comparison to the default NWN2 AI, revealing as much as a 12% difference in CPU and memory per creature active in the area.


For NPCs which don't use the custom AI framework the standard AI from the Storm of Zehir expansion is used, which is widely acclaimed as being pretty intelligent as AI's come in online gaming. Several adjustments have been made here too, to make the code run more efficiently.