Advertisement

Generating Navmeshes thru Heightmaps

Started by September 29, 2008 05:13 AM
0 comments, last by wodinoneeye 16 years, 1 month ago
Hello, I have bought the book AI Programming Wisdom 4 and am reading it. In ramon's article, he addressed the method of generating navmeshes thru heightmaps but didn't discuss it in detail (especially about the movement expansion method which I don't quite understand) and no source code was provided. In that article, he introduced the "navmesh" method of using the top or perspective view of the model by rastering it into pixels, so that the graph could be built (called render-generate method) from that image. He also said the obstacles can be represented and seperated by colors. With my scene created by our artist, I doubt it if it would work because there are many colors that are exactly the same. It is quite hairy and couldn't get out of it. I don't know if I have grasped what ramon said. Any comments are welcome! Thanks Jack

If the heightmap is a regular grid then you may not need to generate a seperate map. Usually the slope of the path is the limiting factor for movement and the engine (or client as a prechaeck) can calculate the slope at its position+direction on the triangles define by the heightmap and prevent movement when the slope exceeds some limit (and effort can go up as the slope increases). Of course a negative (down) slope may be calculated differently -- its easier to go (plummet) down than up....

One advantage of an added Navmesh on an irregular heightmap is that it can be simplified so that fewer adjacency tests/ triangle transitions need to be done while moving.


The author was probably talking about using a simple pixel texture to map into (correspond to) the tiles formed by the regular grid heightmap and containing precalculated movement evaluations (so that before you allow movement into the tile space you check its 'color' to see if movement (or other actions) are allowed in it. If the precalculations can be determined by logic, you can have the program evaluate the heightmap data and prebuild the textures data (and you wont have to do it by hand).
--------------------------------------------[size="1"]Ratings are Opinion, not Fact

This topic is closed to new replies.

Advertisement