Game Development Community

Torque 101: Intro to Torque

by Infinitum3D · in Torque Game Engine · 10/05/2006 (10:12 am) · 155 replies

I have just purchased and downloaded the TorqueGameEngineSDK_1.4

I will be documenting my experiences with it here. I am new to Torque and C++, so I hope others here will be able to learn from my mistakes.

UPDATE: Since I make several mistakes, you should always read through the entire thread of posts before trying anything. There are times that I ruin everything and have to start over entirely. Also, I have upgraded to Torque 1.5 since this post.

Thanks!


1. Download and run the TorqueGameEngineSDK-1-4.exe

This will install the Torque SDK on your computer. It will also place a link on the desktop called Torque Game Engine SDK.

This link is to twelve shortcuts;

FPS Starter Kit
Getting Started Tutorial
readMe.html
Racing Starter Kit
Torque Developer network (online)
Torque Game Engine Demo
Torque Game Engine Home Page
Tutorial Base
Torque Show Tool Pro
Torque Documentation (online)
Torque SDK forums (online)
Uninstall Torque Game Engine

I will read up on these and post more soon. I am starting with the ReadMe.html and the getting Started Tutorial.

UPDATE 10/07/06:
The ReadMe.html is just a one page note about where to find help. Look it over or skip straight to the Getting Starting .pdf tutorial.

2. The Getting Started tutorial is excellent. Follow it through, word by word, step by step, from start to finish, even if a section looks like common sense. !!!Be sure to place the TorqueScript in the EXACT location, exactly as the tutorial says!!! This was my first mistake.

All we have left to do is make sure that our 'clientGame.cs' file gets loaded. Open up GameOne/main.cs and find the 'Client scripts' section of the function called initClient. At the bottom of that list, add the following line, which will load our file:

I added the line at the bottom of the page, not at the bottom of the initClient function.


Update 10/11/06:

Next try to make some changes. For example: tdn.garagegames.com/wiki/Beginner
a. Make a new Torque Logo model that is blue instead of red.
b. Make it give 2 points instead of just 1.
c. Make a yellow one that gives 5 points.

Once I have done this, I'll explain how to do it.


Tony
Page «Previous 1 2 3 4 5 6 7 Last »
#1
10/06/2006 (2:16 am)
Soo... what are you trying to tell for me it looks like your teaching people stuff and learning the same time?

well thats just me. :)
#2
10/07/2006 (6:05 am)
Yes. I'm going to update the thread every time I finish another step. Hopefully people can learn from my mistakes :)
#3
10/08/2006 (1:24 pm)
No this sounds like a good idea, i've just purchased it and so far all i've done is half the tutorial and figured out water blocks. So this will be a great help for me. Keep it up :)
#4
10/09/2006 (8:03 pm)
Thanks Barry!

OK, good news... I made a mistake! I was almost finished with the tutorial, and somehow I messed up the TorqueScript part.

Once I figure out my mistake, I'll post it.

Tony
#5
10/10/2006 (10:52 pm)
I also think this is a good idea. I've purchased TGE but have been very slow to get started. So I'd like to hear about others' experiences who are in a similarly beginner state as me.
#6
10/11/2006 (3:05 pm)
I'm glad to hear the positive responses. If there are other beginners who want to post any mistakes here, feel free!

Tony
#7
10/12/2006 (6:17 am)
Why did you put your name Infinitum3D if your "TONY" how old are you?
#8
10/13/2006 (5:28 pm)
@Saska - Infinitum3D is the project I was in charge of for 5 years. It is now no longer in process. It may be started up again if I learn enough about Torque.

I'm 35 years old. Thanks for asking.

---------------------------------------------------------------------------------------------------------------------------------
UPDATE 10/13/06

First Rule, save your work often!!!

OK, so I'm trying to add a lake to my map. I'm using the GameOne mission from the tutorial.

1. First I used the World Editor (hotKey F2) to raise the ground in a circle, like a volcano. I keep my brush small, 3x3.

2. Next, use the World Editor Creator (F4) and go to Mission Objects>Environment>Water

This opens a pop-up window called Building Object: WaterBlock. In Object Name, I named it Lake (real original). Anyways, click OK to accept the defaults, since I don't know what the wave parameters do yet. We'll change a couple settings in a minute.

OK, so this opened a flat plane of water which I couldn't find in the camera view, (NOTE: I do all world editing in Camera View. Hit Ctrl+TAB to toggle back and forth from player view to camera view) so I went to the upper right window (tree view) and found 4900: Lake - WaterBlock. I think the 4900 is randomly generated, so just look for the WaterBlock.

3. Then I opened the World Editor Inspector (hotKey F3). In the TRANSFORM section, I changed position to 0 0 0, but still could find the water, so I highlighted the 4900: WaterBlock in the tree view and clicked World>Camera to Selection.

