Torque Engine Reference

Torque And The Engine Reference

Torque is a large piece of software. Chances are that most of the applications you have worked on up to this point have only been a fraction of the size of Torque. This reference manual has been created in order to give you - be you a beginning developer or an experienced C++ programmer or somewhere in between - a step up on manipulating and extending Torque.

This document serves two purposes. First, it provides an introduction to many of the concepts and architecture underlying Torque--you could spend literally hundreds of hours browsing the class hierarchy in Torque; the Engine Overview makes it much easier to focus on the structure of the code, instead of drowning in the details of source files.

Second, it contains explanations and examples so that you can effectively work with Torque. It acts as a guide to the engine, so that you can save yourself time when you're looking for a solution to a problem. It also helps you do things the Right Way - so that you don't overlook anything, saving you debugging effort later (and making your game more efficient).

Note:
The Engine Overview documents are aimed at C++ developers and people looking to familiarize themselves with the general architecture and concepts of the C++ engine. If you are looking for more specific help with the Tools, Art, and Scripting please feel free to use the Table of Contents on the left to browse to your specific area of interest.

What Do I Need To Know?

It would be great if it were possible to buy Torque and without any prior knowledge start making incredible, technologically ground-breaking games... but sadly, that's not possible. Writing game engines is an advanced skill. Luckily, Torque is already written. All you need to do is start building off of its foundation.

So, what you do you need to know to develop with Torque? You need to be able to read C or C++ code. You should be familiar with basic datastructures, like vectors, linked lists, trees, and queues. You need to be comfortable with pointers and memory management. A familiarity with linear algebra, or at the least the basics of 3d graphics, will be important, as will an understanding of network protocols and file I/O.

But, you say, wait, I didn't pay much attention in Linear Algebra (or I haven't taken it yet)... I don't like data structures... or maybe you're just a beginner programmer. Am I stuck up the proverbial creek without a paddle? By no means! You have in your posession one of the best educations in programming you could hope for. You will learn something by working with Torque. Just stick with it - post on the forums and hang out on IRC - and you'll find yourself quickly learning more than you ever thought possible. When I started working with Torque, I thought I was a good C++ programmer - but I have easily doubled my C++ knowledge by working with it.

Don't give up. Keep your wits about you. Go for a walk when you start seeing SimObjects dancing before your eyes. You're going to be fine!

What Do I Do If The Docs Are Incomplete?

Torque is, as we've mentioned, a large and complex body of code. Though we have made every effort to accurately document all the code in the engine, it is entirely possible you will encounter undocumented, incompletely documented, or just plain wrong documentation.

This is OK. Here is how you deal with this:

  1. Figure out what is going on. This means you need to open the source files and read through them, see how the code is interrelated. Take notes, and map out the function calls that are made, and the data structures that are used.
  2. If you have questions, seek out wisdom on the GarageGames IRC channel, or the User Forums. There are a lot of people out there who have probably encountered the same or similar problems. For best results, make sure you've put some thought into the problem - make a real effort to solve it on your own. People are always more willing to help if they can see that you've put forth serious effort and run into problems.
  3. At this point, you've hopefully solved your problem. If not, repeat steps 1 and 2.
  4. Now that you understand what's going on, add documentation to aid those who come after you! GarageGames hosts the user managed Torque Developer Network, a wiki designed to allow all Torque users to contribute back to the community.