Game Development Community

Suggestions for a good baseline Flying Vehicle Datablock?

by Dusty Monk · in Torque Game Engine · 06/05/2009 (2:27 pm) · 5 replies

So i was going to go buy the War Sparrow pack, which has been around forever, and it appears both the pack and Bravetree have gone the way of the dodo. Sadness.

My first question is does anyone know if that content is still available for purchase anywhere?

And failing that, suggestions for a solid base datablock for a flying vehicle? Just something to.. well pardon the pun.. get my feet off the ground.. :)

I did attempt to search the site, but there's been so much re-organization and moving around of resources that while I found a few hover datablocks, I couldn't find anything recent for a good flying vehicle.

Thanks in advance,

Dusty

About the author

Dusty Monk is founder and president of Windstorm Studios, an independant game studio. Formerly a sr. programmer at Ensemble Studios, Dusty has worked on AAA titles such as Age of Empires II & III, and Halo Wars.


#1
06/05/2009 (11:49 pm)
I wouldn't know about the availability of the Bravetree packs, but here's a datablock that works decently for me. I'll leave the emitters and damage fx for you fill in with your own, so be aware that this only a suggestion/reference.
datablock FlyingVehicleData(DefaultFlyer)
{
    category = "Vehicles"; // category for the editor
    className = Flyer; // script class namespace
    computeCRC = true;
    
    // Rendering
    shapeFile = "~/data/shapes/ships/flyer.dts";
    emap = false; // environment mapping on or off
    
    // camera
    cameraRoll = true; // Roll the camera with the vehicle
    cameraMaxDist = 6; // Far distance from vehicle
    cameraOffset = 1.5; // Vertical offset from camera mount point
    cameraLag = 0.1; // Velocity lag of camera
    cameraDecay = 0.75; // Decay per sec. rate of velocity lag
    
    // Physics
    drag = 0.2;
    density = 1.0;
    minDrag = 90; // Linear Drag (eventually slows you down when not thrusting...constant drag)
    rotationalDrag = 10; // Angular Drag (dampens the drift after you stop moving the mouse)
    maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed.
    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
    maxSteeringAngle = 5; // Max radians 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 = 3900; // Horizontal jets (W,S,D,A key thrust)
    steeringForce = 700; // Steering jets (force applied when you move the mouse)
    steeringRollForce = 8; // Steering jets (how much you heel over when you turn) 8
    rollForce = 70; // Auto-roll (self-correction to right you after you roll/invert)
    hoverHeight = 8; // Height off the ground at rest
    createHoverHeight = 8; // Height off the ground when created
    jetForce = 3700; // Afterburner thrust (this is in addition to normal thrust)
    minJetEnergy = 55; // Afterburner can't be used if below this threshhold.
    jetEnergyDrain = 0.7; // Energy use of the afterburners (lower number is less drain)  
    vertThrustMultiple = 10.0;
    integration = 3; // Physics integration: TickSec/Rate
    collisionTol = 0.1; // Collision distance tolerance
    contactTol = 0.1; // Contact velocity tolerance
    mass = 100; // Mass of the vehicle
    bodyFriction = 0; // Don't change this.
    bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
    minRollSpeed = 0; // Don't change this. 
    
    // Sounds
    jetSound = FlyerThrustEffect;
    engineSound = FlyerEngineSound; 
    
    // Sound Velocities
    softSplashSoundVelocity = 10.0;
    mediumSplashSoundVelocity = 15.0;
    hardSplashSoundVelocity = 20.0;
    exitSplashSoundVelocity = 10.0;
    
    // Impact Damage
    collDamageThresholdVel = 10.0;
    collDamageMultiplier = 0.05; 
    minImpactSpeed = 0.5; // If you hit the ground at a speed above this then it's an impact
    speedDamageScale = 0.5;
    
    // Damage/Energy
    maxDamage = 150; // total damage until explosion
    maxEnergy = 180; // Afterburner and any energy weapon pool
    energyPerDamagePoint = 160;
    destroyedLevel = 1.40;
    rechargeRate = 0.4; // Afterburner/energy recharge rate
    softImpactSpeed = 2; 
    hardImpactSpeed = 6;
    
    // Explosion and debris setup
    explosion = FlyerExplosion;
    underwaterExplosion = FlyerExplosion;
    explosionDamage = 40; // How much damage is applied through radiusDamage
    explosionRadius = 20; // the radius for the radiusDamage function call
    debris = FlyerDebris; // the debris datablock
    debrisShapeName = "~/data/shapes/ships/flyer_debris.dts"; // debris shape (contains the explosion parts)
    renderWhenDestroyed = false; // don't render normal shape when destroyed, only the debris shape
    
    // Emitter stuff
    minTrailSpeed = 15; // The speed your contrail shows up at
    trailEmitter = FlyerContrailEmitter; // contrail emitter datablock
    forwardJetEmitter = FlyerJetEmitter; 
    backwardJetEmitter = FlyerJetEmitter; 
    downJetEmitter = FlyerJetEmitterDown;
    splashEmitter = VehicleFoamEmitter;  // water splash stuff
    //dustEmitter = DustEmitter; // dust emitter when hovering over the ground
    triggerDustHeight = 8;
    dustHeight = 8;


EDIT: ACK! Surpassed the word limit!
#2
06/05/2009 (11:50 pm)
..continued:
// Damage emitters
    damageEmitter[0] = LightDamageSmoke;
    damageEmitter[1] = HeavyDamageSmoke;
    damageEmitter[2] = DestroyedDamageSmoke;
    damageEmitterOffset[0] = "0 0 0";
    damageLevelTolerance[0] = 0.3;
    damageLevelTolerance[1] = 0.7;
    numDmgEmitterAreas = 1; 
};
#3
06/06/2009 (5:58 am)
Awesome! Thanks tons that's exactly what I was looking for!

Dusty
#4
06/06/2009 (11:17 am)
The disk that goes with my first book (GPGT) is available for download, here.

On this disk you can find a (very basic) flying vehicle and the datablock.

Certainly, it is a large download for one datablock, but you might find other things on the disk that are useful too.

I made this updated disk available for book owners, but I am happy to see any TGE owners getting value from it.
#5
06/07/2009 (3:36 pm)
Hey Ed! Actually I own both of your books, and they've been invaluable resources for getting familiar with both TGE and TGEA. I have to say I was a little sad when I got to the paragraph, after such indepth coverage of the wheeled and hover vehicles, that said "we won't be convering the flying vehicle.." :)

Thanks for the link -- definitely useful, as I'd lost the CD that came with the first book years ago.

Dusty

PS - you *are* contracted to do a new book for T3D.. right? right? :)