Dynamically creating astar node map by triangular polygonal map

Posted by jett on Game Development See other posts from Game Development or by jett
Published on 2011-11-12T09:59:10Z Indexed on 2011/11/12 10:17 UTC
Read the original article Hit count: 466

Filed under:
|
|
|

My game's map format uses a bunch of triangles to make up the platforms and terrain in 2d. Right now I can set up a 2d array of nodes for the astar algorithm that basically is a bunch of rectangles across the maps x and y that can be set to "wall" if the a* algorithm should try to go around it. However I want a function in the map loader to create the node overlay if the nodes are not specified. I was thinking if more than n percent of the a* rectangle overlaid on map was filled by polygons I could mark that entry in the array as "wall". However I'm stuck on how to do this(or even start) where/when the triangles can be overlapping and also of variable size.

© Game Development or respective owner

Related posts about java

Related posts about algorithm