Game Development Community

dev|Pro Game Development Curriculum

HEAD compatible flyer and hover datablocks

by Edward Gardner · 04/05/2002 (11:23 am) · 11 comments

Hover first:
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************

datablock HoverVehicleData(AssaultTank)
{
spawnOffset = "0 0 1";

floatingGravMag = 50.5;

catagory = "Vehicles";
shapeFile = "~/data/shapes/player/gravtank.dts";
computeCRC = true;

debrisShapeName = "~/data/shapes/player/GRAVTANK.dts";
debris = ShapeDebris;
renderWhenDestroyed = false;

drag = 0.0;
density = 0.3;

mountPose[0] = sitting;
numMountPoints = 1;
cameraMaxDist = 15.0;
cameraOffset = 5.7;
cameraLag = 5.5;
isProtectedMountPoint[0] = true;
explosion = AssaultTankExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;

lightOnly = 1;

maxDamage = 120;
destroyedLevel = 120;

isShielded = true;
rechargeRate = 0.7;
energyPerDamagePoint = 75;
maxEnergy = 150;
minJetEnergy = 15;
jetEnergyDrain = 1.3;

// Rigid Body
mass = 5;
bodyFriction = 0;
bodyRestitution = 0.5;
softImpactSpeed = 20; // Play SoftImpact Sound
hardImpactSpeed = 28; // Play HardImpact Sound

// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 29;
speedDamageScale = 0.010;

// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23;
collDamageMultiplier = 0.030;

dragForce = 1.9;
// dragForce = 25 / 45.0;
vertFactor = 0.5;
floatingThrustFactor = 0.35;

mainThrustForce = 100;
reverseThrustForce = 70;
strafeThrustForce = 70;
turboFactor = 1.5;

brakingForce = 30;
brakingActivationSpeed = 30;

stabLenMin = 6.50;
stabLenMax = 7.25;
stabSpringConstant = 20;
stabDampingConstant = 20;

gyroDrag = 36; // 16
// gyroForce = 50
normalForce = 10;
restorativeForce = 100;
steeringForce = 90;
rollForce = 7;
pitchForce = 10;

dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 2.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 3.6;
dustTrailFreqMod = 15.0;

jetSound = ScoutSqueelSound;
engineSound = ScoutEngineSound;
floatSound = ScoutThrustSound;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
wheelImpactSound = WheelImpactSound;

//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;

exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterSoftSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeSoftSplashSound;

minMountDist = 4;

damageEmitter[0] = AssaultTankEmitter;
damageEmitter[1] = AssaultTankEmitter;
damageEmitter[2] = AssaultTankEmitter;
damageEmitterOffset[0] = "0.0 -1.5 0.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 2;

splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;

max[chaingunAmmo] = 1000;

forwardJetEmitter = ContrailEmitter;//WildcatJetEmitter;

//cmdCategory = Tactical;
//cmdIcon = CMDHoverScoutIcon;
//cmdMiniIconName = "commander/MiniIcons/com_landscout_grey";
//targetNameTag = 'WildCat';
//targetTypeTag = 'Grav Cycle';
//sensorData = VehiclePulseSensor;

checkRadius = 1.7785;
observeParameters = "1 10 10";

//runningLight[0] = WildcatLight1;
//runningLight[1] = WildcatLight2;
//runningLight[2] = WildcatLight3;

shieldEffectScale = "0.9375 1.125 0.6";
};


The hover isn't QUITE right, but it works, play with the physics variables. If you manage to get it like the T2 scout, lemme know what you did :)
___________________________________
___________________________________
___________________________________

Now a Flyer:
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************

