Torque Intro
From TorqueWiki
Contents |
[edit] Links
[edit] Tutorials
Super Simple Torque Demo Submitted: Dan "Nerseus" Jones (Feb 03, 2004) Categories: Scripting Code File: supersimpletorquedemo.zip http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5162
[edit] edu
An other Torque Wiki: http://www.gametheory.ch/index.jsp?positionId=13696
http://www.stewart.cs.sdsu.edu/cs596-3dprog/lecs/
mission loading: http://www.stewart.cs.sdsu.edu/cs596-3dprog/lecs/ch7-commonScripts.html
http://www.torqueschool.com/index.php?option=com_contact&Itemid=3
[edit] Games done with Torque (TGE)
http://www.theatomizer.com/ATOMIXWorld/AW.php
[edit] TGE Overview
[edit] Why use Torque
http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/759584/page/0/fpart/all/vc/1
- Torque scheint um einiges flexibler, besser durchdacht und leistungsfähiger als A6 zu sein, damit ist es aber auch etwas anspruchsvoller.
- Nehmen wir als Beispiel das Modellformat. In dem DTS Modellformat kann man extrem viele Optionen integrieren. Du kannst mehrere LOD Stufen in dem Format speichern (bis hin zu Billboards). Du kannst dem Format mitteilen, welche Form von Kollision es haben soll (Box, Zylinder usw.), Du kannst aber auch einfache Meshes des Modells als Kollisionsmodelle nutzen. Somit könnte in dem Modell eine vereinfachte Version des Modelles als Kollisionsmodell enthalten sein.
- Mehrere UV's und Texturen sind auch in einem Modell möglich.
- Mit sogenannten "Nodes" kann man Bones simulieren und Charaktermodelle animieren oder man kann den Nodes andere Objekte "mounten" wie bei Fahrzeugen die Räder.
- Es gibt sehr viele Exporter für das DTS Format und die sind sehr leistungsfähig. Das geht von den großen Tools auch über günstige wie Milkshape, Blender usw.
- Level kann man direkt im Spiel anpassen. Terrains sehen durch Detailmapping sehr gut aus und sind riesen groß.
- Der Renderer ist sehr schnell.
- Die Beleuchtung ist gut und statische Lightmaps können per Knopfdruck neu generiert werden und auch für große BSP Interiors dauert das nur Sekunden.
- Der Torque-Constructor ist ein sehr gutes Tool. Es ist sowas wie World Editor (WED), fühlt sich aber an wie eine Mischung aus Hammer und Lightwave. Damit ist es effizienter, schneller und hat weniger Probleme. Während hier im Forum jeder 2. warnt, dass Du kein CSG Subtract nutzen darfst, ist mir im Constructor damit noch nie ein Problem aufgetreten. Das Subtract verschiebt keine Texturen und die Geometrie ist effizient, die danach entsteht. Auch mit Einzelteilen baut man das nicht besser auf.
- Zudem kann man nicht nur Punktlichter, sondern auch Spot-Lichter nutzen. Zudem haben alle Lichter 2 Wirkungskreise für den inneren und äußeren Falloff. Das Licht nimmt z.B. quadratisch ab, was realistischer ist als lineares Licht.
Auf Knopfdruck siehst Du sofort die Schatten, kein Kompilieren und Engine-Starten nötig wie in WED. Die Bedienung ist durch die intuitive Kamerasteuerung um ein Vielfaches schneller als in WED. Du kannst ständig durch das Level sausen, ein Objekt markieren und loslegen. Man kann auch mehrere Texturen gleichzeitig bearbeiten usw.
- Die Script-Sprache von Torque ist leistungsfähiger und aus meiner Sicht übersichtlicher. Sie ist auch C-ähnlicher, aber die Befehle klingen für einen Einsteiger sinnvoller. Sie heißen nicht VecForIrgendwas, sondern haben Namen, die sofort erschließen, was sie tun. Es gibt eine Art SED, die heißt Torsion. Objektorientierung machen die Sprache übersichtlicher und leistungsfähiger. Der Verzicht auf Pointer und Adressen macht es sicherer. Speicher Leaks sind nicht möglich.
- Die neue Advanced-Engine mit den flexiblen Shadern scheint sehr vielversprechend und leistungsfähig zu sein.
- Wicht erzählte mir, in dem Torque-Buch steht, dass ein Anwender mal alle Quake2 Level in eine einzelne Torque Mission gepackt hat und die Engine nicht in die Knie gegangen ist.
- Die Community ist groß. Die Entwickler arbeiten mit der Community zusammen. Viele Leute sind aus der Community zu GarageGames gestoßen und haben dort Jobs bekommen. Somit entstand z.B. das ShowTool aus einem Material-Editor eines Kunden.
- GarageGames veröffentlicht zudem Spiele, betreibt die neue Plattform GreatGamesExperience und ist auch für den Vertrieb von Content-Packs offen. Ich erhalte dort professionelleres Feedback und Verträge als bei anderen Engine-Herstellern, wenn ich meine Texturen dort vertreiben will (ich verhandele gerade mit denen).
- Ein grosser Vorteil von Torque ist ganz klar das Ingame-Editing. Du erstellst Dein Terrain direkt im Spiel. Gleiches gilt für das bemalen des Terrains.
- Ausserdem wählst Du deine Objekte aus und platzierst diese im Spiel direkt. Alles in Echtzeit. Dann drückst Du noch einen Schalter und schon wirft das Objekt Schatten auf andere Objekte ( sofern diese in der Nähe sind ) und logischerweise auch auf das Terrain.
- Das ShowToolPro gibt's auch noch. Wenn Du deine 3D-Modelle als dts-Datei exportiert hast ( dts-Dateien in Torque sind mit den mdl-Dateien in 3dgs zu vergleichen ), hast Du mit diesem Programm die Möglichkeit, den korrekten Export zu überprüfen.
- passt die Geometrie - sitzt die Textur ( gibt es evtl. störende Nähte/UV-Nähte? ) - passen die Animationen - wie sieht die Kollisionshülle aus ... - wie sieht das Modell beleuchtet aus? - usw. ...
- In Torque gibt es auch eine Scriptsprache namens TorqueScript. Diese ist an C/C++ angelehnt und ist objektorientiert. Ich als Delphianer mag ja C/C++ eher nicht so gern, trotzdem komme ich mit TorqueScript sehr gut zurecht.
Natürlich gibt es auch die Möglichkeit, direkt mit C/C++ in Torque zu programmieren. Das ist aber eher etwas für die Profis.
- Ein weiterer Vorteil ist, dass Du dein Spiel auch für den Mac und Linux veröffentlichen kannst. Diese Möglichkeit ist nicht zu unterschätzen.
- Bei Torque sind folgende Produkte und Preise interessant:
- TGB ( Torque Game Builder ) -> ist eine reine 2D-Engine -> Preis 100 USD
- TGE ( Torque Game Engine ) -> eine 3D-Engine -> Preis 150 USD
- TGEA ( Torque Game Engine Advanced ) -> grob gesagt TGE + shader -> 295 USD
- ShowToolPro -> Preis 35 USD
- Tersion ( Script Editor ) -> Preis 40 USD
- Constructor ( kostenlos )
[edit] Features and Restrictions
[edit] Graphics
- TGE uses OpenGL as rasterization layer, primarily for its cross-platform nature and ease-of-use.
- a utility library called DGL that extends OpenGL to support higher level primitives and resources, as well as performing texture management.
- The platform layer is responsible for initializing the OpenGL state. For PlatformWin32 this can include loading a DLL that converts OpenGL calls to Direct3D (OpenGL2D3D.DLL).
[edit] 3D Rendering
Differences Torque -- default OpenGL:
- the coordinate system is set up to look down the +Y axis instead of -Z. This means dgl replaces the call to glFrustum() with a call to dglSetFrustum().
- Torque matrices are organized in standard C array form - with the second element in the array corresponding to the first row, second column. This is the opposite of OpenGL, so DGL supplies alternates to glLoadMatrix() and glMultMatrix(), appropriately named dglLoadMatrix() and dglMultMatrix() respectively.
3D points can be converted to 2D screen points using the dglPointToScreen() function, and a measure of projected screen size of an object can be determined using the dglProjectRadius() function.
[edit] Animations -- 3Space (TS)
The 3Space library (engine/ts) manages the display and animation of shape models in the world. The 3Space shape resource class TSShape can be shared between multiple TSShapeInstance instances. The TSShape class manages all the static data for a shape - mesh data, animation keyframes, material lists, decal information, triggers and detail levels (for dynamically detailed shapes).
TSShape animation sequences can be composed of node/bone animation (for example, joints in an explosion), material animation (a texture animation on an explosion) and mesh animation (a morphing blob - note most mesh animations can be accomplished with node scale and rotation animations). Animations can also contain visibility tracks so that some meshes in the shape are not visible until an animation is played.
[edit] Textures and Texture Manager
DGL includes a texture manager (engine/dgl/gTexManager.*) that tracks the loading and unloading of all textures in the game. It uses the TextureHandle class - which acts as a sort of special resource handle for textures in the game. Only one instance of a texture is ever loaded at once.
- GFont
- fonts in the Torque are alpha textures created by the platform layer from OS dependent outline fonts.
- GBitmap
- the Torque supports several bitmap file types - PNG, JPEG, GIF, BMP and the custom BM8 format (an 8-bit color quantized texture format used to cut texture memory overhead).
- MaterialList
- a material list is a resource that manages a list of bitmaps. It is used for shapes and interiors that have more than one texture.
[edit] Interior
The interior library (engine/interior) manages the rendering, collision and IO for interior objects. The InteriorInstance SceneObject class manages a single interior.
Interiors are converted to DIF by the tool Map2DIF (formerly known as Morian). The source files are just Quake-style .map files - lists of convex physical "brushes" that define the solid areas of the interior. Special brushes are used to define zone portal boundaries and objects such as doors and platforms.
[edit] Terrain
The terrain library (engine/terrain) is the home for objects that render the outside world, including instances of the Sky, TerrainBlock and WaterBlock classes. The Sky object renders the outside sky and cloud layers and maintains the visible distance and fog distance settings for the world. The sky also tracks vertical fog layers and installs them into the SceneGraph for rendering.
The terrain is textured by software blending base material textures into new material textures and then mapping those across 16 or more terrain squares based on the distance from the square. Blender performs the blending of terrain textures and includes a MMX assembly version to speed the process (x86 architectures only).
[edit] Water
The WaterBlock class manages a single block of water, which may or may not be infinitely repeating. Water is dynamically detailed based on distance, so nearby water is more highly tessellated. Though the surface of a water block is rectangular, the actual coverage of the water area can be set to seed fill from a point on the surface, allowing the water to fill a mountain crater, for example, without leaking outside the corner edges.
