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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
And thanks for the praise, It makes me happy Smile
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 4 Yesterday, 07:25 AM
Last Post: amutp
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 13 03-04-2024, 11:06 AM
Last Post: _Aka_
  Keeping a fixed spline length jh092 3 16 02-21-2024, 06:25 AM
Last Post: Primrose44

Forum Jump: