TGE Progress and Accomplishments
by Ethan Groves · 01/20/2007 (8:24 am) · 11 comments
It's been about two weeks since Tim Aste gave me the link to download TGE 1.5, so I thought I would take a few moments to document my progress so far. Most of my "accomplishments" will probably sound like baby steps to most of you, but considering the fact that this is the first time I've seen any of the material, I feel like I'm making leaps and bounds!
The first day I got Torque, I mostly just explored around, trying to identify the important files, scripts, and objects. Although most of what I did was just messing around, I still wanted to be able to feel like I had done something meaningful. So I jumped into the scripts and started altering things.
After some initial exploring inside the scripts, the first thing I did was to move the max camera distance (in 3rd person view) further away from Kork. After more exploring, I messed around with the projectile explosion particle settings and made the explosions much more impressive. I made them bigger, fuller, and changed the colors around a little bit. Later, I changed the projectile's ballistics setting to "true," so that it would fly more like a real arrow. The velocity setting was a bit too powerful, so I turned it down. I also messed with the gravity settings, but the arrow flight still didn't "feel" right. I messed with it for a while, but I never did get the "feel" I was looking for.
Over the next few days I created my first successful .dts model (a bow), and switched out Kork's default crossbow, putting my new bow model in its place (I also switched out the projectile).
The arrow sits off to one side of the bow, but that is temporary.
Aim...
FIRE!
I still haven't gotten the animations for my bow to work, but I'm not too worried about that at this point. I think it's just a matter of changing the animation names. I am wondering how to make separate .dsq animations... And also how to make .dif models.
After messing around with the explosion particle settings, I decided to take them out all together. I didn't think that exploding arrows were very realistic. I also took out the projectile particle trails. I was a little diappointed though, because without the particle trails, the projectile quickly disappears from sight after you shoot it. I was wondering if there was a way to keep the projectile visible without putting the particles back.
I've created my first map. It's a simple Island with a volcano (although the lava looks more like blood than lava).
My map has two holes... I don't how they got there or how to get rid of them.

Kork jumps into the lava and dies. >=)

Besides messing with Torque, I've been planning my first game project. The game design is still in the works, but coming soon... The name of the game will be ICBM: Island Cannon Blaster Mania!
I've also come up with a name for my "game company:"
(NYFTI = Nifty spelled "creatively.")
In the world of programming, there is a big difference between "modding" existing code and writing your own. Getting to the threshold of being able to write your own code requires a deeper understanding of the code. Well, recently I reached the very beginnings of that threshold (sort of).
I changed this portion of script:
As I stated at the beginning of this blog, these accomplishments are only baby steps, but I'm hoping my "stride" will grow longer as I gain momentum... =P
All comments and crits are welcome.
The first day I got Torque, I mostly just explored around, trying to identify the important files, scripts, and objects. Although most of what I did was just messing around, I still wanted to be able to feel like I had done something meaningful. So I jumped into the scripts and started altering things.
After some initial exploring inside the scripts, the first thing I did was to move the max camera distance (in 3rd person view) further away from Kork. After more exploring, I messed around with the projectile explosion particle settings and made the explosions much more impressive. I made them bigger, fuller, and changed the colors around a little bit. Later, I changed the projectile's ballistics setting to "true," so that it would fly more like a real arrow. The velocity setting was a bit too powerful, so I turned it down. I also messed with the gravity settings, but the arrow flight still didn't "feel" right. I messed with it for a while, but I never did get the "feel" I was looking for.
Over the next few days I created my first successful .dts model (a bow), and switched out Kork's default crossbow, putting my new bow model in its place (I also switched out the projectile).
The arrow sits off to one side of the bow, but that is temporary.Aim...
FIRE!
I still haven't gotten the animations for my bow to work, but I'm not too worried about that at this point. I think it's just a matter of changing the animation names. I am wondering how to make separate .dsq animations... And also how to make .dif models.After messing around with the explosion particle settings, I decided to take them out all together. I didn't think that exploding arrows were very realistic. I also took out the projectile particle trails. I was a little diappointed though, because without the particle trails, the projectile quickly disappears from sight after you shoot it. I was wondering if there was a way to keep the projectile visible without putting the particles back.
I've created my first map. It's a simple Island with a volcano (although the lava looks more like blood than lava).
My map has two holes... I don't how they got there or how to get rid of them.

