2004 AAAI Games Workshop M. McNaughton, J. Schaeffer, D. Szafron, D. Parker and J. Redford, Code Generation for AI Scripting in Computer Role-Playing Games, Challenges in Game AI Workshop at AAAI-04, San Jose, USA, July 2004, pp. 129-133, abstract or pdf.
Abstract:

Scripting custom content for computer role-playing games requires the designer to tell a story by writing small fragments of computer code distributed among the characters, props, and locations of the game world. The main challenge of these games is to create believable motivations and behaviors for the dozens or even hundreds of characters and rooms with which the player may interact. We present the ScriptEase model of game scripting. This model is pattern-template based, allowing designers to quickly build complex game worlds without doing explicit programming. This is demonstrated by generating code for BioWare's game Neverwinter Nights.