Torque Game EngineTorque Game Engine Documentation
Version 1.3.x

Scripting vs. C++

Development with Torque assumes some level of familiarity with basic computer programming concepts. These tutorials are not designed to teach developers the basics of C++. There are, however, many excellent books available on this subject for those who do need to brush up.

Even though the engine is written in C++ and Assembly, most of your game will be programmed in the Torque Scripting Language denoted by files with the (*.cs) extension. The advantages of using a script language instead of coding everything in C++ is that your game does not have to be re-compiled every time you make a change, it's a more targeted, higher level game language than C++, and you don't have to worry about memory management. A popular misconception is that scripts are slow, this is not necessarily true. Torque Script is compiled into byte-code before being executed and is surprisingly fast. While C++ code will always be faster, the flexibility of script is superior for most gameplay related functions.

We feel that the key to success in programming a game using Torque is to understand how to use the scripting language. This is covered in depth in the Scripting Chapter

Once you get a feel for the scripting capabilities of Torque Game Engine you can start to think about what you might want to do in C++ code. Generally, we try to code as much as possible in the scripting language, then move speed dependent routines into C++ where they can be called from script. The other major information on editing the C++ source can be found in the coding section of the documentation. There is also extensive documentation within the engine code in the form of code comments.