Whoa. What happened. OK, I moved around a little and saw I was near a big opaque square. I found my lake, but it doesn't really look like a lake floating here in the middle of nothing. I'm not sure how to move the water other than using the TRANSFORM>POSITION section.

4. I gave up on my original volcano/lake, and used the Terrain Editor to create a rim of hills around the lake. I know it's better to bring the lake to the mountains, but we'll learn that later.

So now I have a lake in a mountain, but it doesn't quite seem right.

5. Let's go to the Inspector (F3). In the TRANSFORM section I see SCALE, so I changed the 32,32,1 to 32,32,32. Aha, I learned that the last digit (the 1) is the height of the object (water). Not how thick the water is, but how high off the ground it is. The water itself is just a flat plane (surface) with no thickness.

OK, so I mess with the numbers until I get it to fit my mountain. My end result is 40,40,3. Yours will probably be different.

6. OK, next I File>Save the mission, and File>Exit.

7. I restarted the mission, by clicking Start (from the tutorial). My world loads, and I'm back in player view. So I run around looking for my lake. Boy, it's like a million miles from the PlayerSpawn. We'll have to fix that later.

Finally I find it. (I had to cheat by switching to Mission Editor/Camera View to see where it was, then I went back tp player view).

8. The water is hard to walk through. Is is supossed to be? I don't think so, but how do I fix it. I remember something about viscosity in the Inspector. Go back to Mission Editor (F11), World Editor Inspector (F3).

Highlight Lake - WaterBlock in the tree view. In the Inspector, set FLUID> LiquidType> Water, Fluid>density>1, Fluid>Viscosity>5.

Then SURFACE>waveMagnitude>0.1

What this does is affect the physics of the water. The surface moves a little, and walking is like being in a real lake. You float a little when it gets deep. It's harder to start moving and stop moving. You aren't really swimming, as much as running/floating through deep (sometimes over your head) water. Breathing hasn't been programmed in yet, so you can't drown yet.

9. Last thing. Since we worked so hard creating the lake, highlight the Lake - WaterBlock in the tree view. Then World>Lock Selection (hotkey Ctrl L). This locks the WaterBlock so you can't accidentally delete it.

10. Finally, File>Save Mission As... gameonemission.mis

I'd like to put in some kind of compass/direction monitor. I think my lake is a long way South of the playerSpawn, but I can't be sure. Maybe I'll just move the Spawn closer to the lake. Or even add a Teleport Platform to zap me back and forth between the lake and the spawn. Also, we need to program in a "breathing/holding your breath underwater" system of some kind.

OK, in the treeview in the folder PlayerdropPoints - SimGroup highlight the SpawnShere. Go to camera view (ALT+C), find the spawn shere and drag it closer to the lake. Make sure the box at the center of the sphere is on the ground. If it's too high, the player will fall to the ground when spawned. If it's too low, the player will fall through the ground into the void.

Tony
#9
10/13/2006 (5:28 pm)
UPDATE: 10/13/06

1. OK, Next thing. I prefer to run things full screen rather than in the default window. So when you start Torque, the GameOne GUI window opens with the toolbar at the top. The toolbar has GUI EDITOR, WORLD EDITOR, etc. On the far right, next to EXIT is OPTIONS. Click OPTIONS and a pop-up window opens with Graphics and Audio options. Click the box next to Fullscreen Video if you like to work full screen. I also set my resolution at 1024 768. Be sure to click Apply if you make any changes. It will change to fullscreen view. Unfortunately, there is no way to minimize the fullscreen view. If you press ALT+TAB to switch to another program while in fullscreen mode, the Torque Gui disappears and I don't know how to get it back. Torque is still running, because the task manager (hotkey CTRL+ALT+DELETE) lists TorqueDemo.exe under the PROCESSES tab. But it doesn't show up under the APPLICATIONS tab. And if I try to restart Torque it brings up a "fatal error" saying Torque is already running. So I have to go under PROCESSES and End Process for torqueDemo.exe. This isn't a good way to do things, and it may be a bug in the Torque code, or maybe just a problem with MY system, I don't know. But I'm going to post everything I do, so if there are others with similar problems they can learn from me.

So Fullscreen isn't the best option for me at this time. I turned off fullscreen view and set resolution to 1024 768.

2. Another bug I found is that the Terrain Texture Painter doesn't switch back to Terrain Editor unless I File>Save Mission, File>Exit and restart.


3. I also learned that the world is round! At least it seems that way. If you switch to camera view (ALT+C) because camera view moves much faster (SHIFT+7) than player view, and just move forward (W) eventually you end up in the same place, so the world must be round, right? If so, that means you can create a North and South pole with frozen tundra terrain, and an equator with beaches and palm trees.

4. Now, there's another thing I'm trying to figure out. What is the red rectangle surrounding an area of the world in Editor mode? And in Terrain Texture Painter mode, there is a green rectangle outside the red one.

