Adven. Walking

Started by
2 comments, last by stilltjack 20 years, 8 months ago
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
Advertisement
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.
ASCII stupid question, get a stupid ANSI
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.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
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.

This topic is closed to new replies.

Advertisement