[In this technical article, complete with free-to-download tools and scripts, Sony Online's Thornblad explains his 3DS Max function library and tools, a light mapper and polygon unwrapper, originally created for MMO PlanetSide.]
Nearly eight years ago I moved to St. Louis, where SOE had established a small satellite office, to work on a new game project that was still in the research and development phase.
It was to be a massively multiplayer online first-person shooter, or MMOFPS, on a scale beyond anything I had worked on before. Because of this, it was going to require strong organization and efficient processes in art development.
I had been using MaxScript in personal projects for a year or so, but my knowledge was pretty rudimentary and limited to little more than macros for accomplishing repetitive tasks. The needs of the project presented an interesting challenge that inspired me to spend many late nights teaching myself the 3ds Max scripting language in depth.
When I started work on PlanetSide, there was a basic engine up and running with terrain, skies, objects, and characters. All these components would undergo a great deal of work over the next three years, since they were in fledgling form, but two main graphics components were completely missing.
At the time, there was no graphical user interface and no component for handling building structures and interiors. I was approached to help with R&D on the latter portion. This grew to become my focus on the art and tools side for the majority of my time on the project.
The original intention for construction of building interiors was to use QRadiant, a popular level building tool of the time, because there were a couple of level design enthusiasts on the project who were familiar with the program.
The problem was that the output was a rather messy collection of triangles in a hierarchically arranged format called a BSP tree. BSP (binary space partitioning) trees were useful for interior level-based games such as Doom and Quake because they represented all of the environmental geometric data and were suitable for the graphics hardware available at the time when those games came out.
In a massively multiplayer game, however, the interior levels needed to be seamlessly connected to a larger world represented by a different set of data. Since the BSP tree data was useless, it would need to be converted into geometry.
But because the process that generates the tree splits polygons, the resulting triangle count would be much higher than was needed to represent the model and thus be very inefficient. As an R&D test, I was asked to reconstruct a model in 3d Studio Max that was originally built in QRadiant.
Creating the model was a simple enough task. It was a matter of matching existing high polygon geometry with a lower polygon representation, similar to building an LOD (level of detail) model.
The main difference is that since the high polygon version was "high" only because triangles were unnecessarily split (a result of the BSP, not artistic decision making), there was no reason to expect the new model to be of lesser quality than the original.
The more challenging aspect of the test was to create the light maps, or textures that represent the static lighting in the scene. This was the most common method used to represent interior lighting back then, but level design tools generated them internally using placed lights. We needed to be able to create the maps in 3ds Max. Fortunately, a little web research turned up a plug-in for 3ds Max called Luminaire.
Luminaire was a radiosity-lighting plug-in designed primarily for architects who wanted something closer to real world lighting than what was available in native Max, but it also had a feature for rendering light maps that proved very useful. The mapping coordinates used for generating light maps are normally unwrapped automatically inside the level building tool, but they had to be created by hand for the R&D test.
Lighting was done inside 3ds Max using standard omni and spot lights, then rendered via Luminaire into texture maps similar to the ones that had been produced for the original model in QRadiant.
The result of the test was a model of a building that looked as good as or better than the one produced in the level design tool, but using approximately one-tenth of the number of triangles. The caveat was that the process took considerably longer than creating levels in QRadiant and needed to be made a lot more efficient or it couldn't be used in full production.