Kork jumps into the lava and dies. >=)
Besides messing with Torque, I've been planning my first game project. The game design is still in the works, but coming soon... The name of the game will be ICBM: Island Cannon Blaster Mania!
I've also come up with a name for my "game company:"
(NYFTI = Nifty spelled "creatively.")In the world of programming, there is a big difference between "modding" existing code and writing your own. Getting to the threshold of being able to write your own code requires a deeper understanding of the code. Well, recently I reached the very beginnings of that threshold (sort of).
I changed this portion of script:
//----------------------------------------------------------------------------
function Player::playDeathAnimation(%this)
{
if (%this.deathIdx++ > 11)
%this.deathIdx = 1;
%this.setActionThread("Death" @ %this.deathIdx);
}
//----------------------------------------------------------------------------To this://----------------------------------------------------------------------------
function Player::playDeathAnimation(%this)
{
if (%this.deathIdx++ > [b]0[/b])
%this.deathIdx = [b]getRandom(1,11)[/b];
%this.setActionThread("Death" @ %this.deathIdx);
}
//----------------------------------------------------------------------------Although I was still working with existing code, I added something that wasn't there before. =) This change makes it so that the game chooses a random death animation every time Kork dies.As I stated at the beginning of this blog, these accomplishments are only baby steps, but I'm hoping my "stride" will grow longer as I gain momentum... =P
All comments and crits are welcome.
#2
I would recommend that rather than completely removing the explosion effect for it, that you replace it with a puff of dirt/dust impact. This provides feedback for the player about where his arrow impact was at, and allows them to adjust for the next shot.
01/20/2007 (9:19 am)
Sweet! I have been itching to see a long bow in there, and with more realistic flight characteristics. I would recommend that rather than completely removing the explosion effect for it, that you replace it with a puff of dirt/dust impact. This provides feedback for the player about where his arrow impact was at, and allows them to adjust for the next shot.
#3
01/20/2007 (9:41 am)
Welcome to the community.
#4
In english your code says:
- Add one to deathIdx
- If deathIdx is greater than zero
- then set it to a random number from 1 to 11
- set the action thread to the current deathIdx
If you look a little closer you can see you're doing a bit of extra work. Your goal seem to be playing a random death animation each time. Because of the random generator, deathIdx has a range of values from 1 to 11, so it can never be zero. It is always greater than zero so that test can be eliminated. Now we have:
And again if we look closely we can see there is no reason to be incremented deathIdx since we are just going to pick a new value every time anyway. We can simplify further to:
Hopefully you can agree this final code is much easier to read and understand.
Good luck on your journeys through Torque!
01/20/2007 (9:54 am)
Glad you are diggin on Torque. Consider the following analysis of the code you modified:function Player::playDeathAnimation(%this)
{
if (%this.deathIdx++ > 0)
%this.deathIdx = getRandom(1,11);
%this.setActionThread("Death" @ %this.deathIdx);
}In english your code says:
- Add one to deathIdx
- If deathIdx is greater than zero
- then set it to a random number from 1 to 11
- set the action thread to the current deathIdx
If you look a little closer you can see you're doing a bit of extra work. Your goal seem to be playing a random death animation each time. Because of the random generator, deathIdx has a range of values from 1 to 11, so it can never be zero. It is always greater than zero so that test can be eliminated. Now we have:
function Player::playDeathAnimation(%this)
{
%this.deathIdx++;
%this.deathIdx = getRandom(1,11);
%this.setActionThread("Death" @ %this.deathIdx);
}And again if we look closely we can see there is no reason to be incremented deathIdx since we are just going to pick a new value every time anyway. We can simplify further to:
function Player::playDeathAnimation(%this)
{
%this.deathIdx = getRandom(1,11);
%this.setActionThread("Death" @ %this.deathIdx);
}Hopefully you can agree this final code is much easier to read and understand.
Good luck on your journeys through Torque!
#5
@ Ben R Vesco: I figured my code wasn't as good as it could be, thanks for the help. :) It makes sense.
01/20/2007 (10:12 am)
@ Todd Pickens: Excellent thought. I'll add the little puffs.@ Ben R Vesco: I figured my code wasn't as good as it could be, thanks for the help. :) It makes sense.
#6
function Player::playDeathAnimation(%this)
{
%this.setActionThread("Death" @ getRandom(1,11););
}
01/21/2007 (9:11 pm)
You could also do this... :)function Player::playDeathAnimation(%this)
{
%this.setActionThread("Death" @ getRandom(1,11););
}
#7
I've been digging around in the 1.5 sdk for a couple of days looking for it and i think i must just be overlooking it.
Any hope you could let me know what script file that was in? Its driving me crazy not being able to find it.
01/22/2007 (1:53 pm)
Hey Ethan? Could you give me a bit of info on where you found the max camera distance stuff?I've been digging around in the 1.5 sdk for a couple of days looking for it and i think i must just be overlooking it.
Any hope you could let me know what script file that was in? Its driving me crazy not being able to find it.
#8
Go to "--starter.fps/server/scripts/player.cs"
Scroll down to about the middle of the player.cs script and look for this datablock:
You're welcome. Happy scripting. :)
02/12/2007 (12:33 pm)
Hi Nick, sorry about the slow response. If you still need the information, and if you ever check back here... Here is the answer to your question. :)Go to "--starter.fps/server/scripts/player.cs"
Scroll down to about the middle of the player.cs script and look for this datablock:
datablock PlayerData(PlayerBody)
{
renderFirstPerson = false;
emap = true;
className = Armor;
shapeFile = "~/data/shapes/player/player.dts";
[b]cameraMaxDist = 3; <---- This is what you want to change.[/b]
computeCRC = true;You're welcome. Happy scripting. :)
#9
03/29/2007 (2:31 pm)
iam having the same problem with the projectiles disappearing right after being fired, has anyone figured that out?
#10
I'm pretty new to this, but maybe those two polygons got set to empty somehow. If that's the problem; switching to "Clear Blank" and clicking on the ploy will put the texture back. However, I've never really played with water ... so this may not help at all.
08/02/2007 (8:02 am)
If you haven't figured out the "holes" in your map, take a look under the "actions" menu when in the TerrainEditor. There are "Set Empty" and "Clear Empty" actions that remove a section of mesh and set it to "empty". This allows you to slip a .DIF underground.I'm pretty new to this, but maybe those two polygons got set to empty somehow. If that's the problem; switching to "Clear Blank" and clicking on the ploy will put the texture back. However, I've never really played with water ... so this may not help at all.

Torque Owner Mads Laumann
Im pretty new to this engine too, so we are in the same boat.
Good to see you are making progress :)