Game Development Community

How to fix flying vehicles going thorugh stuff

by Dan Keller · in Torque Game Engine · 01/03/2006 (11:12 am) · 7 replies

If anyone has the problem of a flying vehicle that goes through terrain and interiors at high speeds, you can fix it by changing collisionTol to 0.5 in the datablock. (You may have to change it to something slightly higher if you have a high maneuveringForce.)

#1
01/03/2006 (11:28 am)
Dan,

Not to "steal your thunder" or anything like that, but the collision issues affecting flyers and hovers (closely related classes anyway) go much deeper than collisionTol.

Have you set up jetting for your flyers yet?

If not, do so... get some altitude, aim at the ground, hit the afterburner and slam the terrain.

I bet you still pop through.

If I'm worng, by all means, correct me. This has been my biggest issue (working with hovers).
#2
01/03/2006 (12:15 pm)
Hi guys,

Just to add an offbeat idea . . . I'm currently using a weapon object that fires rapidly with very short lifetime projectiles. The projectiles apply a radius impulse to bounce the flyer away from the terrain/interior/shape. It works pretty well, but not perfectly. I'm hoping that additional tweaking will solve this for me.

Anyway, just an idea.

Aaron E.
#3
01/03/2006 (12:43 pm)
Interesting idea Aaron.

Only problem I can see would be he use of this solution in multiplayer.

All of those projectiles flying back and forth across through the network layer could have an adverse imapct on performance, which for me is not an option. =\
#4
01/03/2006 (1:01 pm)
Kirby,

I haven't tried it out on a network yet. You're probably right, though. If it ends up not working for me, I'll try something else . . .

My other oddball idea is to look at the terrain and water rendering code and see how the engine determines if part of a water block is above or below the landscape. Currently, water that is immediately under terrain doesn't get rendered. Whatever the code is that determines the undergrounded-ness of water might also help us keep our flyers above ground. Once that determination is made, we could trigger a localized impulse or maybe 'set' the translation of the flyer/player back up above the terrain.

I think Josh Ritter fiddled with underground detection for MoM to allow him to have streams/lakes/etc in his dungeons/caves. If he did get it working properly, then that approach should be network-safe for the rest of us. :)

Aaron E.

[edit: added a smilie.]
#5
01/03/2006 (1:35 pm)
Aaron - interesting stuff! I'll definitely keep my ears peeled for info on this. =)

As an aside, you might check out this thread. There is some excellent infor on vehicle physics and collisions.
#6
01/03/2006 (2:18 pm)
Kirby,

That looks like a good thread. Thanks for the link.

Aaron E.
#7
01/04/2006 (4:17 pm)
I didn't mean this as a foolproof fix, it's just sort of a hack to get it to work in the short run before someone actually fixes the problem.

Anyway, if it still pops through, I can just set collisionTol higher. (It doesn't have much affect on how it looks)