Flying vehicleand terrain collision bug fixed?
by Alex \"bathala\" Rufon · in Torque Game Engine · 05/19/2004 (9:58 am) · 8 replies
Hey.
I just updated my copy of TGE a few minutes ago and noticed that there were changes to the following C++ files: rigid.cc rigid.h.
I started to become nervous and excited at the same time and immediately merged it with my game. While recompiling my game ... I then scooted to the CVS changelist to check what was the change for ... there was nothing new there.
Well, after compiling, I booted up may game and loaded my player on a warsparrow and tried to ram it into a mountain. Lo and behold! The terrain collision bug is GONE!!! The warsparrow just bounced back off the terrain instead of passing through.
Can anybody else try it please? I'm hoping this is not a fluke and its really fixed.
Please let me know.
r/Alex
edit: spelling fix
I just updated my copy of TGE a few minutes ago and noticed that there were changes to the following C++ files: rigid.cc rigid.h.
I started to become nervous and excited at the same time and immediately merged it with my game. While recompiling my game ... I then scooted to the CVS changelist to check what was the change for ... there was nothing new there.
Well, after compiling, I booted up may game and loaded my player on a warsparrow and tried to ram it into a mountain. Lo and behold! The terrain collision bug is GONE!!! The warsparrow just bounced back off the terrain instead of passing through.
Can anybody else try it please? I'm hoping this is not a fluke and its really fixed.
Please let me know.
r/Alex
edit: spelling fix
About the author
I am an independent game developer who's never going to make it in the industry because I'm color blind and has absolutely no imagination.
#2
That bites.
I have beat my head on this particular problem from the very beginning (though we're working with hovers). In fact, my whole project has been halted while my partner and I have been researching it - to no avail.
Speed does appear to be the triggering factor and creates an instance where the placement of the object exceeds the stepsize (did I say that right? Clear as mud?).
In the end, we tucked our tales and decided that shrinking the terrain size, slowing down the vehicles and implementing a slight motion blurr would be the only way we could get the speed effect - but it makes me feel "dirty" like I'm cheating or something.
/sigh
05/19/2004 (11:33 am)
=(That bites.
I have beat my head on this particular problem from the very beginning (though we're working with hovers). In fact, my whole project has been halted while my partner and I have been researching it - to no avail.
Speed does appear to be the triggering factor and creates an instance where the placement of the object exceeds the stepsize (did I say that right? Clear as mud?).
In the end, we tucked our tales and decided that shrinking the terrain size, slowing down the vehicles and implementing a slight motion blurr would be the only way we could get the speed effect - but it makes me feel "dirty" like I'm cheating or something.
/sigh
#3
For practice, based on the flying vehicle code and some aerospace engineering textbooks I dumpster-dived, I whipped up a semi-realistic flight mechanics system for Torque. I say semi-realistic because some physics requirements of proper aerodynamics are not accounted for in the Torque engine. It includes changes to flyingVehicle.cc and a system of creative usage of some of the existing exposed variables.
Because of these missing variables, altering gravity became my catch-all for altering flight mechanics when the engine failed to provide proper values.
To the point:
I loaded a warsparrow into the game, mounted it, applied no power from 1km in the air and watched it drop like a stone (in a nice arc based on the bounding box I might add).
It reached a velocity in excess of 1300kph and SMASHED into the ground as one would expect. I altered the gravity settings further and caused asserts around 16,000kph.
Not in any test did the model ever pass through the terrain.
Something you might want to consider. I have a VERY high terrain collision damage modifier. For our purposes, if you touch ground without mlandingGear = true you go *boom*. mlandingGear simply dampens the damage effects of terrain collisons and modifies the handling of the vehicle for a more "wheeled" feel if the bounding box is in contact with the ground.
The FlyingVehicle::updateMove and HoverVehicle::updateMove code are really quite simple to follow. I can't say I ever noticed this problem before we made our changes, but it is certainly not evident afterwards. I gutted the original FlyingVehicle::updateMove.
I try to save everything somewhere, but this was on a test project I developed about a year ago for practice. I KNOW I saved it somewhere. I'll try to see if I can't dig it out this week and post it. You can then try it in your game and see if it doesn't fix the effects you are seeing.
If you think it's worth it to test on your stuff, I'll see about scrounging up that code.
05/23/2004 (2:16 am)
Ummmm.... How fast were your vehicles going?For practice, based on the flying vehicle code and some aerospace engineering textbooks I dumpster-dived, I whipped up a semi-realistic flight mechanics system for Torque. I say semi-realistic because some physics requirements of proper aerodynamics are not accounted for in the Torque engine. It includes changes to flyingVehicle.cc and a system of creative usage of some of the existing exposed variables.
Because of these missing variables, altering gravity became my catch-all for altering flight mechanics when the engine failed to provide proper values.
To the point:
I loaded a warsparrow into the game, mounted it, applied no power from 1km in the air and watched it drop like a stone (in a nice arc based on the bounding box I might add
It reached a velocity in excess of 1300kph and SMASHED into the ground as one would expect. I altered the gravity settings further and caused asserts around 16,000kph.
Not in any test did the model ever pass through the terrain.
Something you might want to consider. I have a VERY high terrain collision damage modifier. For our purposes, if you touch ground without mlandingGear = true you go *boom*. mlandingGear simply dampens the damage effects of terrain collisons and modifies the handling of the vehicle for a more "wheeled" feel if the bounding box is in contact with the ground.
The FlyingVehicle::updateMove and HoverVehicle::updateMove code are really quite simple to follow. I can't say I ever noticed this problem before we made our changes, but it is certainly not evident afterwards. I gutted the original FlyingVehicle::updateMove.
I try to save everything somewhere, but this was on a test project I developed about a year ago for practice. I KNOW I saved it somewhere. I'll try to see if I can't dig it out this week and post it. You can then try it in your game and see if it doesn't fix the effects you are seeing.
If you think it's worth it to test on your stuff, I'll see about scrounging up that code.
#4
05/23/2004 (1:58 pm)
Bryce, sounds like a nice flyer. My game also has the same problem with the flying vehicles, your the only one I've seen with it fixed. I would sure like to test out your flyer class.
#5
I'll see about digging up that class this week.
05/23/2004 (2:39 pm)
Now I'm not saying that I fixed it... I'm just saying that in our testing we never encountered it.I'll see about digging up that class this week.
#6
05/23/2004 (3:47 pm)
Are you going to make a resource of this Bryce? I would love to play around with it myself. And what is warsparrow? Is it a resource or a pack that's for sale?
#7
The WarSparrow is from the BraveTree Content Pack. It's used for testing new code because it's a common point of reference for flying vehicles for the Torque community.
If I cannot find the original class (as I said, it was just a test application to see what I could do) I certainly remember it enough to rewrite it this week.
I'll dig around for it tonight and if I can't find it I'll just take a day and recode it. I'll post on this thread in the next day or two with the results.
05/24/2004 (7:03 am)
A resource? Never thought about it but I think it could be cleaned up enough to be usable. The WarSparrow is from the BraveTree Content Pack. It's used for testing new code because it's a common point of reference for flying vehicles for the Torque community.
If I cannot find the original class (as I said, it was just a test application to see what I could do) I certainly remember it enough to rewrite it this week.
I'll dig around for it tonight and if I can't find it I'll just take a day and recode it. I'll post on this thread in the next day or two with the results.
#8
06/01/2004 (1:41 pm)
Any progress on this yet?
Torque Owner Alex \"bathala\" Rufon
Funny thing is, I implemented Thomas Lund's GodView mode and using that I could not get the warsparrow to go through the terrain. This is not the case when I switch back to the standard first person view though.
I really need to get some sleep. ;)
r/Alex