I've been working on a navigation system for WoW for awhile now, got far enough this weekend that I figured I'd post my progress. I'm not sure if I'll make anything public or not yet, not sure if anyone would even be interested. I figured at a minimum I can supply my experience and maybe answer some questions for others working on the same sort of stuff.
All of the code for this I've written myself, except for libmpq, but I've borrowed a lot of ideas from others, so here's some credits:
-- These forums. I found quite a bit of info by searching existing posts, particularly on figuring out the memory offsets needed for controlling a character to test my paths.
-- The wow.dev wiki. This is where I got all the info about how to parse the WoW data files.
-- The Recast navigation project. code.google.com/recastnvigation. I read his code to get a rough idea of how to start mine.
-- The libmpq library. I'm using it to read MPQs.
The basic idea is to voxelize the collision data into a compact volume representation and then extract movable areas from it. Two polygon meshes are created, one for the area that can be walked on and one for the area that can be ridden on with a mount. Both meshes are decimated to eliminate areas that have insufficient clearance or are too close to walls.
Swimming and flying will be added later by extracting a polyhedral mesh describing the area filled with air/water in the same way. Basically just extract the hull of "no collision" voxels, simplify it in the same way planar contours are simplified, and then partition it into convex pieces. Lots of hand waving there for now, but I know other commercial navigation implementations do it so it must be possible.
About 90% of my time so far has been on tuning to get the nav mesh as clean as possible. Currently I can generate a mesh for eastern kingdoms in about 20 minutes, and that mesh is about 60MB in memory. Even very long paths can be found almost instantly.
The navmesh is tiled into ADT MCNK size pieces [33.3x33.x3]. Tiles can be swapped out live so adding of dynamic M2s and such is possible at run time. Tiles are also qualified by an instance ID and a phase, so multiple characters can use the nav system simultaneously and each can see a different view of the world depending on their particulars. I haven't written the code to actually insert dynamic objects yet, but the hard part is supporting swapping the tiles and that's done...
The architecture supports point to point jump links but I haven't added the code to actually do anything with them yet. Once I'm happy with the basics I'll add flight paths and instance portals between maps.
I'll attach some screenshots of the meshes in the next post.