Game Development Community

Flying Vehicle Troubles

by Dan Keller · in Torque Game Engine · 12/20/2005 (5:04 pm) · 5 replies

I made a flying vehicle model that is acting very strangely. When it tilts forward past a certain angle, it will roll back and forth. The farther forward it tilts, the more pronounced this becomes, and eventually it becomes extremely unstable and flips around. When it hits the ground, it ends up upside down and rotating wildly.

Also, the engine crashes whenever it hits an interior.

#1
12/20/2005 (7:25 pm)
Did you add a node for mass?
#2
12/20/2005 (8:10 pm)
What does your script look like? (only interested in the datablock)
That makes a huge impact on flight characteristics.

Here's one setup that i found to be a good starting point to build off:

maxEnergy              = 280; // Afterburner and any energy weapon pool
rechargeRate           = 0.8;

minDrag                = 100; // 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)

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          = 700; // Steering jets (force applied when you move the mouse)
steeringRollForce      = 8;   // Steering jets (how much you heel over when you turn)
rollForce              = 5;   // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight            = 0;   // Height off the ground at rest
createHoverHeight      = 3;   // Height off the ground when created
//maxForwardSpeed      = 100; // speed in which forward thrust force is no longer applied (meters/second)

// Turbo Jet
jetForce               = 4000;// Afterburner thrust (this is in addition to normal thrust)
minJetEnergy           = 55;  // Afterburner can't be used if below this threshhold.
jetEnergyDrain         = 3.6; // 2.9min Works Energy use of the afterburners (low number is less drain...can be fractional)                                                                                                                                                                                                                                                                                          // Auto stabilize speed
vertThrustMultiple     = 3.0;

// 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.
softImpactSpeed        = 14;  // Sound hooks. This is the soft hit.
hardImpactSpeed        = 25;  // Sound hooks. This is the hard hit.
#3
12/20/2005 (8:23 pm)
@Tom I have a node for mass.

I added the flying vehicle hover fix, and now it only happens when I hit the ground.

@Tim I copied the datablock from http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5071 and just changed the path to the shape.

Edit:
I chaged the datablock to the one you suggested and now it works much better.
#4
12/21/2005 (8:14 am)
By the way, how can I make is as an object that the playe can mount, control, etc... When I spawn it at the beginning of the game it works fine, but if I try to insert it with the mission editor it dosen't appear.
#5
12/24/2005 (3:49 pm)
Ok... I forget what I did, but it works now.