Robmaister / SharpNav

Advanced Pathfinding for C#
sharpnav.com
Other
537 stars 129 forks source link

Saving/loading navigation mesh #35

Closed Sgreben72 closed 9 years ago

Sgreben72 commented 9 years ago

Is it possible to save/load navigation mesh on disk after it is built or is it necessary to build it from geometry input every time? Or is it in plans for future? I see there's some json serialization code commented out.

Robmaister commented 9 years ago

Yeah, this is a planned feature, I just haven't gotten around to it just yet. The way an old collaborator was trying to JSON serialize a navmesh was very intrusive (adding a property into maybe a third of the classes in SharpNav, even the tiny ones), I'll eventually write a separate class that serializes everything with reflection.

Currently planning on implementing 3 file formats:

.snb - custom binary format .snx - XML serialization .snj - JSON serialization

If you'd like to help implement it, I can quickly stub out a NavMeshSerializer abstract class in a new SharpNav.IO namespace.

Sgreben72 commented 9 years ago

Yep, I can try to do it.

Robmaister commented 9 years ago

Stubbed something out in 42089b4