New Torque Documentation - Part 1
by Michael Perry · 04/18/2007 (9:02 pm) · 34 comments
Download Code File
This tutorial is part of a collaboration between Michael Perry and Ed Johnson. There is a lot more to come, and we hope to get your feedback on formatting, ease of use, and material covered.
The included .rar has two files containing the same tutorial, but in different formats: .doc for MS Word and .sxw for OpenOffice.
You can also download the documents and project files here:
Tutorial 1 MS Word doc
Tutorial 1 OpenOffice doc
Tutorial 1 Project Files
You can also check out the article on the TDN:
Tutorial 1
Thanks to Andy for modifying the TDN article for an easier read. TDN could use some more formatting, but it's a lot easier to read now.
*NOTE*- Website and links to files restored. Sorry for the inconvenience.
This tutorial is part of a collaboration between Michael Perry and Ed Johnson. There is a lot more to come, and we hope to get your feedback on formatting, ease of use, and material covered.
The included .rar has two files containing the same tutorial, but in different formats: .doc for MS Word and .sxw for OpenOffice.
You can also download the documents and project files here:
Tutorial 1 MS Word doc
Tutorial 1 OpenOffice doc
Tutorial 1 Project Files
You can also check out the article on the TDN:
Tutorial 1
Thanks to Andy for modifying the TDN article for an easier read. TDN could use some more formatting, but it's a lot easier to read now.
*NOTE*- Website and links to files restored. Sorry for the inconvenience.
About the author
Documentation Engineer for Torque
#2
04/16/2007 (2:09 am)
Excelent
#3
04/16/2007 (11:55 am)
@Michael - I edited your wiki - got rid of the underline error -hope you don't mind. Looks good. I would like to contribute to this concept of Torque 101 too.
#4
04/16/2007 (12:26 pm)
@Andy - Thank you! I don't mind at all and am very happy someone took the time to edit it. I'll make some more modifications later on today if no one else gets to it =). Mucho gracias!
#5
04/18/2007 (9:02 pm)
Very awesome, thanks.
#6
04/21/2007 (6:15 am)
nice
#7
04/21/2007 (10:13 pm)
very nice , Thanks.
#8
06/08/2007 (2:25 am)
great intro/tutorial...but I have a question (posted to the general forums, but I'll ask here as well).. Your tutorial (and GGs and 99% of the other tutorials out there) is hooked in pretty tightly to /example tutorial.base and starter.fps (as well as common) folders. If this were an actual game, how would you uncouple GGs scripts from your own to make a clean release ? It seems as though it would be cleaner to start with a decouple environment in which a few assets are copied from /example to your project.
#9
The reason my tutorial, and others, are similar to tutorial.base and starter.fps is actually simple. Quite a few function calls, ConsoleFunctions, must be performed for a clean startup. From a programming/scripting standpoint, the setup I've introduced is very bare-bones and required for a Torque game (unless engine modification is performed).
If you are specifically referring to the folder hierarchy:
You have a point, though. My company, Zombie Shortbus, is developing a game right now. Our folder structure currently resembles your default Torque project, but that will change in the near future. As tech lead for our first game, I've made the following decisions about the project layout and hierarchy:
To sum up, unhooking and deleting the common folder would severely impeded development. It would be easier to parse and delete the folder at the end of the project, which we will do. I have already planned to write a tutorial for removing the common, creator, and show folders from the project and still have a working game.
Aside from modifying the engine and setting up a custom project hierarchy, there are bigger things to worry about when getting a game ready for release....like securing your assets, protecting the game from hacks, and mainly worrying about a fun game play experience =)
I'll definitely go into detail as I wrap up my tutorial series and get into the deeper code lessons. If you want more info, just let me know.
06/08/2007 (4:09 am)
Thanks for the compliment John. =)The reason my tutorial, and others, are similar to tutorial.base and starter.fps is actually simple. Quite a few function calls, ConsoleFunctions, must be performed for a clean startup. From a programming/scripting standpoint, the setup I've introduced is very bare-bones and required for a Torque game (unless engine modification is performed).
If you are specifically referring to the folder hierarchy:
Quote:
... Main.cs acts as the entry point for the rest of your game's scripting. Beyond these main components, you can set up your game's folder hierarchy however you want.
You have a point, though. My company, Zombie Shortbus, is developing a game right now. Our folder structure currently resembles your default Torque project, but that will change in the near future. As tech lead for our first game, I've made the following decisions about the project layout and hierarchy:
- The common folder will remain in the project until release[li]At release time, any unused functionality and files in the common directory will be deleted. Whatever is left over will be moved into the proper client/server folder[li]The client and server folder separation will still be maintained to keep development simple for the scripters on my team who are new to Torque.[li]NOTHING goes into the scripts without a comment. New scripts must have a "header", and functions must have detailed comments.
To sum up, unhooking and deleting the common folder would severely impeded development. It would be easier to parse and delete the folder at the end of the project, which we will do. I have already planned to write a tutorial for removing the common, creator, and show folders from the project and still have a working game.
Aside from modifying the engine and setting up a custom project hierarchy, there are bigger things to worry about when getting a game ready for release....like securing your assets, protecting the game from hacks, and mainly worrying about a fun game play experience =)
I'll definitely go into detail as I wrap up my tutorial series and get into the deeper code lessons. If you want more info, just let me know.
#10
Great tutorial, however just slightly confused on where these functions and calls are placed.
In example 1.1
loadDir("common") -- assuming you create this directory
Everything in 1.1 goes into main.cs --
Everything in 1.2 goes into main.cs -- since its starting and stop
Everthing in 1.3 ? still in the same main.cs in the /super.tag/ directory the reason why I ask
function initServer() -- calls initBaseServer(); # (found in common/main.cs)
Or is it safe to say that all examples 1.-1.4 are belong to main.cs in the game directory?
Thanks,
07/18/2007 (3:50 am)
Michael, Great tutorial, however just slightly confused on where these functions and calls are placed.
In example 1.1
loadDir("common") -- assuming you create this directory
Everything in 1.1 goes into main.cs --
Everything in 1.2 goes into main.cs -- since its starting and stop
Everthing in 1.3 ? still in the same main.cs in the /super.tag/ directory the reason why I ask
function initServer() -- calls initBaseServer(); # (found in common/main.cs)
Or is it safe to say that all examples 1.-1.4 are belong to main.cs in the game directory?
Thanks,
#11
The code samples from 1.1 - 1.3 are placed in example\Super.Tag\main.cs
The one line code sample from 1.4 is placed in example\main.cs, which is found in the same directory as the executable.
In next set of tutorials, you can actually download the project tiles: Tutorial 2 Tutorial 3
Referencing the code I wrote might help alleviate any further confusion
07/18/2007 (12:35 pm)
@Keith - The code samples from 1.1 - 1.3 are placed in example\Super.Tag\main.cs
The one line code sample from 1.4 is placed in example\main.cs, which is found in the same directory as the executable.
In next set of tutorials, you can actually download the project tiles: Tutorial 2 Tutorial 3
Referencing the code I wrote might help alleviate any further confusion
#12
awh, yes I have a better understanding now. Thank you for providing those tutorials. They are missing link to getting start fast, and with some organization too!
Thanks,
07/18/2007 (6:21 pm)
Hey, Michaelawh, yes I have a better understanding now. Thank you for providing those tutorials. They are missing link to getting start fast, and with some organization too!
Thanks,
#13
Also, anyone interested in really learning Torque and mastering certain aspects of the technology, be sure to check out the recent announcements involving Torque School.
07/18/2007 (6:26 pm)
Sure thing Keith.Also, anyone interested in really learning Torque and mastering certain aspects of the technology, be sure to check out the recent announcements involving Torque School.
#14
Was a little lost on all this files, but you helped me knowing whats the purpose of each one :)
07/28/2007 (12:46 pm)
Thank you very much, you helped me allot!Was a little lost on all this files, but you helped me knowing whats the purpose of each one :)
#15
08/21/2007 (11:47 pm)
the link to the project files seems to be down, having a crash issue and wanted to compare the files and see where i went wrong =/
#16
08/22/2007 (12:25 pm)
Try again Phil. I just downloaded the project files without a problem. Dreamhost must have been "crappin' the bed". It's been known to happen, as half of my TorqueSchool stuff was "lost" during said down times.
#17
I am completely new to Torque and therefor find this sort of stuff very useful - thanks for taking the time to put it together. I have *probably* a simple question:
In Code Sample 1.3 Review you talk about %conn being a local variable - am I right in thinking that the scope of this variable is within the context of the function loadMission()?
And secondly sould I change RootGroup.add(ServerConnection) to RootGroup.add(%conn)? If %conn is a reference/pointer to ServerConnection (as I understand it) is this possible?
And finally... Am I correct to assume that the instance of the new game connection in the form of ServerConnection is added to RootGroup, and if so could I change the script to RootGroup.add(new GameConnection(ServerConnection))?
At present I have no idea what RootGroup is, but I'm sure all will be apparent!
Sorry to ask so many questions... My first look at Torque! Trying my best to understand what is actually happening.
Anyway, thanks for your help.
Marraboy.
08/22/2007 (2:50 pm)
HiI am completely new to Torque and therefor find this sort of stuff very useful - thanks for taking the time to put it together. I have *probably* a simple question:
In Code Sample 1.3 Review you talk about %conn being a local variable - am I right in thinking that the scope of this variable is within the context of the function loadMission()?
And secondly sould I change RootGroup.add(ServerConnection) to RootGroup.add(%conn)? If %conn is a reference/pointer to ServerConnection (as I understand it) is this possible?
And finally... Am I correct to assume that the instance of the new game connection in the form of ServerConnection is added to RootGroup, and if so could I change the script to RootGroup.add(new GameConnection(ServerConnection))?
At present I have no idea what RootGroup is, but I'm sure all will be apparent!
Sorry to ask so many questions... My first look at Torque! Trying my best to understand what is actually happening.
Anyway, thanks for your help.
Marraboy.
#18
Excellent writing and instructional style that is missing from some *other* books around....
You should write one. I'll buy it. Seriously the way an author "talks" to you is pretty important
and here I knew you weren't gonna leave me hangin and that you knew how to express what I needed to do. Thanks again. Great Resource!
Neurosys
12/27/2007 (11:03 pm)
wow. That pretty much answered my question. Thank you!Excellent writing and instructional style that is missing from some *other* books around....
You should write one. I'll buy it. Seriously the way an author "talks" to you is pretty important
and here I knew you weren't gonna leave me hangin and that you knew how to express what I needed to do. Thanks again. Great Resource!
Neurosys
#19
I am stuck at step 1.4 since my Torque directory does not have a ....\example\main.cs file with a corresponding TorqueDemo.exe file. I think this may due to the fact that I have installed the latest TGEA SDK and the file structure may be different now then when this tutorial was published.????? Or, am I suppose to use one of the existing GameExamples main.cs that came with the TGEA (AtlasDemo, ForgeDemo, etc).
At this point I guess I don't have a way to execute the basic app (steps 1.1 thru 1.3). Did I miss something?
Any advice is appreciated. I will keep researching this myself though.
04/19/2008 (5:30 am)
I REALLY appreciate this example since I am just getting started with TGEA; I purchased the SDK last week and have everything setup and running perfectly. I can successfully build, compile & run all the DEMO's and this tutorial is my first jump into beginning to understand the basic's of building a Torque app.I am stuck at step 1.4 since my Torque directory does not have a ....\example\main.cs file with a corresponding TorqueDemo.exe file. I think this may due to the fact that I have installed the latest TGEA SDK and the file structure may be different now then when this tutorial was published.????? Or, am I suppose to use one of the existing GameExamples main.cs that came with the TGEA (AtlasDemo, ForgeDemo, etc).
At this point I guess I don't have a way to execute the basic app (steps 1.1 thru 1.3). Did I miss something?
Any advice is appreciated. I will keep researching this myself though.
#20
Now, on to the answer. Setting up a barebones template for TGEA is quite different from TGE. Since this tutorial is a TGE resource, I don't to clutter it up with TGEA stuff.
Someone has already posted how to start a blank TGEA project in a forum thread, so I will find it and send you the link. If it is not descriptive enough, I will add to it a little to get you rolling. Stay tuned...
04/19/2008 (1:19 pm)
@Raymond - Glad you have found this tutorial helpful. Before I post your solution, I'd like to encourage you to head over to the Official TGEA 1.7 Documentation Feedback Thread, and let us know what you think of the official documentation that shipped with the engine. We're particularly interested in feedback for the Engine Overview section, and what you think is missing in the docs overall.Now, on to the answer. Setting up a barebones template for TGEA is quite different from TGE. Since this tutorial is a TGE resource, I don't to clutter it up with TGEA stuff.
Someone has already posted how to start a blank TGEA project in a forum thread, so I will find it and send you the link. If it is not descriptive enough, I will add to it a little to get you rolling. Stay tuned...
Torque Owner Christopher Dapo
- Ronixus