#### Archived

This topic is now archived and is closed to further replies.

This topic is 5618 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Howdy Folks, I''m working on an adventure game engine (for fun), and am at the point where I''m going to write the algorithm for moving the character around (point and click style). Currently I have the walkable areas stored as polygons, and am using regular polygon point containment alogrithm to check if a point is in the poly. I''m thinking of using A*, breaking down the screen into 25*25 squares, checking if the center point of each square is in the polygon, and assigning weights in that manner. Then, the directions are calculated, put in a queue, and executed. Before I go to all the trouble of writing this, can anybody tell me if this is a good idea (or is there a better one)? thanks, stilltjack

##### Share on other sites
I dont know much about pathfinding but try looking at this article: http://www.gamedev.net/reference/programming/features/precalcpath/ From what it sound like that could be a good solution to your problem.

##### Share on other sites
Since you already have walkable areas defined by polygons (triangles I assume), you can use A* on those rather than creating a separate grid. A* does not require a grid.

##### Share on other sites
I agree with Yohumbus. If you just use the polys, and link up the ones you can move between, then using the A* algorithm will work quite well.

Only thing u gotta think about is how you would assign weights to each polyon (and in a point and click, would you need to assign weights, surly they would all have the same weights?), and that the noof polys isnt too large, so the algorithm isnt too slow.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 9
• 9
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
633679
• Total Posts
3013300
×