Torque Game Engine DocumentationVersion 1.3.x |
The Torque test application, torqueDemo, provides a simple foundation for creating network multi-player games and mods as well as support for the in-game tools . The current example game is a first-person shooter (fps) death-match game which is loaded by default.
The example fps game is meant to exercise some of the Torque Engine's basic functionality. It is not meant to be a complete demonstration of the Torque Engine's capabilities, nor a thorough example of it's many features.
Before running the demo application, make sure your system meets the Torque Game Engine system requirements for your platform: Windows, Mac OSX, Linux.
The torqueDemo test application must be executed from the /torque/example directory which is the root of the example resource tree. The /torque/example directory is completely self-contained: it holds all the scripts, art and other data needed to run the test app. Running the app. from the command line:
cd c:\torque\example
torqueDemo
The demo app may be run in two modes: with or without the client interface. Running the client graphics interface is the default behavior. Running the app in "dedicated" mode skips the graphics and client interface initialization. This mode is used to run dedicated game servers and consumes less resources, but is not directly playable. You must connect to a dedicated server using another instance of the test app running in client mode. To enter dedicated mode using command arguments, type the following at a command line:
cd c:\torque\example
torqueDemo -dedicated -mission fps\data\missions\test1.mis
Games (servers) can also be hosted through the client interface, and a client may play the game being hosted.
Note: for Mac users, command line arguments can be placed in a text file called maccmdline.txt in the example directory.
torqueDemo [-fullscreen] [-windowed] [-noSound] [-openGL] [-directX] [-voodoo2] [-autoVideo] [-prefs file] [-dedicated] [-mission mission] [-connect address] [-log level] [-mod modName] [-game gameName] [-show shapeFile] [-console] [-jSave file] [-jPlay file] [-jDebug file] [-help]
Command Line Parameters
The following list details some of the default key bindings used in the demo fps game. The script file which binds these keys can be found in the torque/fps/client/scripts/default.bind.cs file.
Movement
View Control
Chat Messaging
Misc. Functions
The test application is designed to support multiple games, each possibly running multiple mods (mods are 3rd party modifications). This is possible because the C++ game code contains a flexible set of core features (such as GUI controls, player movement and animation, etc.) which are all controlled from the scripting language. Thus, new games can be implemented with Torque by simply providing new scripts and art.
Games and mods are organized into application level root directories and can be explicitly loaded from the command line using the -game name and -mod name command line arguments. Only a single game can be loaded at a time, but multiple mods may be loaded on top of a game. When a game is loaded it only has access the common directory, which contains core scripts and data shared by games, as well as it's own directory.
Examples of loading games and mods:
cd c:\torque\example
torqueDemo -game fps
torqueDemo -game fps -mod show
A number of Torque Engine tools are built in to the test application, and subsequently into any game that uses the example application's basic infrastructure. These include:
The mission editor is the primary tool for creating and editing mission files. The editor is comprised of several sub-components including a World Editor which includes an object creator, object inspector and mission area editor, as well as a Terrain Editor which includes a height field editor, terrain generator and rule based texture painting tool. Mission can be edited on-the-fly: when in a mission, the editor may be activated using the F11 key.
The GUI Editor is used to create and edit in-game GUI screens. This includes the mains startup screen, pop-ups, dialog boxes, etc. GUI screens can be edited on-the-fly. The editor is activated using the F10 key.
Though Show is not strictly an in-game tool (in that it's not activated while playing a game), it's listed here because it's implemented as a " mod ". The show tool is used to load and test DTS files. The tool provides a number of dialog boxes for testing shapes include running animation threads, testing details levels, etc.
The c:\torque\example is the root of test application and contains all the scripts, art, and other data need to run the test app. Except for common, directories in this application root represent loadable games and mods .
Located in the c:\torque\example directory:
Common is not a true mod or game, but actually contains the script infrastructure used by games, as well as the scripts and data needed to run the in-game tools .
Basic client support scripts include client->server communication
Support scripts for the in-game script debugger
Support for in-game tools
Client help dialog box pages
Textures used for run-time, multi-pass dynamic lighting
Basic server support scripts including server->client communication
Misc. GUI controls and textures used by the in-game tools.
Fps contains the scripts, art and missions that implement the example first person shooter game.
Client user interface and game scripts
The root of the data tree which is shared by the client and server. This includes buildings, mission files, shapes, textures, skies, sounds, terrains and water.
Scripts which implement the actual fps game run by the server. This directory is only accessed by dedicated servers and clients which hosts games.
A mod which contains all the user interface and scripts which implement the Show Tool.