Using the Torque Demo Application

Overview

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.

Running the Application

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:

color="#000000"> 
       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:

color="#000000"> 
       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.

Torque Demo Command Line Arguments

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

-fullscreen

Run in fullscreen mode

-windowed

Run in a window

-noSound

Disable sound

-openGL

Use the OpenGL driver

-autoVideo

Autodetect the video driver

-prefs

Load the given config file

-dedicated

Run as a dedicated server

-mission mission

Load the given mission.

-connect address

Connect to a server

-log level

Set the log level = [0,1,2]

-mod modName

Load the specified mod

-game gameName

Load the specified game, clears all previously loaded mods

-show [file.dts]

Start the show mod and optionally load the specified file

-console

Start up a separate console window

-jSave file

Record a journal

-jPlay file

Play back a journal

-jDebug file

Same as jPlay, except that a debug break (int3) is issued when the journal ends

-help

Display this help to the console



Key Bindings

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

w

Forward

s

Backward

a

Left

d

Right

space

Jump



View Control

e

Zoom

r

Set Zoom FOV

TAB

First/Third person

alt c

Toggle between camera and player



Chat Messaging

u

Send public chat message

y

Send team chat message



Misc. Functions

F1

In-game help dialog box

F7

Switch control to the player and position him at the camera

F8

Switch control to the camera and position it at the player

F9

Toggle between outline, interior debug, and normal rendering modes

F10

Toggle the Gui Editor

F11

Toggle the Mission Editor



Games and Mods

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:

color="#000000"> 
       cd c:\torque\example
        torqueDemo -game fps
        torqueDemo -game fps -mod show
               


In-Game Tools

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:

Mission Editor

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.

GUI Editor

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.

Show Tool

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.



Application Directory Tree

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

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 .

\client

Basic client support scripts include client->server communication

\debugger

Support scripts for the in-game script debugger

\editor

Support for in-game tools

\help

Client help dialog box pages

\lighting

Textures used for run-time, multi-pass dynamic lighting

\server

Basic server support scripts including server->client communication

\ui

Misc. GUI controls and textures used by the in-game tools.

\fps

Fps contains the scripts, art and missions that implement the example first person shooter game.

\client

Client user interface and game scripts

\data

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.

\server

Scripts which implement the actual fps game run by the server. This directory is only accessed by dedicated servers and clients which hosts games.



\show

A mod which contains all the user interface and scripts which implement the Show Tool.