Alright, lets see if I can get the logic down for this:
Case: I am moving an object in a field of other moving objects. The user decided where these objects are moving, like in a typical RTS game.
High Level Logic:
1.) During each tick of the movement cycle, I look at each object.
2.) When I look at each object, I see if anything will intersect during it's current direction.
2.1.) I can do this by stepping through the future based on the current speed of both parties. If at any point they intersect, do something to avoid it.
2.2.) To avoid the detected collision. I somehow have to choose what the two parties will do.
2.4.) I want to ensure that objects never move faster than their max speed. Generally, the objects will always be moving at their fastest rate. This means that I have to deduce the time it will take the objects to reach their intersection point. I have already done this in 2.1. I can then calculate which one to slow based on the distance.
Problem: What if I detect more than 1 collision with the same object and then I decide to slow it when it's speed should not change? Example: Object 1, 2 and 3. Object 1 will have a collision with 2 and 3. Upon looking at the cases, in sequential order I determine the following:
Object 1 vs 2: Object 1 remains constant while Object 2 slows down.
Object 1 vs 3: Object 1 slows down while Object 3 remains constant.
So now my previous calculations are not correct. How do I avoid something like this situation? With a large set of units in a close area, this looks to be very difficult to solve. Though, I suppose if the objects are not moving very fast then the amount of collisions are very low.
I have some other cases, but I will post those up after we talk about this one