CodingWithTorque

From TDN

This page is a Work In Progress.


Contents

Introduction

The most important thing to realize about Torque is that it is a big, complex system. It is geared almost entirely towards production coding of games. (Torque Game Builder is friendlier, as it was written much more for hobbyists, though we use it for commercial products.) This means that there are a lot of design decisions that don't make sense until you're 12 months into development and you have to track down a particularly heinous bug...

It is also really, really complex. 494,000+ lines of code.

This document explains how to code with Torque - the philosophy that's going to help you get the most out of the engine.

Understand Before You Change

Often, the problem you're addressing has been solved in Torque before. Make sure you check to be sure you're not reinventing the wheel! The best way to check is to do some searches through the resources on the main GarageGames website.

Literate Coding

Literate coding is the difference between reading a comment that says what some code does, and reading the meaning of the code directly from the code itself.

Asking Questions

You will ask questions.

This is a fact of life when developing with Torque. It's big and complex - nobody can keep it all in their head, even smart guys who work with it full time.

So, make sure you're asking questions that will get answered! ESR has an excellent guide to asking questions of engineers, the smart way.

Is there a link to ask questions?


The best place to ask questions are on the GarageGames Forums. Be sure to post any specific code in the Private forums! It is against the EULA (that you agreed to) to post any of the code (that you didn't write yourself) anywhere else.

Link to all forums on GG.

Tools

You need a good text editor and a find-in-files tool. Visual Studio with Visual Assist is one good choice. You also need a good merge tool - Beyond Compare 2 is excellent. So are Arraxis Merge, and WinMerge.

A recommended text editor for Mac OS X is TextMate.

Learn how to use source control. CVS and Subversion are both free source control systems. If you plan to use Subversion, or would like to learn more about the advantages of Subversion over CVS, then the Subversion Book is a great place to start. In addition to been a published book, you can also read it for free online or download it in pdf format.

Doxygen is extremely helpful for generating the documentation for your Torque project. You can also use it to

generate_the_Torque_documentation_in_Windows_Help_file_format_(chm)