datablock FlyingVehicleData(InterceptFlyer)
{
spawnOffset = "0 0 2";

catagory = "Vehicles";
shapeFile = "~/data/shapes/player/ulysses.dts";
multipassenger = false;
computeCRC = true;

debrisShapeName = "~/data/shapes/player/ulysses.dts";
debris = ShapeDebris;
renderWhenDestroyed = false;

drag = 0.15;
density = 1.0;

mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
cameraMaxDist = 15;
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = ScoutFlyerExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;

maxDamage = 90.00;
destroyedLevel = 90.00;

isShielded = true;
energyPerDamagePoint = 160;
maxEnergy = 280; // Afterburner and any energy weapon pool
minDrag = 80; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 10; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
rechargeRate = 0.0;

maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 15; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 15; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 0.95; // Dampen control input so you don't' whack out at very slow speeds
// Maneuvering
maxSteeringAngle = 5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 10; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 100; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 3000; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 500; // Steering jets (force applied when you move the mouse)
steeringRollForce = 8; // Steering jets (how much you heel over when you turn)
rollForce = 100; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 5; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created

//maxSteeringAngle = 5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
//horizontalSurfaceForce = 6; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
//verticalSurfaceForce = 4; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
//maneuveringForce = 2500; // Horizontal jets (W,S,D,A key thrust)
//steeringForce = 1200; // Steering jets (force applied when you move the mouse)
//steeringRollForce = 400; // Steering jets (how much you heel over when you turn)
//rollForce = 4; // Auto-roll (self-correction to right you after you roll/invert)
//hoverHeight = 5; // Height off the ground at rest
//createHoverHeight = 3; // Height off the ground when created



// Rigid body
mass = 100; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
minImpactSpeed = 1; // If hit ground at speed above this then it's an impact. Meters/second
softImpactSpeed = 10; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
speedDamageScale = 0.04;

collDamageThresholdVel = 20.0;
collDamageMultiplier = 0.02;

//
minTrailSpeed = 15; // The speed your contrail shows up at.
trailEmitter = ScoutFlyerContrailEmitter;
forwardJetEmitter = ScoutFlyerEmitter;
downJetEmitter = ScoutFlyerEmitter;

//
jetSound = ScoutFlyerThrustSound;
engineSound = ScoutFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;

//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 30.0;
hardSplashSoundVelocity = 60.0;
exitSplashSoundVelocity = 20.0;

exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;

dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 1.0;

damageEmitter[0] = ScoutFlyerEmitter;
damageEmitter[1] = ScoutFlyerEmitter;
damageEmitter[2] = ScoutFlyerEmitter;
damageEmitterOffset[0] = "0.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 3;

//
max[chaingunAmmo] = 1000;

minMountDist = 4;

splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;

shieldImpact = VehicleShieldImpact;

checkRadius = 5.5;
observeParameters = "1 10 10";


};

This flyer does barrel rolls. Changine the roll force will give you a sliding effect :)

Good luck!

#1
04/05/2002 (5:56 pm)
Nice.
#2
04/05/2002 (6:48 pm)
So, where do you put all of this? Is it a new .cs file or what? (I'm not a coder, be nice :P)
#3
04/06/2002 (6:53 am)
No, you replace the comparable sections of a tribes 2 vehicle script.

The vehicle tutorials available here will work, they just need these datablocks ;)
#4
04/06/2002 (8:25 pm)
Are you sure it will 'barrel' roll? and not just perform a modified Immelman? Remember that people used to think that the scout in T2 could barrel roll.... havent seen it done yet. not with the mouse and kbd combo at least.

-Shooter
#5
04/07/2002 (9:04 am)
Ok, not actually being a pilot, I dunno what it's actually called ;)

Try it, you tell me ;)
#6
04/07/2002 (10:01 am)
Edward, (can I call you Ed? thanks.)
Ed,
I wouldn't put the whole movement thing out the window personally, remember that Dynamix Dev team was also one of the forefathers of the best flight sims as well. They also one of the first to research "Real World" physics for "In Game" usage.

I would not be suprised if you actually did code a scout to barrel roll. (Someone will one day - Maybe you already have) Stranger things have happened.

-Shooter
#7
04/08/2002 (10:45 am)
I actually don't know what to call it, I'll do a video and show it off ;)
#8
04/16/2002 (11:16 am)
"modified Immelman"

I think you've been watching too many of the fringe sports on ESPN93 like motocross or extreme 3-man wheelbarrow racing.

Heh, if there's a difference I certainly can't tell (nor do I care!)
#9
04/16/2002 (11:04 pm)
Matt,
I don't doubt that the engine is capable of it - nor Eds script to pull it off (Ed, Can I cal you Ed?).

But yes, alot of people confuse it with a "Split 'S'".

I'm just looking around for the Maya to Torque Exporter.

-Shooter
#10
11/28/2002 (3:03 pm)
I have been having problems with flying vehicles for ages, and would like to know how you guys did it.
#11
06/25/2003 (5:18 pm)
catagory should be category