   Collision Detection
  Hey guys,Sorry for the long post.I've never done collision detection before and am thus still learning and I need a bit of advice.I'm currently making a strategy game and I'm thinking the best form of collision detection for me would be "multisampling" that way I'm detecting the collisions before they occur and then adjusting the units trajectory so they go around the collision.To detect if the collision is going to occur is easy as it's just a matter of detecting if an object is located in the area that the unit is going to be in.When the unit adjusts it's trajectory it needs to move in different ways depending on where the collision occurs within the object. I'm a little bit stumped at this point. My best idea is to split the object into quadrants like this: -- -- -- |1 |2 |3 | -- -- --|4 |  |5 | -- -- --|6 |7 |8 | -- -- --So if for example the unit mostly hit the right side of quadrant 3 then the unit is moving from right to left and therefore the unit needs to adjust it's trajectory a little bit to the right so it bypasses the object.But I'm not entirely sure how to detect where the unit intersected the object and then what happens if it intersects with more that one quadrant? That opens up too many questions.So now I'm currently tralling through forums and tutorials seeing if anyone has something similar that I can learn off. What I'm finding is a lot of different ways of doing collision detection and now I am unsure if I'm even on the right track.So the question is if I'm not on the right track what should I be doing? And if I'm on the right track could someone please offer me some direction?   
  A couple of questions:1. What shapes are you using to represent the units for the purpose of collision detection? (E.g. circles, axis-aligned boxes, etc.)2. What shapes are you using to represent the obstacles?   ;  I'm going for a very retro sort of look as I'm no artist.I have buildings which are rectangular.I have units which are circles although they are just a texture mapped to a square object.So everything is square or rectangular.   ;  sounds like your confusing pathfinding and collision.try breaking the two pieces of logic up, itll make things easier.some other things to look at, is a* (for pathfinding), influence maps (for pathfinding), and collapsing axis theorem (collision);  I do realize that path finding and collision are different. What I'm saying is that I have detected a collision simply by checking if any objects exist in that area. What I'm having trouble finding is the mathematics to work out where in that object the collision occurs. Then based on that information I can work out how to find the path the unit will take to avoid the object.Will "collapsing axis theorem" teach me how to do this? And if so do you have a link that explains the theorem? I have searched online but I do not believe what I've found is what you mean.Any help you can give me will be greatly appreciated.   ;Quote:Will "collapsing axis theorem" teach me how to do this? And if so do you have a link that explains the theorem? I have searched online but I do not believe what I've found is what you mean.I think he may have meant 'separating axis theorem'. (If there is a 'collapsing axis theorem', I'm not aware of it.)   ;  That looks better thanks. I'll read into it and "try" to understand it!BTW collapsing axis theorem looked like chemistry...   