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
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
#102
Since I've been having some trouble with Torque overheating my laptop, I've decided to buy a new one. Unfortunately, it may be a few weeks (or even months) until that's possible. In the meantime, I'm going to keep working on DIF's with QuArK, and maybe even check out OGRE. I'm not giving up on Torque. I'm just slowing down a little.
I'll try to upload the DIF's to my site www.geocities.com/infinitum3d/index.html for anyone to use. I've got nothing really interesting yet, but there are a couple dl's available.
Wish me luck!
Tony
03/02/2007 (10:21 pm)
Status Report:Since I've been having some trouble with Torque overheating my laptop, I've decided to buy a new one. Unfortunately, it may be a few weeks (or even months) until that's possible. In the meantime, I'm going to keep working on DIF's with QuArK, and maybe even check out OGRE. I'm not giving up on Torque. I'm just slowing down a little.
I'll try to upload the DIF's to my site www.geocities.com/infinitum3d/index.html for anyone to use. I've got nothing really interesting yet, but there are a couple dl's available.
Wish me luck!
Tony
#103
I used Ed M's resource for a drop in compass. It took about 5 minutes. It works, HOWEVER, it places the compass, by default, at the top/center of the screen, which is overlapped by the, uh, what's it called, the chat HUD (I think?). If you try to move it around, it locks out the mouse and no longer works. Even if I reset the settings by hand to the same settings it started with, it doesn't work. I have to drop in the replacement PlayGui.gui to get it to work again, with the compass still in a less-than-ideal location. Don't get me wrong. I think Ed is a Torque God, and I really, really appreciate the resource. I just need help moving it to a better location in the Gui. If it was smaller, and maybe in the upper right (or lower right) corner of the screen, it would be better. Ideally, being able to toggle it on/off with a bindKey command would be great. Something like: moveMap.bindCmd(keyboard, "c", "toggleCompass();", "");
Anyways. Again, thanks Ed for the great resource.
I'm still making DIF's, and working with an overheatable computer. Progress has stalled on my game, but should pick up with a new PC in August. Fortunately, as the weather gets warmer, the air conditioning gets colder, so I can set my notepad right on a vent and keep it cool.
more to come...
Tony
03/15/2007 (5:59 pm)
03 13 2007 Torque 101: Drop In CompassI used Ed M's resource for a drop in compass. It took about 5 minutes. It works, HOWEVER, it places the compass, by default, at the top/center of the screen, which is overlapped by the, uh, what's it called, the chat HUD (I think?). If you try to move it around, it locks out the mouse and no longer works. Even if I reset the settings by hand to the same settings it started with, it doesn't work. I have to drop in the replacement PlayGui.gui to get it to work again, with the compass still in a less-than-ideal location. Don't get me wrong. I think Ed is a Torque God, and I really, really appreciate the resource. I just need help moving it to a better location in the Gui. If it was smaller, and maybe in the upper right (or lower right) corner of the screen, it would be better. Ideally, being able to toggle it on/off with a bindKey command would be great. Something like: moveMap.bindCmd(keyboard, "c", "toggleCompass();", "");
Anyways. Again, thanks Ed for the great resource.
I'm still making DIF's, and working with an overheatable computer. Progress has stalled on my game, but should pick up with a new PC in August. Fortunately, as the weather gets warmer, the air conditioning gets colder, so I can set my notepad right on a vent and keep it cool.
more to come...
Tony
#104
Specifically, I'm talking about positioning things in reference to the center of the surface plane of the world.
How does the coordinates system work in Torque? When I position something at 0 0 0, my coordinates are X=0, Y=0, Z=0. Nothing fancy there. But is that the coordinate of the center of the object? the upper leftcorner? the lower right? It's not the center. I started off by loading Torque, mission F World. Using the Inspector, I repositioned my player to the coordinates 0 0 0.1 (if you use 0 for the Z coordinate, you fall through the surface). Then I had to find the player, so I hit ALT-C to switch to camera mode, and Drop Camera at Player. I moved the camera up in the air, and I could see my player at coordinates 0 0 0.1 So far so good.
Next, I created a waterblock and used the Inspector to reposition it to 0 0 1 (about one meter off the ground). A corner of the waterblock was at my player position. So it's not the center of the object that gets placed at the coordinate, its a corner. To center the waterblock on my player, I took the scale of the waterblock to 200 200, and gave it the coordinate -100 -100 1. This places it centered on 0 0 0. This all goes back to high school geometry (I think). If you're looking at a grid with 0, 0 in the center, positive numbers go up and right, negative numbers go down and left. So if I set the x, y coordinates of my waterblock to 0, 0 and I have to use -100, -100 to center it on 0, 0 then it must be the lower left corner of my square waterblock that gets placed at x=0, y=0
THEREFORE...
When you use the Inspector to place things numerically, you are entering the coordinates for the lower left corner of the object. I guess this really only matters if the object that you're placing is huge, like an ocean :)
This helps me understand placement. If it helps you, that's great. If it confuses you, I apologize. If I'm completely incorrect here, please correct me!!! But I thinkI understand it now.
Thanks!
Tony
P.S. By the way, the reason I wanted to know this is because I'm trying to limit the size of my game world by placing a waterblock ocean as the border, and I want my island to be at the center of the ocean. I'm starting with a waterblock size 4801 4801 1 and setting it at coordinate -2400 -2400 1, so that it extends out in all directions 2400 meters (?) from the center. Then I can raise the ground for an island, and you can look out and see water as far as the eye can see. Right now, Kork can run around the entire perimeter of the island in about 60 seconds. So assuming Kork can run at about 6 mph, then my island perimeter is about 1/10th of a mile. Not large enough by any stretch of the imagination. I may edit player.cs to slow Kork down to a walk, and add in a "RUN" feature later, maybe using CTRL+W, CTRL+D, CTRL+S, CTRL+A...
Lame I know, but I gotta start somewhere.
T
03/15/2007 (5:59 pm)
03 15 2007 Torque 101: The Center of the World!Specifically, I'm talking about positioning things in reference to the center of the surface plane of the world.
How does the coordinates system work in Torque? When I position something at 0 0 0, my coordinates are X=0, Y=0, Z=0. Nothing fancy there. But is that the coordinate of the center of the object? the upper leftcorner? the lower right? It's not the center. I started off by loading Torque, mission F World. Using the Inspector, I repositioned my player to the coordinates 0 0 0.1 (if you use 0 for the Z coordinate, you fall through the surface). Then I had to find the player, so I hit ALT-C to switch to camera mode, and Drop Camera at Player. I moved the camera up in the air, and I could see my player at coordinates 0 0 0.1 So far so good.
Next, I created a waterblock and used the Inspector to reposition it to 0 0 1 (about one meter off the ground). A corner of the waterblock was at my player position. So it's not the center of the object that gets placed at the coordinate, its a corner. To center the waterblock on my player, I took the scale of the waterblock to 200 200, and gave it the coordinate -100 -100 1. This places it centered on 0 0 0. This all goes back to high school geometry (I think). If you're looking at a grid with 0, 0 in the center, positive numbers go up and right, negative numbers go down and left. So if I set the x, y coordinates of my waterblock to 0, 0 and I have to use -100, -100 to center it on 0, 0 then it must be the lower left corner of my square waterblock that gets placed at x=0, y=0
THEREFORE...
When you use the Inspector to place things numerically, you are entering the coordinates for the lower left corner of the object. I guess this really only matters if the object that you're placing is huge, like an ocean :)
This helps me understand placement. If it helps you, that's great. If it confuses you, I apologize. If I'm completely incorrect here, please correct me!!! But I thinkI understand it now.
Thanks!
Tony
P.S. By the way, the reason I wanted to know this is because I'm trying to limit the size of my game world by placing a waterblock ocean as the border, and I want my island to be at the center of the ocean. I'm starting with a waterblock size 4801 4801 1 and setting it at coordinate -2400 -2400 1, so that it extends out in all directions 2400 meters (?) from the center. Then I can raise the ground for an island, and you can look out and see water as far as the eye can see. Right now, Kork can run around the entire perimeter of the island in about 60 seconds. So assuming Kork can run at about 6 mph, then my island perimeter is about 1/10th of a mile. Not large enough by any stretch of the imagination. I may edit player.cs to slow Kork down to a walk, and add in a "RUN" feature later, maybe using CTRL+W, CTRL+D, CTRL+S, CTRL+A...
Lame I know, but I gotta start somewhere.
T
#105
I may have forgotten to mention, I'm using Starter.FPS, which I copied and renamed GameOne.FPS. I've loaded F-World (flat.mis) as my starting point. I changed the terrain block in the world editor inspector. detailTexture = "~/data/terrains/details/brush2.jpg"; And in the terrain texture painter, I've loaded the grass.jpg.
In the WaterBlock, I've changed these settings;
surfaceTexture = "~/data/water/water.png";
ShoreTexture = "~/data/water/wateredge.jpg";
envMapOverTexture = "~/data/water/water.png";
envMapUnderTexture = "~/data/water/water2.png";
submergeTexture[0] = "~/data/water/water.png";
submergeTexture[1] = "~/data/water/water2.png";
specularMaskTex = "~/data/water/specmask.png";
I've started changing the Player.cs file to modify Player speed and climb angles.
In Server/Scripts/Player.cs
Changed Run Angle from 70 to 40
Changed Jump Angle from 80 to 50
Changed Max Forward Speed from 14 to 9.8
Reduced Side Speed and Back Speed to about 8.5
Reduced Underwater speeds by about 2
Increased the size of the island/continent by raising additional land above 'sea-level'.
Reshaped the Mission Area Red Outline to better fit the island/continent.
It now takes Player almost seven minutes to run around the perimeter of the island. Still assuming Kork is running 6 mph (about 10 kilometers an hour), then the perimeter of my island is about one kilometer, or just under 3/4 mile. I know there are track-and-field atheletes who can run a four minute mile, but Kork/Player is no track-and-field athelete. He's not even trained as a cross-country runner. Maybe that's an ability I can add later. Long-distance running and Sprinting skills.
Anyways, my first game area is starting get to an acceptible size. More changes coming. It still needs to be larger. I'd like this to be a small island in a larger pangea (sp?) so I'd really like it to be about 15 km wide (East to West) and 10 km North to South. I'd like the entire world pangea to be about 100km wide and 80km North-to-South. This may be unrealistic, since that seems huge!!!!
Let's see if that's possible. It all depends on my waterblock ocean. I guess I could place multiple waterblocks around it...
---
Well, I increased the waterblock size to 6401 6401 1 and recentered it. Everything looks good so far. In the SKY block I changed the Visibility setting to 300 and Fog Distance to 200. It seems to look OK to me.
The continent is larger also. It takes Player just over ten minutes to run the perimeter. Still probably less than half a kilometer across at the widest point, but if I go any larger, the terrain tiling effect starts placing other continents within sight. I'm sure there's a way to correct this using Tile Size or something...
If I open flat.mis (which is the mission I'm editing) the text file is pretty straightforward;
new SimGroup(MissionGroup) {
new ScriptObject(MissionInfo) {
new MissionArea(MissionArea) {
new Sky(Sky) {
wait... go back... new MissionArea(MissionArea) {
This may be it. Area = "-960 -816 1920 1376"; No good. That's just the size of my Mission Area red box outline. Let's continue.
new Sun() {
new TerrainBlock(Terrain) {
hmmm... This looks promising.
canSaveDynamicFields = "1";
rotation = "1 0 0 0";
scale = "1 1 1";
detailTexture = "~/data/terrains/details/brush2.jpg";
terrainFile = "./flat.ter";
squareSize = "8";
bumpScale = "1";
bumpOffset = "0.01";
zeroBumpScale = "8";
tile = "1";
position = "-1024 -1024 0";
locked = "False";
That's it. tile = "1"; 1 means true, so if we change that to tile = "0"; it should turn off terrain tiling.
Save. Load Torque. Load F-World. (Gotta remember to change that name). HOORAY! The terrain tiling is turned off. And there in the Terrain Block (in the Inspector) you can see where tiling is unchecked. You can turned on terrain tiling by checking the box, and turn it off again by unchecking it. Oh, I forgot to mention, you may have to "unlock" the block in order to be able to change it. At the bottom it will say Locked = True. Just change it to False. Once everything is set exactly how you like it, then you can go back and lock them again.
Now I can make a bigger waterblock ocean and increase the size of my island without the island tiling.
More to come...
Tony
Edit: Apparently, if you turn off tiling, you can no longer go in and edit your terrain heights. The terrain editor is disabled when tiling is turned off. Just make sure you have all your mountains, plains, and valleys perfect, then turn off tiling. I just turn tiling on and off as needed.
Edit2: In example\common\server\clientConnections.cs you can change the start up message from "Welcome to the Torque Demo Fresh Meat".
Look for;
// Inform the client we've joined up
messageClient(%client,
'MsgClientJoin', '\c2YOUR_MESSAGE_HERE app %1.',
03/16/2007 (4:41 pm)
03 16 2007 Torque 101: Continent SizeI may have forgotten to mention, I'm using Starter.FPS, which I copied and renamed GameOne.FPS. I've loaded F-World (flat.mis) as my starting point. I changed the terrain block in the world editor inspector. detailTexture = "~/data/terrains/details/brush2.jpg"; And in the terrain texture painter, I've loaded the grass.jpg.
In the WaterBlock, I've changed these settings;
surfaceTexture = "~/data/water/water.png";
ShoreTexture = "~/data/water/wateredge.jpg";
envMapOverTexture = "~/data/water/water.png";
envMapUnderTexture = "~/data/water/water2.png";
submergeTexture[0] = "~/data/water/water.png";
submergeTexture[1] = "~/data/water/water2.png";
specularMaskTex = "~/data/water/specmask.png";
I've started changing the Player.cs file to modify Player speed and climb angles.
In Server/Scripts/Player.cs
Changed Run Angle from 70 to 40
Changed Jump Angle from 80 to 50
Changed Max Forward Speed from 14 to 9.8
Reduced Side Speed and Back Speed to about 8.5
Reduced Underwater speeds by about 2
Increased the size of the island/continent by raising additional land above 'sea-level'.
Reshaped the Mission Area Red Outline to better fit the island/continent.
It now takes Player almost seven minutes to run around the perimeter of the island. Still assuming Kork is running 6 mph (about 10 kilometers an hour), then the perimeter of my island is about one kilometer, or just under 3/4 mile. I know there are track-and-field atheletes who can run a four minute mile, but Kork/Player is no track-and-field athelete. He's not even trained as a cross-country runner. Maybe that's an ability I can add later. Long-distance running and Sprinting skills.
Anyways, my first game area is starting get to an acceptible size. More changes coming. It still needs to be larger. I'd like this to be a small island in a larger pangea (sp?) so I'd really like it to be about 15 km wide (East to West) and 10 km North to South. I'd like the entire world pangea to be about 100km wide and 80km North-to-South. This may be unrealistic, since that seems huge!!!!
Let's see if that's possible. It all depends on my waterblock ocean. I guess I could place multiple waterblocks around it...
---
Well, I increased the waterblock size to 6401 6401 1 and recentered it. Everything looks good so far. In the SKY block I changed the Visibility setting to 300 and Fog Distance to 200. It seems to look OK to me.
The continent is larger also. It takes Player just over ten minutes to run the perimeter. Still probably less than half a kilometer across at the widest point, but if I go any larger, the terrain tiling effect starts placing other continents within sight. I'm sure there's a way to correct this using Tile Size or something...
If I open flat.mis (which is the mission I'm editing) the text file is pretty straightforward;
new SimGroup(MissionGroup) {
new ScriptObject(MissionInfo) {
new MissionArea(MissionArea) {
new Sky(Sky) {
wait... go back... new MissionArea(MissionArea) {
This may be it. Area = "-960 -816 1920 1376"; No good. That's just the size of my Mission Area red box outline. Let's continue.
new Sun() {
new TerrainBlock(Terrain) {
hmmm... This looks promising.
canSaveDynamicFields = "1";
rotation = "1 0 0 0";
scale = "1 1 1";
detailTexture = "~/data/terrains/details/brush2.jpg";
terrainFile = "./flat.ter";
squareSize = "8";
bumpScale = "1";
bumpOffset = "0.01";
zeroBumpScale = "8";
tile = "1";
position = "-1024 -1024 0";
locked = "False";
That's it. tile = "1"; 1 means true, so if we change that to tile = "0"; it should turn off terrain tiling.
Save. Load Torque. Load F-World. (Gotta remember to change that name). HOORAY! The terrain tiling is turned off. And there in the Terrain Block (in the Inspector) you can see where tiling is unchecked. You can turned on terrain tiling by checking the box, and turn it off again by unchecking it. Oh, I forgot to mention, you may have to "unlock" the block in order to be able to change it. At the bottom it will say Locked = True. Just change it to False. Once everything is set exactly how you like it, then you can go back and lock them again.
Now I can make a bigger waterblock ocean and increase the size of my island without the island tiling.
More to come...
Tony
Edit: Apparently, if you turn off tiling, you can no longer go in and edit your terrain heights. The terrain editor is disabled when tiling is turned off. Just make sure you have all your mountains, plains, and valleys perfect, then turn off tiling. I just turn tiling on and off as needed.
Edit2: In example\common\server\clientConnections.cs you can change the start up message from "Welcome to the Torque Demo Fresh Meat".
Look for;
// Inform the client we've joined up
messageClient(%client,
'MsgClientJoin', '\c2YOUR_MESSAGE_HERE app %1.',
#106
I've copied in the .cc and .h files, rebuilt, and cut-n-pasted in my command.cs, etc.
CTRL+B does nothing. It's supposed to spawn a bot, but there's no bot. My console message says "Unable to find function aiAddPlayer. Does that mean my rebuild didn't replace the .cc and .h files properly?
I'll keep looking...
OK, I know I CAN spawn bots, because this resource works tdn.garagegames.com/wiki/Torque/Script/Tutorials/Using_Basic_AI_Commands&needLog...
So I must have done something wrong with the Advanced AI tut.
Still looking...
I'm rebuilding again. Maybe that will help.
[edit]Uh oh. Fatal Error on Rebuild.
That can't be good...
Well, after trying to rebuild a couple times, I keep getting the same Fatal Error. This doesn't seem to affect my game, since I can still debug and edit and run it.
I can't get bots into my game yet, but at least I haven't ruined my game.
Tony
03/23/2007 (10:51 pm)
Well, I've been trying to follow the tutorial from "Advanced AI for Torque 1.4" www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10923 but it doesn't seem to be working for me.I've copied in the .cc and .h files, rebuilt, and cut-n-pasted in my command.cs, etc.
CTRL+B does nothing. It's supposed to spawn a bot, but there's no bot. My console message says "Unable to find function aiAddPlayer. Does that mean my rebuild didn't replace the .cc and .h files properly?
I'll keep looking...
OK, I know I CAN spawn bots, because this resource works tdn.garagegames.com/wiki/Torque/Script/Tutorials/Using_Basic_AI_Commands&needLog...
So I must have done something wrong with the Advanced AI tut.
Still looking...
I'm rebuilding again. Maybe that will help.
[edit]Uh oh. Fatal Error on Rebuild.
Quote:
7>Linking...
7>player.obj : error LNK2019: unresolved external symbol "public: __thiscall Inventory::~Inventory(void)" (??1Inventory@@QAE@XZ) referenced in function __unwindfunclet$??0Player@@QAE@XZ$0
7>player.obj : error LNK2019: unresolved external symbol "public: __thiscall Inventory::Inventory(void)" (??0Inventory@@QAE@XZ) referenced in function "public: __thiscall Player::Player(void)" (??0Player@@QAE@XZ)
7>../example/torqueDemo_DEBUG.exe : fatal error LNK1120: 2 unresolved externals
That can't be good...
Well, after trying to rebuild a couple times, I keep getting the same Fatal Error. This doesn't seem to affect my game, since I can still debug and edit and run it.
I can't get bots into my game yet, but at least I haven't ruined my game.
Tony
#107
I now have everything apparently working OK.
I can load my mission, I can find my .DIF's and .DTS's, and I can once again use my light datablocks. The only things I lost were the Drop-In Compass and the Inventory system. No big loss, since the inventory system was a direct copy of the Tim Newell Pop-Up Inventory Tutorial. I'll go back and redo it later. I'll miss the compass, but there are a couple other compass resources I want to try.
Now I'll backup my Copy_of_Starter.FPS folder, and see what else I can make a mess of :)
Tony
03/24/2007 (2:21 am)
Well, something I've done recently has caused me to lose all my lighting datablocks. It could have been the drop-in compass, or the AI resource. Either way, I need my light datablocks back. Since I can't find them in any of the .cs files, I've made a fresh copy of the Starter.FPS folder, I've copied my data folder into the fresh new unadulterated Copy_of_Starter.FPS folder, and changed the line in main.cs to read $defaultGame = "Copy_of_starter.fps";I now have everything apparently working OK.
I can load my mission, I can find my .DIF's and .DTS's, and I can once again use my light datablocks. The only things I lost were the Drop-In Compass and the Inventory system. No big loss, since the inventory system was a direct copy of the Tim Newell Pop-Up Inventory Tutorial. I'll go back and redo it later. I'll miss the compass, but there are a couple other compass resources I want to try.
Now I'll backup my Copy_of_Starter.FPS folder, and see what else I can make a mess of :)
Tony
#108
For your giant island, you may need to link multiple mission files/terrains to get it that large. I don't know what the max terrain size is, but I'm pretty sure it's not that big :P.
03/25/2007 (9:43 am)
Strange that the editor adds objects by their corner... is it possible that waterblocks have their 'centre' in one corner? Anyway, nice workaround ;)For your giant island, you may need to link multiple mission files/terrains to get it that large. I don't know what the max terrain size is, but I'm pretty sure it's not that big :P.
#109
I've been playing with the folliage replicator for adding grasslands and folliage details to the world. Some of the properties I understand, some I don't.
Can anyone add to this? I'd like to submit it as a resource when all the details are in.
----------------------------------
Sim Base:
canSaveDynamicFields - is checked by default. Don't know why.
internalName... - is blank by default. Don't know why.
Transform: This is positioning information
position - is the location of the replicator center (I think).
rotation - you can change the rotation of your area, but it really screws up things. If the Z axis is not 0 then you get a flickering effect to the folliage. Leave it as 1 0 0 0
scale - I just leave it as 1 1 1. you can change the size of your area using x,y coordinates which we'll get into in a minute.
Debugging:
UseDebugInfo - unchecked by default. Don't know why. Things in italics come from the fxGrassTGE1.4 install.txt file.
This flag allows you to see relevant debugging information. For the moment I have enabled the ability to see the quad-tree boxes themselves. There are other things that can be enabled but I have decided to make them part of the code e.g. you need to uncomment lines within the code to enable them.
DebugBoxHeight - default as 1. Don't know why.
This field was requested by Phil Carlisle to enable you to control the height of the
quad-tree boxes shown on-screen. The value here is an interpolation.
1 = Top of quad-tree box / 0 = Bottom / .5 = Half way / etc.
This is to make it easier to see where the quad-boxes are when you have a big difference
between the lowest and highest billboards.
HideFolliage - unchecked by default.
This option allows you to temporary hide the replicated objects. This could be handy if the replicated objects are obscuring some detail you are editing. For instance, you may be hiding a secret key in the forest ... :)
ShowPlacementArea - checked by default.
The elliptical placement area that the replicator uses to replicate objects is not obvious from the configuration options. When this is turned on and you are within the editor, then a rather groovey coloured band sweeps around the circumference of the elliptical area selected. You can change this area and position by moving the replicator to see the exact bounds to which objects will be contained. Note, you can only see this band when you are within the editor and the replicator object is within the cameras' view.
PlacementAreaHeight - default is 25.
You can configure the placement band (see - 'ShowPlacementArea') to different heights. The band is clipped by objects within the scene and it can be hard to see sometimes particularly on hilly terrain. The 'height' is centered along the Z(0) axis of the replicator object.
PlacementColor - is 0.4 0 0.8 1 by default.
You can configure the placement band colour. The band defaults to a set colour and when using multiple replicators it it nice to configure each to it's own colour to differentiate each repliactor.
Media:
Seed - defaults as something huge like 814556372. I changed this to 10 for my first replicator, 20 for my second, 30 for my third, etc. Why? Because in the demo that's what they did, and it works.
This value is the Seed value for the random number generator. Changing this value results in a different distribution of pseudo-random numbers. You can change this value to almost anything if you are not happy with the placement of objects that has been choosen. Also, if you populate with multiple replicators then give each a different number. Note that a small value change here results in a completely different set of placements.
FolliageFile - this is where you get to select what .jpg or .png you want to show.
This allows you to select any texture file. Valid paths include the mod directory, so something like "fps/data/mycoolgrass1" would do fine. Sorry, no compound textures at the moment but that is coming. For the moment, simply use multiple replicator objects.
FolliageCount - this can be just about any number from 1 to 15,500 or maybe even bigger. Sometimes I must have made it too big because no folliage was displayed. I think it has something to do with the size of the replicator area.
The quantity of replicated Grass items you require. Make sure your graphics card can handle it or you'll end up with 1fps (or less!)
FoliageRetries - DKW
When the replicator is tasked with finding a home for each Grass item, it will look at the configuration options described within the replicator and attempt to find a random position to place it. It will choose random locations and then see if they fit the configuration constraints, if not then it will try again. The replicator will attempt this for EACH object. If it does not succeed then it will give up for that object and continue with the next.
Area:
InnerRadiusX = "0"; You can make your foliage area a solid circle, or a ring, using these settings
InnerRadiusY = "0"; Set your InnerRadiusX,Y to zero(0) for a solid circle. For a ring, make them larger. Naturally, these have to be lower than the OuterRadiusX,Y.
The placement area for grass elementsis centered around the replicator position based upon an elliptical ring-area whose inner bound is defined with. The replicator will choose a random polar angle outside this region.
OuterRadiusX = "70"; Mathematically, you can determine the Area of your circle A=2pir then you can decide how many replications (folliageCount) to use to fill it.
OuterRadiusY = "70";
The placement area for grass elementsis centered around the replicator position based upon an elliptical ring-area whose outer bound is defined with. The replicator will choose a random polar angle inside this region.
Dimensions:
MinWidth = "1"; This is the minimum width of the folliageFile.png that will be displayed.
MaxWidth = "2"; If you want all the plants displayed as the same size, set all these to 1.
MinHeight = "1"; If you want some variation to plant dimensions, change them.
MaxHeight = "3"; They default to MinW=1, MaxW=3, MinH=1, MaxH=5
When placing Grass onto the terrain, the Grass can be optionally scaled randomly from Min to Max in Width/Height.
04/06/2007 (4:02 am)
03-28-2007: Torque 101: Folliage ReplicatorI've been playing with the folliage replicator for adding grasslands and folliage details to the world. Some of the properties I understand, some I don't.
Can anyone add to this? I'd like to submit it as a resource when all the details are in.
----------------------------------
Sim Base:
canSaveDynamicFields - is checked by default. Don't know why.
internalName... - is blank by default. Don't know why.
Transform: This is positioning information
position - is the location of the replicator center (I think).
rotation - you can change the rotation of your area, but it really screws up things. If the Z axis is not 0 then you get a flickering effect to the folliage. Leave it as 1 0 0 0
scale - I just leave it as 1 1 1. you can change the size of your area using x,y coordinates which we'll get into in a minute.
Debugging:
UseDebugInfo - unchecked by default. Don't know why. Things in italics come from the fxGrassTGE1.4 install.txt file.
This flag allows you to see relevant debugging information. For the moment I have enabled the ability to see the quad-tree boxes themselves. There are other things that can be enabled but I have decided to make them part of the code e.g. you need to uncomment lines within the code to enable them.
DebugBoxHeight - default as 1. Don't know why.
This field was requested by Phil Carlisle to enable you to control the height of the
quad-tree boxes shown on-screen. The value here is an interpolation.
1 = Top of quad-tree box / 0 = Bottom / .5 = Half way / etc.
This is to make it easier to see where the quad-boxes are when you have a big difference
between the lowest and highest billboards.
HideFolliage - unchecked by default.
This option allows you to temporary hide the replicated objects. This could be handy if the replicated objects are obscuring some detail you are editing. For instance, you may be hiding a secret key in the forest ... :)
ShowPlacementArea - checked by default.
The elliptical placement area that the replicator uses to replicate objects is not obvious from the configuration options. When this is turned on and you are within the editor, then a rather groovey coloured band sweeps around the circumference of the elliptical area selected. You can change this area and position by moving the replicator to see the exact bounds to which objects will be contained. Note, you can only see this band when you are within the editor and the replicator object is within the cameras' view.
PlacementAreaHeight - default is 25.
You can configure the placement band (see - 'ShowPlacementArea') to different heights. The band is clipped by objects within the scene and it can be hard to see sometimes particularly on hilly terrain. The 'height' is centered along the Z(0) axis of the replicator object.
PlacementColor - is 0.4 0 0.8 1 by default.
You can configure the placement band colour. The band defaults to a set colour and when using multiple replicators it it nice to configure each to it's own colour to differentiate each repliactor.
Media:
Seed - defaults as something huge like 814556372. I changed this to 10 for my first replicator, 20 for my second, 30 for my third, etc. Why? Because in the demo that's what they did, and it works.
This value is the Seed value for the random number generator. Changing this value results in a different distribution of pseudo-random numbers. You can change this value to almost anything if you are not happy with the placement of objects that has been choosen. Also, if you populate with multiple replicators then give each a different number. Note that a small value change here results in a completely different set of placements.
FolliageFile - this is where you get to select what .jpg or .png you want to show.
This allows you to select any texture file. Valid paths include the mod directory, so something like "fps/data/mycoolgrass1" would do fine. Sorry, no compound textures at the moment but that is coming. For the moment, simply use multiple replicator objects.
FolliageCount - this can be just about any number from 1 to 15,500 or maybe even bigger. Sometimes I must have made it too big because no folliage was displayed. I think it has something to do with the size of the replicator area.
The quantity of replicated Grass items you require. Make sure your graphics card can handle it or you'll end up with 1fps (or less!)
FoliageRetries - DKW
When the replicator is tasked with finding a home for each Grass item, it will look at the configuration options described within the replicator and attempt to find a random position to place it. It will choose random locations and then see if they fit the configuration constraints, if not then it will try again. The replicator will attempt this
Area:
InnerRadiusX = "0"; You can make your foliage area a solid circle, or a ring, using these settings
InnerRadiusY = "0"; Set your InnerRadiusX,Y to zero(0) for a solid circle. For a ring, make them larger. Naturally, these have to be lower than the OuterRadiusX,Y.
The placement area for grass elementsis centered around the replicator position based upon an elliptical ring-area whose inner bound is defined with
OuterRadiusX = "70"; Mathematically, you can determine the Area of your circle A=2pir then you can decide how many replications (folliageCount) to use to fill it.
OuterRadiusY = "70";
The placement area for grass elementsis centered around the replicator position based upon an elliptical ring-area whose outer bound is defined with
Dimensions:
MinWidth = "1"; This is the minimum width of the folliageFile.png that will be displayed.
MaxWidth = "2"; If you want all the plants displayed as the same size, set all these to 1.
MinHeight = "1"; If you want some variation to plant dimensions, change them.
MaxHeight = "3"; They default to MinW=1, MaxW=3, MinH=1, MaxH=5
When placing Grass onto the terrain, the Grass can be optionally scaled randomly from Min to Max in Width/Height.
#110
Keeps the aspect ratio of the original texture correct. The Height is choosen according to the above settings and is also used for the width as well to keep the aspect ratio correct.
FixSizeToMax = "0"; defaults to false (unchecked)
Fixes the size to the/ settings above (if you don't want random sizes).
OffsetZ = "0"; defaults to zero (0)
When placeing Grass onto the terrain, sometimes they do not quite meet the ground. Also, when they are allowed to be place on steep slopes they can sometimes stick out of the terrain looks damn silly. Use -Z values to lower Grass and +Z to raise them.
RandomFlip = "1"; defaults to true
Randomly flips the the billboard horizontally. This can add a little more variety to the billboard images. Obviously this is only effective on non-horizontally-symmetric textures.
Culling: Culling usually means some sort of polygon or diplay reduction, which will benefit performance.
UseCulling = "1"; defaults to true.
Turns-on the culling facility. If you are using the replicator to create only a few items or only in a very small area them the culling algorithm can actually slow things down slightly. This gives you the ability to turn it off although you should avoid this unless you are sure you know what you're doing!
CullResolution = "64";
The culling algorithm is difficult to explain but it is essential to understanding how to efficiently control large quantities of billboards. Without culling *all* grass elementsare tested to see if they are in view and if so they are rendered. If your grass elementsare spread out over a large distance then chances are that you won't be able to view many of them but they are still tested to see if they are in view. The culling algorithm avoids this and only tests the ones that are in view. How can it know this without testing them, chicken and the egg I hear you shout! Well, the replicator creates a structured database of grass elementsand their positions at the level startup phases. Basically the algorithm splits up your total defined area (see 'RadiusOuterX/Y') into quadrants the smallests of which is this field 'CullResolution'. Above these are progressively larger blocks which cover each lower quadrant. Imagine a cube of blocks where each block has four smaller blocks directly below it repreating for many levels until each small block is your resolution. Teh algorithm can check the larger block first and check to see if it's in view. If it's not it can effectively ignore all the smaller sub-areas below it therefore removing the need to check them. I told you this was difficult to explain!
Basically, the rule is that the replicator will split up the replicated area into blocks the size of 'CullResolution'. The larger your area, the more time and memory are needed to create this structure. Try to keep the 'CullResolution' large enough so that good-size blocks of Grass can be checked quickly but not too large that the blocks are as big as your viewing frustum. Also, your viewing frustum is not simply the 'VisibleDistance' as set in the "Sky" object but the smaller of that or the 'ViewDistance'+'FadeInRegion' as set in this object.
Example:-
The 'VisibleDistance' is 500,
The 'RadiusOuterX/Y' are 512 (an area 1024 squared),
The 'ViewDistance' is 250 and the 'FadeInRegion' is '50'.
A good setting fr this scene would be 64 as the area is quite large (1024 squared) and results in 1024/64 highest resolution blocks.
IMPORTANT NOTE:-
The algorithm is more memory efficient if the 'CullResolution' can divide the largest diameter of the replicator evenly. Also I have clamped 'CullResolution' so that you cannot set it higher than half the largest diameter or lower than 8. Values lower than 8 can result in hundreds of megabytes being allocated for sizable areas!
Use to aid you. If the boxes are spaced very far apart you can try reducing the value else make it bigger if the boxes are very close. At all times monitor you FPS when tweaking this value as it's the ultimate guide.
Values of 16/32/64/128/256 are good depending upon your area/visible distance.
This algorithm allows you to maintain *massive* quantities of Grass easily but you must be aware of the memory usage. To this end, the replicator dumps various information to the console each time it creates Grass (@startup & Editor/Apply). You get information such as Node allocations/Time Taken for analysis and approximate memory usages.
ViewDistance = "50";
Controls the point at which the Grass will be completely faded-in.
ViewClosest = "1";
Controls the point nearest to the camera at which the Grass will start fading-out. This can be use to stop Grass enterng the cabin when a vehicle like the Racing demo.
FadeInRegion = "10";
FadeOutRegion = "1";
Controls the distances which the fade-in/out will take place. A larger value will result in a slower/longer fade-in/out. The FadeIn/Out extend the ViewDistance/ViewCloset parameters.
AlphaCutoff = "0.2";
Allows you to control the alpha level at which the rendering takes place. This can be very handy in feathering the edges of the Grass.
GroundAlpha = "1";
Allows you to control the alpha level at the base of the billboard. This allows you to reduce the harsh intersection that grass elements have with the terrain.
Animation:
SwayOn = "0"; Checked allows the folliage to sway back and forth.
SwaySync = "0"; Checked has all folliage in this replicator swaying in rhythm
SwayMagSide = "0.1"; Distance of sway side to side
SwayMagFront = "0.2"; Distance of sway to back
MinSwayTime = "3"; time period of sway in seconds. Lower number sways faster than larger number.
MaxSwayTime = "10";
Lighting:
LightOn = "0"; Checked turns on the animation lighting.
LightSync = "0"; All folliage in this replication has the same lighting
MinLuminance = "0.7"; from zero (0) to one (1)
MaxLuminance = "1"; from zero (0) to one (1)
LightTime = "5"; Time it takes to change from MinLuminance to MaxLuminance in seconds
Restrictions:
AllowOnTerrain = "1";
AllowOnInteriors = "0";
AllowOnStatics = "0";
When the replicator is choosing positions to place Grass you can choose whether to allow or disallow four different object types onto which they can be placed. This provides a very powerful means of placement.
AllowOnWater = "0"; If this is checked (or 1) then your folliage will be shown under Water surfaces.
AllowWaterSurface = "0"; Cool for things floating on water, like lilypads or algae.
When the replicator is allowed to placed the objects on water then this option controls whether the objects are allowed to be placed on the surface or the underlying terrain.
AllowedTerrainSlope = "90"; This is theangle of terrain which will allow folliage to be displayed. If you set it at 0, then only flat surface will display folliage. I recommend setting it to less than 45. In my game, it's set at 5.
When placing objects onto the terrain (or other objects) the replicator will ensure that it meets the slope requirements. You can control the maximum slope (from the 'Up' vector 'Z' in degrees). 90degrees gives almost no restriction but something like 15degrees only allows objects to be placed on fairly flat terrain.
04/06/2007 (4:07 am)
FixAspectRatio = "1"; defaults to true (checked) Keeps the aspect ratio of the original texture correct. The Height is choosen according to the above settings and is also used for the width as well to keep the aspect ratio correct.
FixSizeToMax = "0"; defaults to false (unchecked)
Fixes the size to the
OffsetZ = "0"; defaults to zero (0)
When placeing Grass onto the terrain, sometimes they do not quite meet the ground. Also, when they are allowed to be place on steep slopes they can sometimes stick out of the terrain looks damn silly. Use -Z values to lower Grass and +Z to raise them.
RandomFlip = "1"; defaults to true
Randomly flips the the billboard horizontally. This can add a little more variety to the billboard images. Obviously this is only effective on non-horizontally-symmetric textures.
Culling: Culling usually means some sort of polygon or diplay reduction, which will benefit performance.
UseCulling = "1"; defaults to true.
Turns-on the culling facility. If you are using the replicator to create only a few items or only in a very small area them the culling algorithm can actually slow things down slightly. This gives you the ability to turn it off although you should avoid this unless you are sure you know what you're doing!
CullResolution = "64";
The culling algorithm is difficult to explain but it is essential to understanding how to efficiently control large quantities of billboards. Without culling *all* grass elementsare tested to see if they are in view and if so they are rendered. If your grass elementsare spread out over a large distance then chances are that you won't be able to view many of them but they are still tested to see if they are in view. The culling algorithm avoids this and only tests the ones that are in view. How can it know this without testing them, chicken and the egg I hear you shout! Well, the replicator creates a structured database of grass elementsand their positions at the level startup phases. Basically the algorithm splits up your total defined area (see 'RadiusOuterX/Y') into quadrants the smallests of which is this field 'CullResolution'. Above these are progressively larger blocks which cover each lower quadrant. Imagine a cube of blocks where each block has four smaller blocks directly below it repreating for many levels until each small block is your resolution. Teh algorithm can check the larger block first and check to see if it's in view. If it's not it can effectively ignore all the smaller sub-areas below it therefore removing the need to check them. I told you this was difficult to explain!
Basically, the rule is that the replicator will split up the replicated area into blocks the size of 'CullResolution'. The larger your area, the more time and memory are needed to create this structure. Try to keep the 'CullResolution' large enough so that good-size blocks of Grass can be checked quickly but not too large that the blocks are as big as your viewing frustum. Also, your viewing frustum is not simply the 'VisibleDistance' as set in the "Sky" object but the smaller of that or the 'ViewDistance'+'FadeInRegion' as set in this object.
Example:-
The 'VisibleDistance' is 500,
The 'RadiusOuterX/Y' are 512 (an area 1024 squared),
The 'ViewDistance' is 250 and the 'FadeInRegion' is '50'.
A good setting fr this scene would be 64 as the area is quite large (1024 squared) and results in 1024/64 highest resolution blocks.
IMPORTANT NOTE:-
The algorithm is more memory efficient if the 'CullResolution' can divide the largest diameter of the replicator evenly. Also I have clamped 'CullResolution' so that you cannot set it higher than half the largest diameter or lower than 8. Values lower than 8 can result in hundreds of megabytes being allocated for sizable areas!
Use
Values of 16/32/64/128/256 are good depending upon your area/visible distance.
This algorithm allows you to maintain *massive* quantities of Grass easily but you must be aware of the memory usage. To this end, the replicator dumps various information to the console each time it creates Grass (@startup & Editor/Apply). You get information such as Node allocations/Time Taken for analysis and approximate memory usages.
ViewDistance = "50";
Controls the point at which the Grass will be completely faded-in.
ViewClosest = "1";
Controls the point nearest to the camera at which the Grass will start fading-out. This can be use to stop Grass enterng the cabin when a vehicle like the Racing demo.
FadeInRegion = "10";
FadeOutRegion = "1";
Controls the distances which the fade-in/out will take place. A larger value will result in a slower/longer fade-in/out. The FadeIn/Out extend the ViewDistance/ViewCloset parameters.
AlphaCutoff = "0.2";
Allows you to control the alpha level at which the rendering takes place. This can be very handy in feathering the edges of the Grass.
GroundAlpha = "1";
Allows you to control the alpha level at the base of the billboard. This allows you to reduce the harsh intersection that grass elements have with the terrain.
Animation:
SwayOn = "0"; Checked allows the folliage to sway back and forth.
SwaySync = "0"; Checked has all folliage in this replicator swaying in rhythm
SwayMagSide = "0.1"; Distance of sway side to side
SwayMagFront = "0.2"; Distance of sway to back
MinSwayTime = "3"; time period of sway in seconds. Lower number sways faster than larger number.
MaxSwayTime = "10";
Lighting:
LightOn = "0"; Checked turns on the animation lighting.
LightSync = "0"; All folliage in this replication has the same lighting
MinLuminance = "0.7"; from zero (0) to one (1)
MaxLuminance = "1"; from zero (0) to one (1)
LightTime = "5"; Time it takes to change from MinLuminance to MaxLuminance in seconds
Restrictions:
AllowOnTerrain = "1";
AllowOnInteriors = "0";
AllowOnStatics = "0";
When the replicator is choosing positions to place Grass you can choose whether to allow or disallow four different object types onto which they can be placed. This provides a very powerful means of placement.
AllowOnWater = "0"; If this is checked (or 1) then your folliage will be shown under Water surfaces.
AllowWaterSurface = "0"; Cool for things floating on water, like lilypads or algae.
When the replicator is allowed to placed the objects on water then this option controls whether the objects are allowed to be placed on the surface or the underlying terrain.
AllowedTerrainSlope = "90"; This is theangle of terrain which will allow folliage to be displayed. If you set it at 0, then only flat surface will display folliage. I recommend setting it to less than 45. In my game, it's set at 5.
When placing objects onto the terrain (or other objects) the replicator will ensure that it meets the slope requirements. You can control the maximum slope (from the 'Up' vector 'Z' in degrees). 90degrees gives almost no restriction but something like 15degrees only allows objects to be placed on fairly flat terrain.
#111
huge! Kork stands 80 QuArK units tall and 64 QuArK units wide.
That's the equivalent of 2.5 meters tall, about 10 feet tall, and 2 meters wide, over six feet across the
shoulders. Now that may be perfectly accurate for an Orc, however, our Elf Girl is also 80 QuArK units
tall. Granted, she is only 32 QuArK units wide, but come on. A ten foot tall Elf Girl thats over three feet
across the shoulders. Maybe an Amazon, but not a typical Elf as far as I'm concerned.
I think a better reference would be to make a standard Torque meter equal to 64 QuArK units. Now
Kork is only about 5 feet tall, and 3 feet wide. Elf girl is 5 feet tall and 18 inches across the shoulders.
That seems a little more reasonable/accurate to me.
OR, one QuArK unit is equal to one inch. Then Kork is 6 feet 8 inches tall, and 5 feet 4 inches across the
shoulders. Equal to one very large professional football player in full pads.
Regardless, here's how it works. If Kork is 80 QU tall, then doorways should be at least 81 QU high.
Better yet, make the doorways 84 or even 88 high. Kork is 64 wide, therefore doorways should be at
least 65 wide and preferably 68-72 wide.
I'll make mine 88 high and 72 wide from now on.
...
88 x 72 is still too small. Kork's bounding box must be about 80 x 80. See a screenshot here:
www.geocities.com/infinitum3d/size02.jpg
Tony
04/06/2007 (4:08 am)
OK, people have said that one Torque meter is about equal to 32 QuArK units. If that's true, then Kork is huge! Kork stands 80 QuArK units tall and 64 QuArK units wide.
That's the equivalent of 2.5 meters tall, about 10 feet tall, and 2 meters wide, over six feet across the
shoulders. Now that may be perfectly accurate for an Orc, however, our Elf Girl is also 80 QuArK units
tall. Granted, she is only 32 QuArK units wide, but come on. A ten foot tall Elf Girl thats over three feet
across the shoulders. Maybe an Amazon, but not a typical Elf as far as I'm concerned.
I think a better reference would be to make a standard Torque meter equal to 64 QuArK units. Now
Kork is only about 5 feet tall, and 3 feet wide. Elf girl is 5 feet tall and 18 inches across the shoulders.
That seems a little more reasonable/accurate to me.
OR, one QuArK unit is equal to one inch. Then Kork is 6 feet 8 inches tall, and 5 feet 4 inches across the
shoulders. Equal to one very large professional football player in full pads.
Regardless, here's how it works. If Kork is 80 QU tall, then doorways should be at least 81 QU high.
Better yet, make the doorways 84 or even 88 high. Kork is 64 wide, therefore doorways should be at
least 65 wide and preferably 68-72 wide.
I'll make mine 88 high and 72 wide from now on.
...
88 x 72 is still too small. Kork's bounding box must be about 80 x 80. See a screenshot here:
www.geocities.com/infinitum3d/size02.jpg
Tony
#112
1. Back Up Everything
2. Following the Tutorial RPGDialog by Nelson A. K. Gonsalves
Make sure to use the correct directories. My folder is called GameOne_Starter.FPS, so I have to
change all the starter.fps to GameOne_Starter.FPS.
1st alteration to tutorial;
In common/main.cs, I don't have a line exec("./client/scriptDoc.cs");
So I put this:
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("./RPGDialogEditor/ingameRPGDialogEditor.cs");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
in
function initBaseClient()
If this doesn't work, I'll dl RealmWars again and find out where in main.cs scriptDoc.cs is.
...
I cannot find the line exec("./client/scriptDoc.cs"); in the Realm Wars common/main.cs either.
Line 33 (according to the tutorial) is in the function initBaseClient(), so that's where I'm putting the
code.
//--------------------
//--------------------
//--------------------
EDIT! THIS NEEDS TO BE PLACED BETWEEN THE LAST TWO } AT THE END OF THE
FUNCTION!!!
So somewhere at the bottom of the function initBaseClient() before the function loadMainMenu()
it should look like this:
}
else {
// Otherwise go to the splash screen.
Canvas.setCursor("DefaultCursor");
loadStartup();
}
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
initRPGDialogEditor();
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
}
//-----------------------------------------------------------------------------
function loadMainMenu()
END EDIT!!!
//----------------
//----------------
//----------------
...
2nd alteration
In \client\scripts\client\ there is no config.cs. So I created one, and put in the code;
moveMap.bind(keyboard, "q", TalkTo);
3rd
In example\starter.fps\client\scripts\default.bind.cs
Comment out both lines;
//--moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Crossbow\");", "");
//--moveMap.bindCmd(keyboard, "2", "commandToServer('use',\"Rifle\");", "");
4th
Actually, this is just a clarification-
There are two places in \client\init.cs with the line Canvas.setCursor("DefaultCursor");
I'm placing the code at the very end, after the function loadMainMenu()
Now, it says to enter the game and execute SpawnTestNPC(); on the console.
PROBLEM #1
I get the error message;
GameOne_Starter.FPS/server/RPGDialog.cs (173): Unable to find function AIPlayer::spawn
Is this a source problem, or a script problem?
PROBLEM #2
F5 brings up the Particle Editor, not the RPG Dialog editor.
That means my bind.cmd somewhere is incorrect, right?
PROBLEM #3
If I try to execute the Dialog editor using the console command line -mod common/RPGDialogEditor[i] I
get parse error in red.
What is a parse error?
...
Found out this;
What demo?
5th
Just for the record, I never moved the datablock and still got it to work. It's possible that the datablock is
correct in TGE1.5.2, which is what I'm using.
BTW, the DEMO is another folder in the TGE_1_5_2\example folder (along with starter.fps and
starter.racing).
...
For some reason I don't have AIPlayer.cs in the /server/scripts folder. I copied it from starter.fps into
GameOne_Starter.FPS/server/scripts
Deleting .dso's to force recompile.
Running Torque again...
AIPlayer.cs compiles, Kork spawns, but F5 still loads the Particle Editor.
Note: This gets corrected at the end of this post. I change F5 to F6 and... just keep reading
Console command -mod common/RPGDialogEditor doesn't load the RPGDialog Editor either. I still
get parse error in red.
SpawnTestNPC(); does spawn A Test NPC and q does bring up the dialog box. And clicking
please kill ne does cause 'A Test NPC' to kill my character. I just have to figure out how to open the
Dialog Editor now.
One bug. If I get too close to A Test NPC he starts to spin around in circles. I have to press
q and then take a step back.
This is a good start. I can spawn NPC's and talk with them, but I still need to find the Dialog Editor. I
think I'll go back injto my BindKey commands and set the BindKey to a key other than F5. Come to think
of it, I don't remember ever setting it to F5. ???
In example\common\RPGDialogEditor\ingameRPGDialogEditor.cs there is the line
GlobalActionMap.bind(keyboard, "f5", toggleRPGDialogEditor); I'm going to try changing it to
f6
...
F6 still doesn't bring up the editor. I'm getting a console error saying unable to find
MainEditorScreenGui which means ingameRPGDialogEditor.cs points to the wrong directory, or
to put it another way, my gui files are in the wrong directory.
Let me check it out.
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\ingameRPGDialogEditor.cs says;
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\ingameRPGDialogEditor.cs compiles,
but
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\defaults.cs
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\editorMain.cs
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\main.cs
and C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\prefs.cs do NOT compile.
Now I have to find out where these files are exec'd. I think they should be exec'd in common\main
just like C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\ingameRPGDialogEditor.cs.
05/25/2007 (6:08 pm)
05-23-2007 Torque 101: Adding RPG Dialog1. Back Up Everything
2. Following the Tutorial RPGDialog by Nelson A. K. Gonsalves
Make sure to use the correct directories. My folder is called GameOne_Starter.FPS, so I have to
change all the starter.fps to GameOne_Starter.FPS.
1st alteration to tutorial;
In common/main.cs, I don't have a line exec("./client/scriptDoc.cs");
So I put this:
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("./RPGDialogEditor/ingameRPGDialogEditor.cs");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
in
function initBaseClient()
If this doesn't work, I'll dl RealmWars again and find out where in main.cs scriptDoc.cs is.
...
I cannot find the line exec("./client/scriptDoc.cs"); in the Realm Wars common/main.cs either.
Line 33 (according to the tutorial) is in the function initBaseClient(), so that's where I'm putting the
code.
//--------------------
//--------------------
//--------------------
EDIT! THIS NEEDS TO BE PLACED BETWEEN THE LAST TWO } AT THE END OF THE
FUNCTION!!!
So somewhere at the bottom of the function initBaseClient() before the function loadMainMenu()
it should look like this:
}
else {
// Otherwise go to the splash screen.
Canvas.setCursor("DefaultCursor");
loadStartup();
}
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
initRPGDialogEditor();
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
}
//-----------------------------------------------------------------------------
function loadMainMenu()
END EDIT!!!
//----------------
//----------------
//----------------
...
2nd alteration
In \client\scripts\client\ there is no config.cs. So I created one, and put in the code;
moveMap.bind(keyboard, "q", TalkTo);
3rd
In example\starter.fps\client\scripts\default.bind.cs
Comment out both lines;
//--moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Crossbow\");", "");
//--moveMap.bindCmd(keyboard, "2", "commandToServer('use',\"Rifle\");", "");
4th
Actually, this is just a clarification-
There are two places in \client\init.cs with the line Canvas.setCursor("DefaultCursor");
I'm placing the code at the very end, after the function loadMainMenu()
Now, it says to enter the game and execute SpawnTestNPC(); on the console.
PROBLEM #1
I get the error message;
GameOne_Starter.FPS/server/RPGDialog.cs (173): Unable to find function AIPlayer::spawn
Is this a source problem, or a script problem?
PROBLEM #2
F5 brings up the Particle Editor, not the RPG Dialog editor.
That means my bind.cmd somewhere is incorrect, right?
PROBLEM #3
If I try to execute the Dialog editor using the console command line -mod common/RPGDialogEditor[i] I
get parse error in red.
What is a parse error?
...
Found out this;
Quote:
[i]moved the datablock PlayerData(LightMaleHumanArmor) from the "demo" to your project if it doesn't
exist, otherwise the "spawnTestNPC();" function will not work"
What demo?
5th
Just for the record, I never moved the datablock and still got it to work. It's possible that the datablock is
correct in TGE1.5.2, which is what I'm using.
BTW, the DEMO is another folder in the TGE_1_5_2\example folder (along with starter.fps and
starter.racing).
...
For some reason I don't have AIPlayer.cs in the /server/scripts folder. I copied it from starter.fps into
GameOne_Starter.FPS/server/scripts
Deleting .dso's to force recompile.
Running Torque again...
AIPlayer.cs compiles, Kork spawns, but F5 still loads the Particle Editor.
Note: This gets corrected at the end of this post. I change F5 to F6 and... just keep reading
Console command -mod common/RPGDialogEditor doesn't load the RPGDialog Editor either. I still
get parse error in red.
SpawnTestNPC(); does spawn A Test NPC and q does bring up the dialog box. And clicking
please kill ne does cause 'A Test NPC' to kill my character. I just have to figure out how to open the
Dialog Editor now.
One bug. If I get too close to A Test NPC he starts to spin around in circles. I have to press
q and then take a step back.
This is a good start. I can spawn NPC's and talk with them, but I still need to find the Dialog Editor. I
think I'll go back injto my BindKey commands and set the BindKey to a key other than F5. Come to think
of it, I don't remember ever setting it to F5. ???
In example\common\RPGDialogEditor\ingameRPGDialogEditor.cs there is the line
GlobalActionMap.bind(keyboard, "f5", toggleRPGDialogEditor); I'm going to try changing it to
f6
...
F6 still doesn't bring up the editor. I'm getting a console error saying unable to find
MainEditorScreenGui which means ingameRPGDialogEditor.cs points to the wrong directory, or
to put it another way, my gui files are in the wrong directory.
Let me check it out.
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\ingameRPGDialogEditor.cs says;
Quote:
function initRPGDialogEditor()
{
exec("~/RPGDialogEditor/ui/MainEditorScreenGui.gui");
exec("~/RPGDialogEditor/ui/EditQuestionGui.gui");
exec("~/RPGDialogEditor/ui/EditAnswerGui.gui");
exec("~/RPGDialogEditor/ui/NewScriptPopup.gui");
exec("~/RPGDialogEditor/ui/SetPathsPopup.gui");
exec("~/RPGDialogEditor/ui/EditorOpeningGui.gui");
exec("~/RPGDialogEditor/defaults.cs");
exec("~/RPGDialogEditor/prefs.cs");
exec("~/RPGDialogEditor/editorMain.cs");
PopulateActionList();
PopulateQuestionOptionsList();
GlobalActionMap.bind(keyboard, "f6", toggleRPGDialogEditor);
}
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\ingameRPGDialogEditor.cs compiles,
but
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\defaults.cs
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\editorMain.cs
C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\main.cs
and C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\prefs.cs do NOT compile.
Now I have to find out where these files are exec'd. I think they should be exec'd in common\main
just like C:\Torque\TGE_1_5_2\example\common\RPGDialogEditor\ingameRPGDialogEditor.cs.
#113
So now common\main.cs looks like this;
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("./RPGDialogEditor/ingameRPGDialogEditor.cs");
exec("./RPGDialogEditor/editorMain.cs");
exec("./RPGDialogEditor/defaults.cs");
exec("./RPGDialogEditor/main.cs");
exec("./RPGDialogEditor/prefs.cs");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
Deleting .dso's, and starting Torque.
...
OK, I got a console error saying; unable to find function initRPGDialogEditor();
So, therefore, this needs to be moved into a function- (I just had it at the end of the script) Move this up
into the function, just before the final }.
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
initRPGDialogEditor();
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
deleting dso's and running Torque.
F6 WORKS!!!! (NOTE: I MADE AN EDIT EARLY IN THIS POST CORRECTING THIS ERROR)
I can enter the dialog editor, my AI spawns, and I can have a conversation. Console commands also work
to SpawnTestNPC and open DialogEditor.
This would have been so much easier if i were a programmer. I would have known where to place my
initRPGDialogEditor(); code from the beginning.
Anyways, IT WORKS!!! And it only took me two days to do it. Personally, I think it should be included
in the download.
Now I just have to figure out how to assign different dsq/dsa's to different NPC's. Can't have all the NPC's
with the same information.
Thanks go out to all those who posted comments in the resource. They really helped me!
More to come.
Tony
05/25/2007 (6:08 pm)
I'm adding the lines to exec the other files.So now common\main.cs looks like this;
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("./RPGDialogEditor/ingameRPGDialogEditor.cs");
exec("./RPGDialogEditor/editorMain.cs");
exec("./RPGDialogEditor/defaults.cs");
exec("./RPGDialogEditor/main.cs");
exec("./RPGDialogEditor/prefs.cs");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
Deleting .dso's, and starting Torque.
...
OK, I got a console error saying; unable to find function initRPGDialogEditor();
So, therefore, this needs to be moved into a function- (I just had it at the end of the script) Move this up
into the function, just before the final }.
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
initRPGDialogEditor();
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
deleting dso's and running Torque.
F6 WORKS!!!! (NOTE: I MADE AN EDIT EARLY IN THIS POST CORRECTING THIS ERROR)
I can enter the dialog editor, my AI spawns, and I can have a conversation. Console commands also work
to SpawnTestNPC and open DialogEditor.
This would have been so much easier if i were a programmer. I would have known where to place my
initRPGDialogEditor(); code from the beginning.
Anyways, IT WORKS!!! And it only took me two days to do it. Personally, I think it should be included
in the download.
Now I just have to figure out how to assign different dsq/dsa's to different NPC's. Can't have all the NPC's
with the same information.
Thanks go out to all those who posted comments in the resource. They really helped me!
More to come.
Tony
#114
function moveforward(%val)
{
$mvForwardAction = %val * $movementSpeed ; //--- doesn't this determine rate of movement?
}
This should work:
function sprint(%val)
{
$mvForwardAction = %val * $movementSpeed * 5;
}
Shouldn't that multiply it by 5?
Seems simple, but once again, I'm not a programmer.
Here's my final solution;
in player.cs set your fastest movement speed
MaxForwardSpeed = 50;
in default.bind.cs I've changed movement speed from 1
$movementSpeed = 0.2;
This works fine. My player now jogs at a leisurely 10 m/s.
Then (still in default.bind.cs) I added this sprint function just after function moveforward(%val)
function sprint(%val)
{
$mvForwardAction = %val * $movementSpeed * 5;
}
and further down (still in default.bind.cs) I added this call just after moveMap.bind(keyboard, w, moveforward);
moveMap.bind(keyboard, "alt w", sprint); //--call the Sprint function
Then, I deleted the config.cs file, deleted all my .dso's, and ran the game. It works! I jog at 10 m/s using the W key, and I run full speed using ALT+W to sprint.
No server calls. Just change two values and add a sprint function to default.bind.cs
Note: Instead of "alt w" you could use a plain letter key like S without the quotations, as long as S is not bound to anything else.
I'd like to thank Amr Bekhit for inspiration and assistance, and mb for clarifying many, many things for me. These two deserve credit for this, not me.
Tony
BTW: I've added this as a resource:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13082
06/19/2007 (6:50 am)
If pressing W moves you forward at 10 m/s, why can't multiplying that by five ($movementSpeed * 5) move you forward at 50 m/s.function moveforward(%val)
{
$mvForwardAction = %val * $movementSpeed ; //--- doesn't this determine rate of movement?
}
This should work:
function sprint(%val)
{
$mvForwardAction = %val * $movementSpeed * 5;
}
Shouldn't that multiply it by 5?
Seems simple, but once again, I'm not a programmer.
Here's my final solution;
in player.cs set your fastest movement speed
MaxForwardSpeed = 50;
in default.bind.cs I've changed movement speed from 1
$movementSpeed = 0.2;
This works fine. My player now jogs at a leisurely 10 m/s.
Then (still in default.bind.cs) I added this sprint function just after function moveforward(%val)
function sprint(%val)
{
$mvForwardAction = %val * $movementSpeed * 5;
}
and further down (still in default.bind.cs) I added this call just after moveMap.bind(keyboard, w, moveforward);
moveMap.bind(keyboard, "alt w", sprint); //--call the Sprint function
Then, I deleted the config.cs file, deleted all my .dso's, and ran the game. It works! I jog at 10 m/s using the W key, and I run full speed using ALT+W to sprint.
No server calls. Just change two values and add a sprint function to default.bind.cs
Note: Instead of "alt w" you could use a plain letter key like S without the quotations, as long as S is not bound to anything else.
I'd like to thank Amr Bekhit for inspiration and assistance, and mb for clarifying many, many things for me. These two deserve credit for this, not me.
Tony
BTW: I've added this as a resource:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13082
#115
Anyway can you guys make like a new thread topic torque script 101 all about scripting so that people
who know all about torque functions can know how to make their own game without using the already made files?
Man you guys are really smart. Im going to make thread called torquescript 101. saska you and infinitum
can give noobs like us learn torquescript.
p.s. please start by making a graph of how to place your files in your folders and in the main directories.
then explain main.cs, then what goes in the first folder. Ill come up with other stuff later.
06/27/2007 (9:16 pm)
Wow this is like 2 years worth of code and tutorials how do i read it through the night?Anyway can you guys make like a new thread topic torque script 101 all about scripting so that people
who know all about torque functions can know how to make their own game without using the already made files?
Man you guys are really smart. Im going to make thread called torquescript 101. saska you and infinitum
can give noobs like us learn torquescript.
p.s. please start by making a graph of how to place your files in your folders and in the main directories.
then explain main.cs, then what goes in the first folder. Ill come up with other stuff later.
#116
06/27/2007 (9:25 pm)
Why is it that im always like the last one to post stuff?
#117
@Taslim - I can tell how eager you are to learn as much about Torque as possible, and that's a good thing =), but making threads titled similarly to "Torquescript 101", just to have others post their information and tutorials (instead of you) is a stumbling block for other new comers who find it during searches.
That's why we have the TDN and resources. This thread is one of those rare threads that is very instructional, and should be made into a full resource on the TDN and GG resource page.
Finally, if you want a starting place to make a Torque game using the absolute minimum existing files, go to my profile page, and look for my resources: New Torque Documentation/Tutorials.
Sorry to hijack. Keep up the amazing work Infinitum3D.
06/28/2007 (5:32 am)
@Infinitum3D - If I haven't said it before, awesome, AWESOME work with this thread. Your posts here are very informative and are a shining example of the Torque community contribution factor.@Taslim - I can tell how eager you are to learn as much about Torque as possible, and that's a good thing =), but making threads titled similarly to "Torquescript 101", just to have others post their information and tutorials (instead of you) is a stumbling block for other new comers who find it during searches.
That's why we have the TDN and resources. This thread is one of those rare threads that is very instructional, and should be made into a full resource on the TDN and GG resource page.
Finally, if you want a starting place to make a Torque game using the absolute minimum existing files, go to my profile page, and look for my resources: New Torque Documentation/Tutorials.
Sorry to hijack. Keep up the amazing work Infinitum3D.
#119
@Taslim - thanks for posting!
Good suggestion. I'll start working on that on Monday, although I'm certainly no Torque expert. I search the resources and forums just everyone else. I'll see what I can come up with.
Edit: Look here www.garagegames.com/mg/forums/result.thread.php?qt=63993
Tony
06/29/2007 (7:31 pm)
@Michael and Will - thanks for the support!!!@Taslim - thanks for posting!
Quote:
please start by making a graph of how to place your files in your folders and in the main directories.
then explain main.cs, then what goes in the first folder.
Good suggestion. I'll start working on that on Monday, although I'm certainly no Torque expert. I search the resources and forums just everyone else. I'll see what I can come up with.
Edit: Look here www.garagegames.com/mg/forums/result.thread.php?qt=63993
Tony
#120
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//--This is my attempt to create a door using the simplest code possible.
//--This creates a door at a pre-determined (hard-coded) location,
//-- and rotates it open (into a hard-coded location) on collision.
//--There is no animation. One second the door is closed, the next it is open.
//--This is the very basics of a door script. It should be expanded upon.
//--create the datablock for a door
datablock StaticShapeData(DoorItem)
{
category = "Doors";
shapeFile = "~/data/shapes/doors/door.dts";
};
//--create the door in-game
new DoorItem()
{
dataBlock = "DoorItem";
//transform = "222.2 -727.3 108.1 0 0 1 130";
position = "222.2 -727.3 108.1";
rotation = "0 0 1 130";
scale = ".2 .2 .17";
};
//--collision detection to open door
function DoorItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%client = %col.client;
echo("Player collides with door!");
%obj.setTransform("222.2 -725 108.1 0 0 1 180");
echo("Door opens!");
}
}
//--TODO - modify the hard-coding so that a door can be placed using the World Editor.
//-- I think this can be done using the 'getTransform' and 'setTransform' features.
07/03/2007 (3:30 pm)
//-----------------------------------------------------------------------------// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//--This is my attempt to create a door using the simplest code possible.
//--This creates a door at a pre-determined (hard-coded) location,
//-- and rotates it open (into a hard-coded location) on collision.
//--There is no animation. One second the door is closed, the next it is open.
//--This is the very basics of a door script. It should be expanded upon.
//--create the datablock for a door
datablock StaticShapeData(DoorItem)
{
category = "Doors";
shapeFile = "~/data/shapes/doors/door.dts";
};
//--create the door in-game
new DoorItem()
{
dataBlock = "DoorItem";
//transform = "222.2 -727.3 108.1 0 0 1 130";
position = "222.2 -727.3 108.1";
rotation = "0 0 1 130";
scale = ".2 .2 .17";
};
//--collision detection to open door
function DoorItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%client = %col.client;
echo("Player collides with door!");
%obj.setTransform("222.2 -725 108.1 0 0 1 180");
echo("Door opens!");
}
}
//--TODO - modify the hard-coding so that a door can be placed using the World Editor.
//-- I think this can be done using the 'getTransform' and 'setTransform' features.
Torque 3D Owner Tony Richards
Garage Games didn't give up on CVS, they just gave up on maintaining it for security / licensing reasons. CVS / Subversion has pretty crappy security (i.e. it's very secure if you set them up with passwords / SSL, etc, but you can't limit user access). Since TGE 1.5, they couldn't very well give everyone access to the latest version via CVS and also charge extra for TGE 1.5.
Let me give you an example of what a version system like CVS or Subversion (or a multitude of other non-free products) can give you:
You have a "trunk" version that you can decide is your current stable version or the version where all new development takes place. (best practice is to always have "trunk" as stable, and all new development goes into a branch).
If you want to do something experimental (like add a new feature), you can create and switch to a new branch, and make your changes. If your changes work, merge them into the trunk. If they don't, abandon them.
Another nifty trick is keeping track of vendor drops. Say you get the source code for TGE 1.5... you make a branch for that that's outside of your normal branching system / trunk. You make your normal changes, create your game, then TGE 1.6 comes out.
You can easily switch to the TGE 1.5 vendor drop, drop in the new 1.6 changes and merge the changes with your existing trunk.... you might get some conflicts, but for the most part you'll get a seamless merge of everything Garage Games did plus everything that you've done for your game.
Anyways, there's tons more reasons as to why you should use CVS or Subversion.... again, if you're having problems understand why or how, please please, ask.... I'm more than happy to help.
Like I said before, I don't always keep up to date on these forums, so if you post a question and I don't respond, shoot me an e-mail or catch me on IRC.