General:Kerry Sergent: Smart Guys
This is a developer diary for The Elder Scrolls III: Morrowind. The original diary can be found here.
Kerry Sergent, Programmer
Hi, my name is Kerry Sergent and I've been with the Bethesda Softworks' Morrowind team for about eight months now. Prior to coming to Bethesda, I was with Sierra On-Line and Interplay for about 11 years combined. My job at Bethesda is to provide the characters, creatures, and inhabitants of the fascinating world of the Elder Scrolls with artificial intelligence to make them come to life in interesting and entertaining ways for you, the Elder Scrolls fan. Bethesda's Elder Scrolls series has been an inspiration to me from the very first inception with Arena, so it is quite an honor for me to be involved in this project. Arena was a magnificent game in its time, and I have no doubt that Morrowind will continue in that fine tradition with many groundbreaking accomplishments. Already, as I've watched the development proceed, I must say the epic proportions and depth of this game will be difficult to rival. And, with any luck, I should be able to present you characters in the game with lifelike behaviors and activities that will both surprise and challenge you.
Consider, if you will, that the AI (the common acronym for Artificial Intelligence) is the very life of the game, and you can begin to appreciate envision the complexity which these characters must possess. The entire purpose of these non-player characters, or NPCs, is to entertain you for hours on end -- to interact with you, to provide challenging quests, conquests, to provide the backdrop of the story, and play their parts tirelessly. This is a fairly substantial task as you might imagine. The challenge in developing the AI is not necessarily in how powerful an opponent can be constructed, but rather how realistic and in-character their behaviors seem to the player. This adds to the sense of immersion in the game, taking you right into midst of the action in the Morrowind fantasy world. One thing I would like to make clear is that everyone on the Morrowind team has contributed greatly to the creature and character development in the game and without them, my job would be impossible. Designers, writers, artists, and all the various engineers working on the collision system, game editor, and animation engine have all played huge roles in bringing these characters to life.
To give you a brief, simplified overview of the AI methods used in the game, I can tell you that the Morrowind system consists of four primary types all integrated into the game editor:
1. The State Machine
In Morrowind, a state machine handles many of the NPC actions. The NPC actions are based on a no-priority queued system of "packages." Using these, a designer can assign various pre-engineered tasks to an NPC -- such as wandering or following -- in addition to movement states that the NPC will perform automatically as conditions call for them. Examples include how and when to fly or swim, and how to communicate between themselves. This final capability adds greater depth to grouping behaviors and responses from other characters throughout the game.
2. Rule Based
Rule-based logic takes over in combat and helps the NPC determine optimal range, target, weapon, and spell selection. This logic evaluates various capabilities and stats such as fatigue, encumbrance, attributes, and skills, and applies these factors to the decision-making process.
3. Random Generation
Not all actions are derived from strict interpretations of rules and states. To add variety to behaviors, some degree of random element is rolled carefully into the mix.
4. Scripted
Another important method used is one in which a game designer can directly alter the standard behavior of a character by writing scripts, or simplified code commands. This gives us the ability to custom tailor the characters with dialog and behaviors far beyond the generic handling.
Pathfinding is one of the key elements of AI and manages the basic ability of the NPC to move through the world . Morrowind essentially uses two forms of pathfinding: The AStar algorithm is a common, but effective and efficient, path-finding algorithm enhanced in Morrowind with the use of pre-generated grids. The grid paths and points can be modified in the ES Construction Set quite easily. Whether the developer wishes to add points and paths, or remove them, this can be readily accomplished using the construction set. Once in the game, the characters use various turn-smoothing routines and dynamics to give them more "life-like" motions when they travel along these paths.
Also incorporated in the game is a robotic sensor system, which gives the characters their only sense of "sight". Potentially there are many areas that are not mapped with grids, or cases where the NPC must navigate outside of an existing grid. They then switch to this robotic form of obstacle detection. This helps them identify areas where they can safely navigate and more or less stay on a clear path through the game environment.
I believe that this diary entry has become overly long, so I'll conclude here. I truly hope that you have as much fun with "my" creatures as I have had in making them, and that as a result your game experience is unsurpassed!