I love the fact that the DarkSpore developers are so willing in sharing with us their developer secrets!  I wish more studios would follow suit!  Source is from the DarkSpore forums and brought to you by MaxisAlex.

MaxisAlex here, one of the gameplay engineers on Darkspore. I wrote this article for those who are interested in the process we go through to create a non-player character (NPC). It’s surprisingly quick and fun!


An NPC in the editor

It starts with a kickoff meeting with the artists, the engineer, and the designer. The designer describes what the NPC is supposed to do in the game, how it behaves and what kind of abilities it has. There is often a discussion at this point about how to create the more complex abilities, such as what animations and effects will be needed.

The artists then go to work: first the character is made in a variation of the creature editor which you are all probably quite familiar with, but with lots of new parts made just for Darkspore. The character model is handed off to the animator, who uses it to make animations for each of the creature’s abilities. Unlike in Spore, where the animators had to make animations that worked for all sorts of crazy shapes, the animator can make an animation that really looks good for a specific character. In the meantime, the effects artist is busy making all the beams, rockets, explosions, and auras that make the battlefield so active.


Checking out the NPC in the test level.

Once all that is done, the engineer sets to work gluing it all together. First, a text file is created which describes all the characteristics of the NPC, including which character model it uses, what abilities it will use, and what order it prefers to use them in. Next, a Lua object (Lua is a scripting language) is created for each ability. The object includes not only data about that ability such as range and which icon represents it in the UI, but also the actual instructions for what to do when it activates. The Lua script uses a library of functions built in C++ (another, faster language) to determine what happens at a high level. For example, the Lua script might say: play the casting animation, trigger the ice aura effect, put a five-second slow on all enemies in five meters. It’s up to the faster C++ code underneath to run that animation, draw all the particles in the ice aura, and make a list of all the enemies nearby. Working in Lua allows us to change the behavior while the game is still running, which speeds things up a lot.

That’s about all there is to it! Once the engineer is finished, the NPC will be examined in the game at a twice-weekly meeting, and we’ll make a list of changes for the next meeting. The process continues until everyone is satisfied. This sort of iterative design is a common practice at Maxis.


Testing the NPC in Zelem’s Nexus