Advertisement

A* Points of visibility

Started by July 17, 2006 02:04 PM
1 comment, last by Nit 18 years, 4 months ago
I have been searching to use best practice in route finding and I realized the easyness and robustness of Points of Visiblity technique. But I have some lack of knowledge in order to implement this technique. Any help would be valuable. The thing that I understand from Points of Visibility technique is placing points just bit away from convex corners. We have a start position and end position. Start position is the point where character stands. End point is the point user desire to take character. Assume that I have placed all polygons and their visibility list in level design process. When characters wants to move a point, if an obstacle in front of him, we find the visibility points of this obstacle and make character move around that obstacle. The point is that I don't understand is. How do I insert the start and end position of the route inside our visibility list?. Do I have to find the visible points from the start point?. If so how? and same questions for end point.
Life is beautiful
You can find visibility between the start/end point and the precalculated points with a simple raycasting technique. Alternatively you could perhaps create a Voronoi diagram which quickly tells you which is the nearest point given the area the node is in. You don't really need to do any inserting as such. You just use your generated start node to find the precomputed point nearest to it, then calculate a path until you reach the point that is nearest to the end. Then you can copy the whole path, start and end points included if you need, to whatever structure you want.
Advertisement
Allow me to elaborate a bit more on what Kylotan said above. Your search consists of moving from your starting point (character location) to the end point (desired character location). So you start with that starting point, and all of its successor nodes will be (1) any visibility point that you can connect with an edge that does not intersect any of your geometry and (2) the end point if you can reach the point without intersecting any of your geomentry.


So referencing a crappy drawing that i made and posted a while ago:






You'll see the geometry is some polygon, and visibility points are the pink dots that are offset from convex corners on the polygon. With the starting point being the leftmost cyan dot, the successor nodes of the starting point would only consist of the 5 visibility points on the left side of the polygon.

This topic is closed to new replies.

Advertisement