Vehicles
by Josh Moore · in Torque Game Engine · 08/07/2004 (12:38 pm) · 15 replies
Last night, I gave the flying vehicle class on/off states. When on, it flys and hovers normaly and when off, its only affected by gravity. My problem is that whenever I turn it off, it slides around on the terrain(sometimes), and almost always clips into the terrain or goes through it. Usualy it gets stuck in the terrain and I can't take off anymore. I remember that in Tribes2, none of the vehicles would clip or fall through the terrain. I'm wondering if anyone has figured out what causes the clipping/skipping. Also, does anyone know a way to stabalize the vehicle after it is almost at rest on the ground? I'm thinking that I should use the gethight check to see if its close, and just apply somekind of slowdown method.
#2
08/08/2004 (4:19 pm)
I got it to stabalize when < 1.5 units above the ground while its inactive, but if it will slip thorugh if its going to fast. I still get it in regular active mode. I think I'll add some kind of "onCrash" script callback if the vehicle is going fast and is too close to the ground, but its a hacky solution.
#3
Rich
08/14/2004 (9:33 am)
Try increasing the integration - in vehicle.cc, toward the top of the file, it's set integration = 1, but in terrain collisions this was causing hangs. It might help to keep your vehicles from falling through....Rich
#4
08/14/2004 (10:04 am)
Some of Gonzo's recent research suggests that a value of 5 will reduce crashes significantly for speeds under a few hundred meters/sec.
#5
datablock FlyingVehicleData(yourflyingvehicle)
{
.
.
.
HoverHeight = 5.0; // unit height off the ground
.
.
};
08/14/2004 (10:09 am)
Try adjusting your hover parameter value in your flyingvehicle .cs file, i.e.datablock FlyingVehicleData(yourflyingvehicle)
{
.
.
.
HoverHeight = 5.0; // unit height off the ground
.
.
};
#6
08/14/2004 (10:10 am)
I'm running 250 meters per second maximum thrust speed and 2000 meters per second top speed. Meaning if you climb to full height and fly straight down you are going to top 250 very quickly(i'm not sure what the fastest I can get it going is but I guess I could write a script that would show me. Bottom line is, with an integration of 5 I never got my vehicle to go through the ground, and trust me, i hit the ground a lot trying to make it crash.
#7
08/14/2004 (11:03 am)
@Gonzo - thanks for the info. My integration was set to 2 and probably the reason it passed through the terrain. I didn't realize you can change the integration to a higher value. Is there an upper limit, and how does that affect the performance on the game if you have, say, 20 planes in the game.
#8
08/14/2004 (11:51 am)
Whoa that helps alot, thanks. With integration at 5, I don't get any slipping where it would of just gone through. Now I just need to perfect my inactive mode so you can taxi around like a hover vehicle(and blast ppl on the ground). Thanks again.
#9
www.garagegames.com/mg/forums/result.thread.php?qt=20662
EDIT: BTW, the question of the effect integration might have ona game with multiple vehicles is a good one. I can't imagine it would make much difference if you were running a controlled environment where vehicles were limted somewhat, but I would have to say it's definately something that needs to be tested if you intend for everyone to have a vehicle.
08/14/2004 (2:14 pm)
Awesome. I knew that time I spent was going to be well worth it. If you guys want to know more about how I arrived at that, this is the original thread....www.garagegames.com/mg/forums/result.thread.php?qt=20662
EDIT: BTW, the question of the effect integration might have ona game with multiple vehicles is a good one. I can't imagine it would make much difference if you were running a controlled environment where vehicles were limted somewhat, but I would have to say it's definately something that needs to be tested if you intend for everyone to have a vehicle.
#10
On a side note: Anyone have any idea of how to give the wheels on wheeled vehicles to have collisions? I want a sniper to beable to shoot a jeep's front tire, make it veer inward, and flip the jeep in the air.
08/14/2004 (2:29 pm)
Weare going to have flying, wheeled, and hover vehicles in our game. The flying and the wheeled vehicle are ok, but the hover vehicle needs work.On a side note: Anyone have any idea of how to give the wheels on wheeled vehicles to have collisions? I want a sniper to beable to shoot a jeep's front tire, make it veer inward, and flip the jeep in the air.
#11
I'm having the same question about the wheels. I made mines in my game, but the problem is cars can just drive over them becuase the wheels have no real collision. This is really bad, I might have to drop my mines from the game becuase of this.
08/16/2004 (5:26 am)
Quote:On a side note: Anyone have any idea of how to give the wheels on wheeled vehicles to have collisions? I want a sniper to beable to shoot a jeep's front tire, make it veer inward, and flip the jeep in the air.
I'm having the same question about the wheels. I made mines in my game, but the problem is cars can just drive over them becuase the wheels have no real collision. This is really bad, I might have to drop my mines from the game becuase of this.
#12
08/16/2004 (9:48 am)
I just tought I found a way around. I tought Los collision meshes were only used for projectiles/bullets, so I made 4 Los boxes where the wheels go. But obviously the Los isn't only for projectiles :( (my vehicle was screwed, it was no longer able to drive). So, still having a problem...
#13
With the LOS collisions, do projectiles hit the tries? Were you using cubes or cylinders for the LOS meshes?
08/16/2004 (2:41 pm)
I have the same problem with vehicle mines in Illumina. I was thinking about doing a small radius search every 250ms around the mine, but its not the best solution.With the LOS collisions, do projectiles hit the tries? Were you using cubes or cylinders for the LOS meshes?
#14
08/16/2004 (2:51 pm)
A scheduled radius check may not be the ideal way to do mines, but it works quite well. Tribes 2 went this route, running the check every 300 MS, from scripted functions no less, and even with hundreds of such checks going on the impact on the game was not noticable. Of course it would not be all that difficult to test how such repeating checks would effect the game.
#15
08/17/2004 (5:02 am)
I added those LOS meshes to the car and not to the wheels. I tought, if they are only used for projectiles, I could just add them to the car where the wheels should go, and it would not affect the collision/behavior of the car. But, this isn't the case, the car wasn't able to drive, becuase the LOS meshes where used for the car collision too. This doesn't make any sense to me, LOS is only ment for projectiles, right??
Torque Owner Max Robinson
However if vehicles in your game are meant to be more durable, ie, not take damage from impacts into the ground - then this would be really confusing for players. Also, the tendency of vehicles to freak out when touching the ground and bounce around rapidly (usually going underground and exploding) looks rediculous.
Your idea brings up a couple of questions I've had - does it seem like friction is not applied as much as it should be on collisions? If a vehicle fell into the ground, you'd expect it to bounce, but not slide indefinitely. It should stop - perhaps this is users of the engine setting the friction settings too low - I'm going to have to play with this now.
Ideally, the collision code would be fixed. I'm not sure what's wrong with it - it seems perfectly fine to me when I look at it - but apparently it doesnt cut it for every situation. For a quick impact its ok, but a head on impact creates a huge amount of lag AND the vehicle often passes through.