Bot Miscalculating path on an incline
by Yasha · in Technical Issues · 05/05/2008 (2:13 pm) · 5 replies
Hi,
I have an oval, nascar type, track that I imported as a dts object. The bots are supposed to follow the path which is somewhere in the middle of the track. Instead the bot seems to miscalculate the effect of the incline and drops too low consequently missing the next path marker. After missing it the bot goes back and forth around the marker until it hits it and then moves onto another. Does anyone know how to deal with that. I have tried playing around with mass, drag and momentum and it didn't help. At best i can make the bot not miss a whole side but then at the sharp turn it will fly off of the track.
Thanks for any help,
- Jake
I have an oval, nascar type, track that I imported as a dts object. The bots are supposed to follow the path which is somewhere in the middle of the track. Instead the bot seems to miscalculate the effect of the incline and drops too low consequently missing the next path marker. After missing it the bot goes back and forth around the marker until it hits it and then moves onto another. Does anyone know how to deal with that. I have tried playing around with mass, drag and momentum and it didn't help. At best i can make the bot not miss a whole side but then at the sharp turn it will fly off of the track.
Thanks for any help,
- Jake
#2
05/07/2008 (7:43 am)
Sorry I didn't reply there but yeah you are right the idea didn't work. By setting the tolerance to a higher value, the bot was able to skip by a few nodes but since it never goes up the incline and only parallel to it it ends up repeating the behavior just every few nodes instead every node. I'll play around with speed and will port it over as diff and will post again.
#3
Aun.
05/07/2008 (10:00 am)
The easiest way I got over this problem was to slow the AI down as it get closer to the path marker.Aun.
#4
05/08/2008 (7:36 am)
Just a thought but isn't there a friction setting for AI in their datablock? Increasing that might make them more "sticky" to the track.
#5
The higher the speed is, the farer the object moves away from the path.
One other thing is the horizontal speed threshold, which triggers speed cap.
See this in the dataBlock definition of PlayerData :
But in the code, the horizontal speed (as its name shows us), is only calculated on the x and y composants of the speed.
So z composant is ignored, and so, when you go down a slope, your accelerates but with no resistance speed on the (perhaps) biggest speed composant, the Z one.
If you modify the source code to get the Z composant into account, you can resist high speed more strongly and so have a better control on the speed and on the path.
Nicolas Buquet
www.buquet-net.com/cv/
05/08/2008 (9:45 am)
Yes, I played with this a few days ago.The higher the speed is, the farer the object moves away from the path.
One other thing is the horizontal speed threshold, which triggers speed cap.
See this in the dataBlock definition of PlayerData :
horizMaxSpeed = 20; horizResistSpeed = 10; horizResistFactor = 10;
But in the code, the horizontal speed (as its name shows us), is only calculated on the x and y composants of the speed.
So z composant is ignored, and so, when you go down a slope, your accelerates but with no resistance speed on the (perhaps) biggest speed composant, the Z one.
If you modify the source code to get the Z composant into account, you can resist high speed more strongly and so have a better control on the speed and on the path.
Nicolas Buquet
www.buquet-net.com/cv/
Torque 3D Owner Morrock
The bots don't really "miscalculate" inclines or anything (unless you've written your own code for that) they just move from one node to another at the speed set for them. If your cars slip below the node on curves you could either a) increase their speed around turns so they'll run higher around the bank, or b) increase the AI's setMoveTolerance(%value) higher so if they end up below a node by a few meters, they still consider it as "hit" and move onto the next one.
Also, if you're talking about falling down the curves on straightaways, don't race tracks just bank on the curves, and then flatten out on the straight lanes? I tried looking for a few pics, and couldn't see due to the angle of the camera, but it makes sense it would be like that. If not just ignore this paragraph :p
edit: I see you asked pretty much the same question in the programming section and obviously the setMoveTolerance() didn't work. Let's hope the other idea helps!