| |
|
|
||||
![]() |
||||||
| |
|
|||||
|
Scripting a Game Editor for Max The speed at which you can create new tools using MaxScript is impressive. Furthermore, MaxScript is not just limited to building plug-ins. The language has an object-oriented design that allows you to override and extend the provided objects. Since all of the objects inside Max are exposed to the scripting language, it is possible to create special cameras, materials, or geometric primitives that have customized values and methods associated with them. Using this feature one could build a custom toolkit to create AI paths, place enemy troops and place pickups in the environment. It would be a simple matter to build an entire game editor into Max, and even to have it communicate with your game engine while both applications are running. I took advantage of MaxScript’s extendable objects to create a custom camera that only exposes the parameters that my game engine supports. In this regard, it looks and acts in Max exactly the way it will inside the game engine. I’m looking forward to overriding the material editor to do the same. It should be possible to make the rendered output from Max look nearly identical to the game engine screens. This will allow the artist to make adjustments to the art before passing it through the rest of the art path, saving time and energy. It should also be possible to associate material characteristics, such as flammable, inside the material editor and save the information into a database that the game loads. Although it is not clear whether or not your entire game editor could be written in MaxScript, I haven’t found a reason why it wouldn’t be possible. MaxScript is capable of shell launching applications, such as your game engine, with a command line pointing to the file to be loaded. It can also use OLE to communicate with the game engine once it is running, provided you write a COM interface to the engine. I have not tested this, but the Discreet technical support staff claims it is very similar to using Microsoft Visual Basic, which in my experience has been very easy to learn and use. Next up, a Game Editor After using MaxScript for a few days it became clear to me that the next game editor I write will probably be built into Max. Recently, an artist I work with asked me to write a tool to simplify a repetitive task he was doing in Max. He was quite surprised when I mailed him a script in a matter of hours. This kind of turnaround saves time for the artists and the programmers, and is worth its weight in gold as part of a 3D-development effort. When this ease of use is combined with the fact that the pre-existing tools in Max can be used to work with objects, overall development time should be greatly reduced. I have heard stories that MaxScript was tossed into Max 2.0 at the last minute, and became more popular than expected. With 3.0, much of the product’s user interface has been implemented in script, which goes to prove how much Discreet has embraced the early success of this design. It will be very interesting to see how many features will be added to Max 3.0 by the user base, who will no doubt be creating and distributing scripts on the Internet. This group will help ensure that game developers who commit to this development path won’t be left in the dark in a year or two. When you consider how affordable Max is, and how powerful Discreet has made this new version of MaxScript, it is clear that many new game editors and game development tools will be built using this technology. Wyeth Ridgway has an extensive background in 3D graphics, networking and project design. After studying Computer Science at the University of Arizona, he left to become the Technical Director of Ferris Productions, where he worked extensively with virtual reality simulations. Several years later, Wyeth realized he wanted to develop games for the PC market, and moved to Seattle to become Technical Director of Zombie. In 1998 Wyeth formed Leviathan Games to pursue his long-term goal of creating real-time 3D massively multi-player Internet games. Wyeth has had several articles published on game development and has over a dozen products released. For Further Information: 3D
Studio Max 3: Learning
to Use MaxScript (tutorial): |
|
|