Totally thrilled by the possibilities of jMonkeyEngine, my game is coming along really nicely.
To sum up: Its a tower defense game, not based on a grid (ie. squares or hexagons lined up nicely).
Not using a grid, I’ve begun to look at the posibility of using a navigation mesh to relay navigation information to the creeps in my game. I’ve also implemented the navigation mesh generator from MonkeyZone in my game and can see that it is able to generate from both mesh as well as terrain. My question is this: When I place obstacles (Ie towers/turrets/defense), how would I go about updating the navigation mesh, so that creeps would not pass straight through my obstacles. As it is now, my towers are simply boxes that I place with an absolute coordinate (omitting physics on these towers to minimize calculations done).
I read this post: http://hub.jmonkeyengine.org/groups/general-2/forum/topic/geometry-navmesh-collision-detection-using-collidewith/?topic_page=2&num=15 which seems to indicate that obstacles can indeed by included as non-traversable in a mesh. How does it work ?
Any way to use a dynamic mesh, to include spatials that I add throughout the game - and then re-create the navmesh each time ?
Updating a nav mesh is very slow and CPU intensive. For tower defense I suggest using a grid system. Now that doesn’t mean your units have to walk from square to square, they can cut corners if the next nav node is visible. A grid will help you test if you are fully blocking a path to the end point as well.
You can create what I did: create a navigation mesh, and based on that, you create a grid system on the top of the navigation mesh. For a Tower Defense or a RTS, I would go with a grid system. You shouldn’t go with a NavMesh solo for paths that you can build on them.