bemused by navmeshes
Currently my pathfinding is implemented by searching a graph that has nodes positioned by hand. Each node contains information such as:
Position: x,y
Wood: num
Gold: num
ItemA: num
ItemB: num
etc
So to find the closest food to a character I just use A*, terminating when it finds a node with food. So far so good...
I''ve recently bought AIWisdom and my curiousity has been aroused by the article on NavMeshes. However, when a NavMesh is created the graph nodes only contain position information. This means that I''d have to keep a linked list (or similar) of each item type (like food). And then do A* on the navmesh for each and every item to find out which one is closest. PLUS I''d have to make sure that there is a path from the food position to its closest node in the NavMesh. That''s a lot of additional calculations and would seem to negate any speed benefit from using a navmesh in the first place!
This same problem also applies to the other graph types described in the book (like a visibility graph).
I guess I must be missing something important, so I''d like to know how I can use a navmesh to search for certain items, when those items may be found in many different locations? Can anyone help me?
Navigation meshes are merely a technique for speeding up the search (planning) for an optimal path from a start location to a goal location. There is nothing stopping you from adding extra information into your mesh, or from making your mesh a subset of a larger set of information.
Cheers,
Timkin
Cheers,
Timkin
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement