Game Development Community

Vehicle Physics - BEGGING for help!

by John Vanderbeck · in Torque Game Engine · 03/04/2004 (1:38 pm) · 24 replies

I've spent the last 8 hours trying to get a physics datablock to work properly, or even close to properly, for our first vehicle. I'm not even close.

I've scoured the forums, tried every datablock I could find. No go.

I've just about lost any sanity I had remaning. All i've got is a bunch of numbers, that I have NO idea do what. Its times like this when lack of documentation becomes painfully clear. I'm simply randomly changing numbers in the hopes of falling into something that works.

Our hover vehicle either ends up below the world, lightyears above it, or (once) sitting with its head in the sand. I can't even get this thing to just float about the ground, steady.

I'm begging for any help anyone can give. Our title is ALL about the vehicles, but we can't even get ONE vehicle to work.
Page «Previous 1 2
#1
03/04/2004 (4:29 pm)
If you really want help building a working datablock
post the model you are using
this will enable one to design the datablock definition around your model

that and you'll need to make sure this model has been built appropriately.
for example:
if you could locate a Working set of dts and datablock definition for a hover vehicle.

verifying the model and the datablock, you can get some resolve on Why your's is not working by using this datablock definition on your model.
#2
03/04/2004 (4:37 pm)
We're using a dummy model right now.. Its the Bravetree Jetbike main body model. Unfortunately we can't use the accompanying scripts because Bravetree made it a fudged WheeledVehicle instead of a true hover.

But aside from that, I don't see any reason why the model would not work. How much of a factor in the physics does the model itself have?

As for a "working" datablock, I can't find one. I've tried every hover vehicle datablock I could find to no avail. :(

Here is my datablock that i've been messing with. Its a hodepodge, so I apologize in advance.
#3
03/04/2004 (4:37 pm)
datablock HoverVehicleData(HoverBike)
{
spawnOffset = "0 0 1";

floatingGravMag = 500.5;

catagory = "Vehicles";
shapeFile = "~/data/shapes/jetbike/rjetbike01.dts";
computeCRC = true;

renderWhenDestroyed = false;

drag = 0.0;
density = 0.3;

   // 3rd person camera settings
   cameraRoll = true;         // Roll the camera with the vehicle
   cameraMaxDist = 4.8;
   cameraOffset = 0.3;        // Vertical offset from camera mount point
   cameraLag = 0.1;           // Velocity lag of camera
   cameraDecay = 0.75;        // Decay per sec. rate of velocity lag

mountPose[0] = scoutRoot;
//cameraMaxDist = 15.0;
//cameraOffset = 5.7;
//cameraLag = 5.5;
numMountPoints = 3;
isProtectedMountPoint[0] = true;
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 = 25;
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";
};
#4
03/04/2004 (5:44 pm)
The model's geometery defines most of how the vehicles behave.
#5
03/04/2004 (6:21 pm)
Have you tried reviewing this resource as a reference point

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5071

Maybe it might provide some help?
#6
03/04/2004 (7:17 pm)
Off hand I would say that your floatingGravMag is way too high. Try knocking it down to 5.
#7
03/04/2004 (10:24 pm)
This datablock used to work for me some time ago (havent tried lately):
datablock HoverVehicleData(HoverVehicleTest)
{
   spawnOffset = "0 0 1";

   category = "Vehicles";
   shapeFile = "~/data/shapes/vehicles/airscout/air_scout.dts";
   multipassenger = false;
   computeCRC = true;

   debrisShapeName = "~/data/shapes/vehicles/airscout/air_scout_debris.dts";
   debris = HoverShapeDebris;
   renderWhenDestroyed = false;

   floatingGravMag = 50.5; 
   
   drag = 0.0; 
   density = 0.3; 
   
   mountPose[0] = sitting; 
   numMountPoints = 1; 
   
   cameraMaxDist = 15.0; 
   cameraOffset = 5.7; 
   cameraLag = 5.5; 
   cameraDecay = 0.75;        // Decay per sec. rate of velocity lag
   cameraRoll = true;         // Roll the camera with the vehicle
   
   isProtectedMountPoint[0] = true; 
   explosion = ScoutFlyerExplosion; 
   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 = HoverJetSound; 
   engineSound = HoverEngineSound; 
   floatSound = HoverFloatSound; 
   //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] = ScoutFlyerEmitter; 
   damageEmitter[1] = ScoutFlyerEmitter; 
   damageEmitter[2] = ScoutFlyerEmitter; 
   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; 
   
   checkRadius = 1.7785; 
   observeParameters = "1 10 10"; 
   
   shieldEffectScale = "0.9375 1.125 0.6"; 
};
#8
03/05/2004 (5:29 am)
@Dee
Not in whole since its a flying vehicle, but i've tried using some of the values from it. Still doesn't provide anything stable.

@Martin
A value of around 5 either ususally coauses it to "tip" up in its nose and be stick headfirst ion the ground. Though thats one of the values that doesn't go flying off into never never land so maybe its closer.

@Stefan
Thanks, i'll give that one a try right now. I think it looks a lot like the other one I had used as a base, but i'm desperate enough to try anything at this point.
#9
03/05/2004 (5:34 am)
Still no go. I'm guessing, by the fact that all I see is fog and sky, and no gound anywhere, that i'm BELOW the world. Unfortunately I can't confirm that because if I swap cameras to a freelook, and move around I can't find the hover bike anywhere. Above or below the world. Switching to a 3rd person cam, for some odd reason, won't even show it. Which is another reason I think I might be below the world.

Maybe this model is NOT going to work as a hover. Unfortunately, as i'm not a modeller, I really don't know what i'd have to do to make it work.
#10
03/05/2004 (5:57 am)
Grr a whole day of fighting with this, come to find out it wasn't directly a physiscs problem.

I just got it working, close enough to be able to tweak it now.

The whole problem was with integration. It was using default integration because I hadn't specified anything different, and that was allowing it to fall through the world on spawn in.
#11
03/05/2004 (9:17 am)
Anyway. Thanks to everyone for thier help and patience with me :)

