Jetpack + Skiing Resource?
by Steve Brown · in Torque 3D Professional · 09/08/2009 (12:18 pm) · 8 replies
Hello,
I was curious as to if there has been a Jetpack resource (or any information) like this one from 2006:
http://www.garagegames.com/community/resource/view/11314/
Along with this, if there is a resource about Skiing (ala Tribes/Tribes 2) I would be very interested in reading about it. I am a huge Tribes fan and would love to see a Tribes-style movement system that I can use in the World Editor. Any information would be great. Thank you!
I was curious as to if there has been a Jetpack resource (or any information) like this one from 2006:
http://www.garagegames.com/community/resource/view/11314/
Along with this, if there is a resource about Skiing (ala Tribes/Tribes 2) I would be very interested in reading about it. I am a huge Tribes fan and would love to see a Tribes-style movement system that I can use in the World Editor. Any information would be great. Thank you!
#2
09/08/2009 (12:45 pm)
Great, thanks! Any idea about skiing? I feel like that would probably be the hardest part.
#3
09/08/2009 (12:53 pm)
I'd like to know how to get skiing working myself! I've seen various people mention code changes in order to set material friction values for different surfaces -- it seems like that would be a good place to start with that, I have just never done so.
#4
In other words, it still works. The only thing missing is the that Tribes jetpacks didn't just apply upward (jump) force only and then rely on air control to move the player, they also allowed the player to hold WASD and apply horizontal force, giving you the forward velocity for skiing. In fact, I think there was no air control in Tribes outside this part of the jetpack; at 0 energy, you were stuck falling wherever you were already headed.
I'm including my change here, since it's a much simpler way to get going than to look at some full resource.
Head to player.cpp, find this line:
Head down into the body of that if, find:
Replace the 8 lines between that line and the last line of the if block (mEnergy -=...) with:
And that should get you started. As far as different friction values for various materials, that wasn't in the Tribes skiing thing, but could definitely be done with T3D's extensive materials system.
I never was able to solve my 1 big question: In Tribes, did forward+jet apply only forward horizontal velocity, or did it move you forward and up at a 45 degree angle? I definitely remember having to use jet with no WASD to go up, so that's how I left it: Hold jet to fly up, hold jet +WASD to move in air. I use 0 airControl with this.
Someone who's played Tribes/T2 more recently than 8 years ago might be able to tell us how it really works. If you want to go both upward and forward at the same time, remove the "if (move->x == 0 && move->y == 0){" and just always apply upward force in addition to the X/Y force.
09/08/2009 (4:50 pm)
As I remember it, Tribes skiing wasn't an intentional feature, it was a side-effect of the jetpack velocities and the way the engine handles terrain collision and friction.In other words, it still works. The only thing missing is the that Tribes jetpacks didn't just apply upward (jump) force only and then rely on air control to move the player, they also allowed the player to hold WASD and apply horizontal force, giving you the forward velocity for skiing. In fact, I think there was no air control in Tribes outside this part of the jetpack; at 0 energy, you were stuck falling wherever you were already headed.
I'm including my change here, since it's a much simpler way to get going than to look at some full resource.
Head to player.cpp, find this line:
if (move->trigger[1] && !isMounted() && canJetJump())
Head down into the body of that if, find:
F32 impulse = mDataBlock->jetJumpForce / getMass();
Replace the 8 lines between that line and the last line of the if block (mEnergy -=...) with:
F32 impulse = mDataBlock->jetJumpForce / getMass();
// BEGIN NEW CODE
acc.x += moveVec.x * impulse;
acc.y += moveVec.y * impulse;
if (move->x == 0 && move->y == 0){
if (dot <= 0)
acc.z += mJumpSurfaceNormal.z * impulse * zSpeedScale;
else
{
acc.x += pv.x * impulse * dot;
acc.y += pv.y * impulse * dot;
acc.z += mJumpSurfaceNormal.z * impulse * zSpeedScale;
}
}
// END NEW CODE
mEnergy -= mDataBlock->jetJumpEnergyDrain;And that should get you started. As far as different friction values for various materials, that wasn't in the Tribes skiing thing, but could definitely be done with T3D's extensive materials system.
I never was able to solve my 1 big question: In Tribes, did forward+jet apply only forward horizontal velocity, or did it move you forward and up at a 45 degree angle? I definitely remember having to use jet with no WASD to go up, so that's how I left it: Hold jet to fly up, hold jet +WASD to move in air. I use 0 airControl with this.
Someone who's played Tribes/T2 more recently than 8 years ago might be able to tell us how it really works. If you want to go both upward and forward at the same time, remove the "if (move->x == 0 && move->y == 0){" and just always apply upward force in addition to the X/Y force.
#5
09/09/2009 (1:11 am)
@Henry...moving forward + jet apply did move you forward and up. It was more effective to jump (space bar) right before jetting though.
#6
@ Brian... jumping right before jetting... Just thinking about it gives me a sense of nostalgia.
EDIT: After giving it some thought, would Legions-like physics we easier to implement than Tribes physics?
09/09/2009 (2:18 pm)
So no word on a Skiing resource yet?@ Brian... jumping right before jetting... Just thinking about it gives me a sense of nostalgia.
EDIT: After giving it some thought, would Legions-like physics we easier to implement than Tribes physics?
#7
09/09/2009 (11:25 pm)
Is anyone willing to review my player.cpp, player.h, default.bind.cs, and player.cs files that I altered according to the resource Michael directed me to. The binding option is present in-game but I can not jet.
#8
10/01/2009 (3:15 am)
I found this to be an interesting read on the subject it was written by Andrew who has some experience disassembling Tribes, he's the one who created Hudbot (32 bit texture upgrade + other stuff) He wrote this article on Tribes' skiing Here He also offers pseudo-code with explanations. A good read, I will probably look deeper into its implementation into Torque later.
Associate Michael Hall
Distracted...
Truthfully, I never much liked the "air control" mechanics of that jetting style -- but I heartily approve of ripping it out and replacing it with this one.