The red one is the Mission Area. When you open WINDOW>MISSION AREA EDITOR (hotkey F5) a window opens showing the world, camera location, and the red box. The red V is your field of view. I still don't know the purpose of the red box.


OK, I was planning on adding some sort of "mini-map" feature, but until I learn how to, I'm using the Mission Area Editor (F5). With the Mission Area Editor open, I can see certain terrain landmarks. I raised a large mountain just west of my lake. On the Mission Area Editor, the mountain appears as a bright white area. High points are white, low levels are black, everything else is shades of gray.


5. I just found a bug. My terrain has a square hole in it. My player falls through into the void. If I use the terrain editor, it distorts the shape of the hole. I don't know how to get rid of the hole. It's almost like a face has been deleted from the terrain. Is that even possible? Did I do this, or is this a bug in Torque?

Aha! It's not a bug. I must have made this hole somehow. I was able to get rid of it by clicking ACTION>CLEAR EMPTY, and click my brush on it. ACTION>SET EMPTY lets you delete faces from the terrain, and ACTION>CLEAR EMPTY replaces them. Pretty neat. I'm not sure what this is good for.


6. I just made cliffs. I made a very tall mountain, which looked really bad, so I tried to flatten it out by using the Terrain Editor and a 25x25 brush. It worked OK, but then I saw ACTION> FLATTEN. When I flattened the mountain top, it gave me a high cliff with a plateaus on top. Looks like a great place for a castle. Unfortunately, players can scale the cliff with no difficulty even though it's almost straight up and down. Somehow I'll have to figure out how to code in angles of climbing allowed. the player should be able to climb a 45degree hill, but anything more steep that requires special skills. 60 degrees would be very difficult, and 90 degrees would require expert skills, like a GrandMaster Thief or a Ninja or something.


Maybe I can run a river through the valley between the two cliffs, like the Grand Canyon or something.

More to come. This is an ongoing tutorial, which will be continually updated, so if anyone has comments, complaints, suggestions, or ideas, post a reply. Maybe if we get enough posts showing interest, we can get Garage Games to give us our own Beginners forum :)

Tony
#10
10/13/2006 (8:07 pm)
@Infinitum3D, I think this thread was a terrific idea. Please keep maintaining it.

@Saska, This is the "getting started" forum, after all. I don't think you need to be so antagonistic. btw, I'm 31. ;)

(rofl, maybe we should all start putting our ages in our sigs!)
#11
10/14/2006 (12:12 am)
:p OK... maybe i was wrong a little :D im 10 years old only :D
#12
10/14/2006 (12:33 am)
Oh yes and infinitum 3d the red box around the terrain is well.. the terrains bounding box.

and the world isnt round there its just programmed to repeat the terrain when you go too far from the mission area.

just some tips ;)
#13
10/14/2006 (12:39 am)
Oh yes and i just figured out what i think the emtying hole could be for, A LAKE! :)
#14
10/14/2006 (12:39 am)
Or is the emtpy hole going through the terrain?
#15
10/14/2006 (12:41 am)
Infinitum i think youd be a Great partner for me im starting to make a game soon because ive been nowadays only messing with the engine. and you are a great partner you made me figure out quite a few things!

and we could also continue your project.

Email me: saska@kivisto.com
#16
10/14/2006 (12:55 am)
Hmm.. a little problem i have done the getting started tutuorial long time ago but this time when i create my load mymission gui it works but when its loading the mission it hangs there.
#17
10/14/2006 (12:56 am)
But it somehow doesnt hang when i press the world editor button :S
#18
10/14/2006 (6:18 am)
@Saska: I understand the hole now.

Quote:It's not a bug. I must have made this hole somehow. I was able to get rid of it by clicking ACTION>CLEAR EMPTY, and click my brush on it. ACTION>SET EMPTY lets you delete faces from the terrain, and ACTION>CLEAR EMPTY replaces them. Pretty neat. I'm not sure what this is good for, though.

@Saska: At one point my mission would hang while loading, also. I couldn't find my mistake anywhere, so I went back and started the tutorial over from the beginning, and now it works fine. Try again, step-by-step, and go slowly. If it still doesn't work post again, and I'll try to walk through it with you.

I would love to partner with you (and any others) on a project, but I don't know how much help I will be, or how much time I'll have for it right now. The 'blog and learning Torque will probably take most of my time.
------------------------------------------------------------------------------------------------------------------------------------




I've learned from Wysardry that GG hosts 'blogs. I've started a 'blog called Torque 101: Intro to Torque, and I'm just waiting for the moderator to OK it for publication. Once it's been approved, I will start posting there so everyone can follow along.

I'll try to update daily, but it'll probably be more like twice a week.

Thanks!

~Tony
#19
10/14/2006 (6:29 am)
I tried doing the tutorial again but still it hangs on waiting forserver
#20
10/14/2006 (6:31 am)
Oh yes and i could teach you the concepts over torque just ask :)
Page «Previous 1 2 3 4 5 6 7 Last »