Interview With Steve Moret
Greyhawk: Temple of Elemental Evil is a PC role playing game that implements the
Dungeons and Dragons Third Edition rules inside the popular Greyhawk
campaign. The game was published in fall of 2003 by Atari. Steve has agreed to an
interview on the use of the Python programming language in this game.
Steve, thanks for taking the time for this interview. The first
question on my mind is; what was the deciding factor to go with Python?
Was it a matter of personal taste, or was there a larger comparison and
analysis?
Coming off of Arcanum, which used an internal scripting language (an opcode based system that used a GUI tool used to select language constructs), we wanted something that could give scripters more power to do complex tasks, yet still minimize the chance of user introduced errors. In my search for this programming holy grail, I looked at Python, Small, and Lua, and finally decided upon Python because of its simple syntax, its integrated high level language constructs (tuples, classes, exceptions, and serialization), and its ease of integration into our code base. I have to admit, my prior Python experience gave it a bit of a bias, but I always say go with what you know. And we did.
There are worthwhile alternatives available. Were you confident in
Python from the start, or was there a "backup plan" during development?
Once a lot of scripts started going in we knew there was no way we could back out of using Python. As time went on, we were worried a few scripts which had to be called very frequently (in one case every game frame) would slow things down. Because of that we kept the existing opcode system around in case we needed to write performance critical scripts. When we shipped every script was written in Python. Python's performance never became an issue.
As the game progressed, did the development team find itself using
Python for different roles than it was original chose for? Was Python
able to be used outside the game itself, for tasks like data management
or testing frameworks?
I frequently used Python to run menial build tasks (recompiling art files or reorganizing files into new directories), or to enumerate complicated data sets.
For example, our lead artist wanted a sound system where every weapon type (we had nearly 80, later cut back to about 20) was supposed to have a different sound when it hit each material type (of which we had about 10). Our sound engineer was going to generate all these sounds as he could, but in the mean time we wanted place holder sounds, mostly so we could detect when one was missing. So I found a text-2-speech package, and used Python to build all 800+ sounds based upon the weapon/material type. What would have taken someone hours (if not days) of cut/paste/rename was generated in a few lines of Python.
In the right environments, just about anyone can learn to use Python
for specific tasks. Was Python used by any of the staff outside the
programming team?
All the dialog writers used Python expressions to handle which dialog lines were available to people, and the artists wrote simple Python statements to emit particles or trigger visual effects during specific frames of animation. In the end, I'd say over 1/2 of the team had touched Python code at some point through the course of the development of the game.
I see Python is already being used for your next title under
development. How have your feelings about Python changed since when you
started using it in Temple of Elemental Evil?
For the most part, I'm happier with Python than when I was on Temple. Mostly, because I've figured out all the annoying nuances and pit-falls that caused us trouble. Now, people turn to me like I'm some kind of Python guru, when really I've just wrestled with it long enough to know what is really going wrong behind the scenes.