I'm going to get things tweaked the way I like, then i'll post the final datablock here for archive purposes.
#12
03/11/2004 (5:55 am)
John, have you figured this out yet ?
#13
03/11/2004 (5:58 am)
Got it working decent, but haven't gotten around to tweaking the values to the way we want. I'd be happy to post the datablock that we have right now though. It isn't perfect but its close enough to be a good starting point.
#14
03/11/2004 (7:10 am)
datablock HoverVehicleData(HoverBike)
{
   spawnOffset = "0 0 1";

   category = "Vehicles";
   shapeFile = "~/data/shapes/jetbike/rjetbike01.dts";
   multipassenger = false;
   computeCRC = true;

   debrisShapeName = "~/data/shapes/jetbike/rjetbike01.dts";
   debris = HoverShapeDebris;
   renderWhenDestroyed = false;

   floatingGravMag = 5.0; 
   drag = 0.0; 
   density = 0.3; 
   // Rigid Body 
   mass = 5; 
   bodyFriction = 0; 
   bodyRestitution = 1.0; 
   minRollSpeed					= 2000;     // Don't mess with this.
   integration = 6;           // Physics integration: TickSec/Rate
   collisionTol = 0.2;        // Collision distance tolerance
   contactTol = 0.1;
   dragForce = 1.9; 
   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 
   normalForce = 10; 
   restorativeForce = 100; 
   steeringForce = 90; 
   rollForce = 7; 
   pitchForce = 10; 
   
   mountPose[0] = sitting; 
   numMountPoints = 1; 
   
   cameraMaxDist = 0.5; 
   cameraOffset = 0.5; 
   cameraLag = 0.5; 
   cameraDecay = 0.05;        // Decay per sec. rate of velocity lag
   cameraRoll = false;         // Roll the camera with the vehicle
   
   isProtectedMountPoint[0] = true; 
   explosion = ScoutFlyerExplosion; 
   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; 
   
   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; 
   
   dustEmitter = VehicleLiftoffDustEmitter; 
   triggerDustHeight = 2.5; 
   dustHeight = 1.0; 
   dustTrailEmitter = TireEmitter; 
   dustTrailOffset = "0.0 -1.0 0.5"; 
   triggerTrailHeight = 3.6; 
   dustTrailFreqMod = 15.0; 
   
   jetSound = HoverJetSound; 
   engineSound = HoverEngineSound; 
   floatSound = HoverFloatSound; 
   //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] = ScoutFlyerEmitter; 
   damageEmitter[1] = ScoutFlyerEmitter; 
   damageEmitter[2] = ScoutFlyerEmitter; 
   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; 
   
   checkRadius = 1.7785; 
   observeParameters = "1 10 10"; 
   
   shieldEffectScale = "0.9375 1.125 0.6"; 
};
#15
03/11/2004 (10:16 pm)
Cool, i'll give this a shot as soon as i get home.
Thanx man!
#16
03/15/2004 (9:03 pm)
Hello,
I have been trying to get the hover to work as well. I tried the above data block and it still seems to be doing what it did before. Badguy said the model's geometry can have as much affect as the physics settings? I have been using a square block that is flattened vertically to make it more like a platform. It has a collision box to allow me to use it as a vehicle.

One problem that I do not understand at all is when I go off a steep ledge. For instance, a block in the tutorial.base mission. The hover shoots down so fast that it shoots right through the terrain. This is not what I would expect any vehicle to do. It should fall with gravity and bounce a bit. If fact, why would the physics engine even allow a vehicle to go through the terrain? It should hit really hard if anything.

My model is really simple. I find it hard to believe it could be just the model for all the problems I am having.

If anyone is interested I can mail you my model.

Thanks,
Frank
#17
03/15/2004 (9:21 pm)
The model will have a direct effect on the physics that the engine uses. As real world physics seem to apply alot here. Like you can not roll a rectangle like you can a ball. A rectangle will have a bouncy effect to it when a ball will be more of a smooth roll.

As with all of my new ship models I use a triangle style bottom as opposed to the rectangle I started with. (The rectangle was good for keeping it floating but it also removed all sort of left and right bouncy to the ships.) With the triangle style bottom the ships can now lean left and right where you can not do with a rectangle.
#18
03/15/2004 (9:38 pm)
Ahh, I was editing the wrong cs file! Dang it! I can drive around with no dirt naps! The thing stays above the terrain even when I really crash it. I will look into the shape to see how it changes how it flies.

Thanks for the info,
Frank
#19
03/16/2004 (8:40 pm)
I built a Halo style craft. The collision mesh is a cube, but with a narrow back end to simulate a triangle shape. This thing runs pretty good now. I assume the collision mesh is where the shape matters. Does the center of collision mesh determine the center of mass?
#20
03/17/2004 (5:44 am)
I'm not a modeler, but i'm pretty sure the center of mass is at the origin.
Page «Previous 1 2