Torque Game Engine DocumentationVersion 1.3.x |
A complex, modern game engine has to work with many third party tools and editors to get data, models, and art into the game, and the Torque Game Engine is no different. Below are some of the tools you will need to help construct the assets necessary to build a game with Torque.
To edit script files you'll need a fairly powerful text editor. There are many options available to you but GarageGames recommends the use of jEdit. jEdit is a Java based text editor with some powerful features, many of which will come in handy when editing your scripts for Torque. One of jEdit's most powerful features is its plugin backend which allows you to download new plugins without ever leaving the editor. jEdit is also free and since it's built on Java it is cross-platform as well.
TIDE plugin for function browsing, and script debugging of TorqueScript in jEdit
To edit C++ code and to compile the engine, you will need a compiler appropriate to your Operating System. The recommended applications for each OS are listed below.
Microsoft Windows: Microsoft Visual C++ 7.1 (.NET 2003)
Mac OS X: XCode
Linux: Eclipse or GCC
Documentation on compiling on Windows, Mac OSX, and Linux is available. Project files for each of these compilers will be downloaded to the root torque directory when you install the engine SDK.
Creating a game that is both visually appealing and performance-friendly is one of the greatest challenges of game design. Torque enables you to work with several kinds of art assets to ensure optimal performance while maintaining the highest quality visuals.
For many games, the most important art assets are 3D models. The Torque Game Engine offers highly optimized support for three entirely different kinds of 3D models: terrain, interiors, and detailed shapes. Each of these kinds of models is created in a different way.
Terrain is the basis for the large outdoor areas seen in many Torque games. Torque represents open landscapes using a heightmap to determine elevation, and can blend up to 6 textures together over the terrain's surface. Terrains are edited in-game using the built-in Mission Editor. To learn more about this area, read the brief synopsis below and then head to the full Mission Editor chapter in this documentation.
Interiors define large objects, such as buildings, and spaces that players and entities can move around in. These interiors are stored in a format called DIF, which utilizes a Binary Space Partition (BSP) collision scheme, similar to that found in any Quake-based game engine. DIFs can be created using QuArK or any other Valve 220 format .map editing program. For a brief intro on building interiors, see below; or skip right to the QuArK chapter in this documentation.
DTS Shapes are smaller, more detailed objects than those you would build with the DIF format. Examples include player models, weapons, vehicles, and other detail objects such as trees. This format allows incredible detail and complex animation capabilities, but simplifies collision to a bounding box and a few convex brushes. DTS objects can be exported from a variety of modelling packages such as Blender, Maya, and others. See below for an overview description of each of these tools, or follow the preceding links to go to dedicated chapters on each.
Textures for these 3D objects can be created in BMP, GIF, JPEG, and PNG. Alpha channels are supported for PNG textures on DTS shapes. There are many image editing programs available for each platform.
In addition to 3D art assets, games need Graphical User Interfaces (GUIs) to describe menus, Heads-Up-Displays, and more. Torque comes with a robust GUI editing tool. Once again, you can see below for a brief overview, or skip right to the detailed GUI Editor chapter in this document.
Let's take a quick look at each of the tools mentioned above.
As described above, the Mission Editor is an in-game tool encompassing a couple of editors tightly integrated with each other which provide the backbone for creating the various unique areas for your game. The major components of the Mission Editor are the world editor, terrain editor, and terrain generator. The world editor is WYSIWYG based allowing you to construct, place, size, scale, and rotate objects. The terrain editor and terrain generator allow you to create beautiful, unique worlds employing tools such as fractal heightfield based terrain generation, rule based fractal terrain texturing, and the ability to very finely manipulate terrain.
Check out the GarageGames Mission Editor chapter in this documentation for more information on this powerful tool.
These editors focus on construction of BSP-style interiors. They have very specialized tools for creating and editing convex brushes and precise texture mapping tools. When used in conjunction with the Map2Dif utility that comes with Torque, these editors can be used to create buildings, and other large structures.
Originally developed to create levels for Quake, the Quake Army Knife, or QuArK as it is called, is an open source product freely available. GarageGames community member Desmond Fletcher has represented the Torque Game Engine community in the QuArK Development Community as well as providing many tutorials for using QuArK with Torque. The guides below will help you get started with creating interiors in QuArK.
Of course, any BSP editor that can export to Valve 220 format .map files can be used with Torque. At this time there is no native .map editor available for the Macintosh platform, though QuArK will run under Virtual PC 6.
Torque uses the DTS format to store and render detailed, small shapes that are visually complex, but simple in terms of collision and other interaction with the environment. Examples of this would be the player model, items or pickups, vehicles, and weapon. All of these items are very detailed, but for the sake of efficiency and processing speed, use relatively simple schemes for interaction with the environment. The DTS format is supported by several 3D modelling programs.
Below are the main tools available for exporting DTS models to the Torque Game Engine.
Torque fully supports Blender, the powerful, open-source modelling tool. Blender is available for Linux, Macintosh, and Microsoft Windows, and it's free! The Blender exporter allows you to take advantage of all DTS features.
MLK; is a simple PC-only modelling tool created for use by developers making mods for Half Life and Quake. MilkShape is inexpensive, with a free 30 day trial period and a registration cost of only $20. Bringing MilkShape models into the Torque Game Engine requires the use of the ms2dtsExporter.dll, provided with Torque, to handle the exporting. Below are a few links to help you get started with MilkShape.
3D Studio Max is a very high end modeling and animation editor that costs around $3,500 per user. It is complex and powerful, but if you are going to use 3D Studio Max you already know all of this. Bringing Max models and data into the Torque Game Engine is a complex process. This is mainly due to the fact that Torque supports so many powerful animation capabilities, including blended animations with bounding boxes and Level of Detail (LOD) processing. A 3D Studio Max plug-in, max2dtsExporter.dle, provided with Torque, handles the exporter work. Please refer to the excellent tutorials and explanations below for further assistance:
The GarageGames community is in the process of creating exporters for several modeling programs, including Maya and Lightwave. An official Maya exporter will be completed soon, as will a gameSpace/trueSpace exporter from Caligari.
As mentioned above, each of these model types has strong texture support. Torque can load textures from BMP, GIF, JPEG or PNG formatted files. Any program capable of writing to these formats can be used to edit textures. Popular software includes Adobe Photoshop, the GIMP, and Paint Shop Pro.
The GUI Editor is an in-game tool designed to ease the process of creating intuitive interfaces for a game. What is especially important is that this is an in-game tool, which provides immediate feedback about the design as it is being created. It is possible to create very complex interfaces with the GUI Editor even though the editor itself is relatively straightforward and easy to use. GUI files in the engine are normally saved with the extension (*.gui) but it is still possible to describe a GUI in normal script (*.cs) files.
Describing the interface in script uses the same syntactical rules as does any other script in Torque, so it is necessary to have a basic understanding of Torque Script to be able to utilize the GUI Editor and the GUI system in Torque to its fullest extent. See the GarageGames GUI Editor Introduction to get up and running with the GUI Editor as quickly as possible.