Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check Spline collisions (Pathfinding)
#1
Question 
Hello!
I'm using the asset for Pathfinding. (Working well btw)
Now I'm thinking about how to check collisions of the "Path" and recalculate it.

Collisions: I've seen a thread where the recomendation is to use some Spline Controllers with colliders to check the collisions along the Spline. My game will be for SmartPhone, this is expensive? Is the best way? (Any other solution?)

Recalculate Path: This is not a Curvy issue itself, but... Any idea of how to recalculate the path to avoid the collision? Right now the system gets StartPoint and TargetPoint and make some ControlPoints between to smooth the steering of the object.

Extra: Any way to make the Spline to use the last CP rotation and add it to the curve (To have this rotation at the end point). Right now I'm using one of the handles of the last point to achieve it, but not smooth enough. (Any way to use it with automatic handles?)

And... It's everything I think

Thank you very much!  Big Grin

Curvy is an awesome Asset to be honest, super smooth!

-Hukha
Reply
#2
Hi,

Collisions: I don't think it is expensive for smart pones, except if you have really a lot of objects in your scene. Keep in mind that I don't have experience making smart phone apps, so I might be wrong. Regardless, if the objects you want to check collisions against are static and defined in edit time, you can save their position on the path (a value between 0 and 1) and check against those values at runtime, instead of using colliders.

Recalculate path: I don't have a solution to that. Maybe looking for "collision avoidance path algorithm" will help

Extra: Sorry, I didn't understand. You want the rotation of the last cp to be the rotation at the end point? Aren't those the same concept?
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
And thanks for the praise, It makes me happy Smile
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#4
Question 
(03-23-2020, 02:14 PM)_Aka_ Wrote: Hi,

Collisions: I don't think it is expensive for smart pones, except if you have really a lot of objects in your scene. Keep in mind that I don't have experience making smart phone apps, so I might be wrong. Regardless, if the objects you want to check collisions against are static and defined in edit time, you can save their position on the path (a value between 0 and 1) and check against those values at runtime, instead of using colliders.

Recalculate path: I don't have a solution to that. Maybe looking for "collision avoidance path algorithm" will help

Extra: Sorry, I didn't understand. You want the rotation of the last cp to be the rotation at the end point? Aren't those the same concept?

Thanks for the reply!

About the Extra, something like that:
[Image: Fs1gzhe.png]
Modify the curve, so when the controller reach endpoint, have the LookAt rotation of the end point.
I hope you understand with the visuals!

Thanks! Angel
Reply
#5
So If I understand correctly, you want the controller at the end of the spline to look at the last cp's orientation instead of the tangent of the spline at the end of the spline. Right?

If so, the only way I think about needs coding:
You can use the OnEndReach event of the controller to disable the controller once it reaches the end of the spline, and then orient your controller however you like.
You can also modify the code of the controller/override the controller's code, and add a special case when the controller reaches the end of a spline (RelativePosition == 1) in the code defining the orientation. A good entry point would be the method ComputeTargetPositionAndRotation
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Method of scattering objects along spline joebain 1 3 11-26-2024, 03:20 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_
  Nested Spline Volume Spot Instantiation merobbins5 3 7 07-26-2024, 09:58 AM
Last Post: _Aka_
  Left-right movement, and spline follow shihaya 3 10 07-12-2024, 12:50 PM
Last Post: _Aka_

Forum Jump: