Collision Avoidance / Steering behaviors plans

Discussion and feedback on Construct 2

Post » Wed Mar 23, 2016 9:18 am

Hello,

@Ashley

Are there any plans for collision avoidance/steering behaviors officially? May be in C3? Pathfinding is ok for some of the cases, but not when you need fluid organic motion behaviors of single/multiple entities.

Something similar to algorithms described in this articles:

http://buildnewgames.com/vector-field-c ... avoidance/

https://andrewfray.wordpress.com/2013/0 ... -to-share/
B
45
S
11
G
4
Posts: 517
Reputation: 7,398

Post » Wed Mar 23, 2016 11:48 am

This is the kind of thing you could probably write a PhD on. I've tried this a couple of times in other projects, and it feels like a semi-impossible problem.

The real difficulty is not so much in the collision avoidance - it's relatively straightforward to come up with some mechanisms to either make objects steer around each other, or plot paths that are less likely to overlap other object's paths. The real problems start when inevitably something unpredictable happens and everything queues up in to a traffic jam. Then you need algorithms that can unpick the traffic jam without getting other objects stuck or making things worse - while all the time other stuff is happening around it. This is super difficult to do without making objects either get permanently stuck somewhere, or end up with ridiculous results like a line of 10 objects waiting for 1 object to get out the way, but that object is waiting for another object to get out the way, which is waiting for one of the 10 objects to get out of the way, so nothing ever moves even though any one of them could break it by doing something "wrong" like steering away from their destination.

Then when you throw in various types of movements like: can objects pivot while stopped or must they accelerate? Can they reverse? How fast is their acceleration? Are the objects using box or circle collision masks? All of this has a huge impact on the way these algorithms work out.

So I'm pretty doubtful this is something where we can feasibly build a reasonably general-purpose solution.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Wed Mar 23, 2016 1:24 pm

@Ashley

Yes, I understand the problem - there's no clear solution to this, e.g. something like pathfinding, but for collision avoidance. I was able to achieve some "interesting" results with simple vector math and forces, but it only works for objects of regular shapes like squares, circles, triangles and they stuck in corners, don't que, and so on.

https://www.dropbox.com/s/wl1hdnub24kqtyx/col_avoid.capx?dl=0
B
45
S
11
G
4
Posts: 517
Reputation: 7,398


Return to Construct 2 General

Who is online

Users browsing this forum: Tokinsom, Yahoo [Bot] and 18 guests