Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collision avoidance
#1
Hello, I did a quick search and couldn’t find much info on this except 2 ~3 year old threads on this.

My question is, is it possible to predict collisions and stop them from happening across spline paths? This is the scenario: Say there could be 20 different paths orbiting around an object that might overlap each other at some points. Those 20 controllers would then run the risk of bumping into each other. They would also be of varying sizes. How can you predict collisions and then adjust the speed of an object to prevent said collision?( I imagine that would be the easiest way to avoid it)

The best idea I could come up with is by placing a train-like trigger boxes in front of every object to follow the same path of said object with the exact same parameters. When a collision is detected, the parameters of the original path and the trigger path would be adjusted in the same way and then restored to their original states.

Though that wouldn’t be too hard to implement since there’s an example of a train included, what I’m stuck on is how to determine by how much to slow down the object smoothly enough to avoid the collision, especially since controllers would have varying sozes, speeds, orientation, paths, everything.

Has anyone ever tried any collision avoidance between controllers on paths before? If so, how did you do it? Is there an easier way than the stuff I just posted above?
Reply
#2
Hi,
The controller classes have a protected method called SimulateAdvance. It documentation says
"Advance the controller and return the new position. Contrary to <see cref="Advance"/>, this method will not do any side effect operations, like updating some internal state, or triggering events"
You can use this method instead of having a trigger in front of your object, it will yield better results.
You can expose publicly the method in your own controller class (inheriting from SplineController for example) and then have a crowd manager that will simulate the advance of all the controllers, then detect collisions and modify the properties of the relevant controllers.

(11-09-2018, 02:49 AM)radu392 Wrote: how to determine by how much to slow down the object smoothly enough to avoid the collision, especially since controllers would have varying sozes, speeds, orientation, paths, everything.

If you can't find a simple logic that benefits from your game scene constraints, give a try to this method:
http://gamma.cs.unc.edu/ORCA/publications/ORCA.pdf
Unlike what the paper states, your objects can't move freely, so you will need to modify their solution to fit your constraints.

PS: I never worked with collision avoidance, neither have I implemented the above paper, so I have zero experience on this field. It's just that years ago I attended to a talk of a Crytek employee presenting this method, or a very similar one, which they implemented in Crysis 2
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
Thanks for the reply! That does sound like what I need, I’ll be taking a look at it soon.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Can't export custom collision meshes Mike Danielsson 5 10 10-14-2022, 10:36 AM
Last Post: _Aka_
  Local Avoidance with splines and colliders. ArachnidJacob 4 8,943 06-10-2015, 06:42 PM
Last Post: ArachnidJacob
  Collision along spline Keladinus 5 10,053 08-09-2014, 05:28 PM
Last Post: Jake

Forum Jump: