Code Monkey home page Code Monkey logo

Comments (4)

memononen avatar memononen commented on May 7, 2024

One thing we did for Unitys heavily refactored version of Detour was to separate out the links and off-mesh connections from tiles. That also allowed us to make the navmesh data read only. Since the codebase is so heavily modified it is not feasible to bring the changes back to Detour.

The original idea of having links and off-mesh connections on the tiles was to avoid any runtime allocations. I think I might have gone a bit too far.

Anyways, in order to allow off-mesh connections (OMC) to be added at runtime, the way links are handled need to change too. We use one large pool per navmesh, plus indices as the size may vary. We also removed the restriction of OMC connecting to only neighbour tile. But it came with the penalty that we need to traverse all OMCs when adding or removing a tile.

from recastnavigation.

jakobbotsch avatar jakobbotsch commented on May 7, 2024

This is definitely a feature that would be nice to have. OMCs being allowed to neighbors only is not very flexible. It kind of puts an arbitrary limit of how small you can make tile sizes, which then again affects rebuilding the mesh at runtime.

We could avoid traversing all OMCs when adding/removing a tile by using a hashmap/LUT, similar to how tiles are stored. Or perhaps we could add a dynamic part to dtMeshTile that could store these things?

from recastnavigation.

jswigart avatar jswigart commented on May 7, 2024

I would imagine that you would need to maintain a global list of OMCs external to any tiles, as runtime data on the navmesh itself or whatever, perhaps dynamically allocated in a vector like array. Within those structs you could perhaps cache the tile indices for each endpoint so that if either tile endpoint changes it's easy to identify which of the connections are relevant to each tile to disconnect and reconnect afterwards.

from recastnavigation.

jakobbotsch avatar jakobbotsch commented on May 7, 2024

Ah yeah, of course, they need to be stored even if the mesh tiles they pertain have not been loaded yet. So storing the dynamic ones in dtMeshTile would not be feasible. OMCs to non-adjacent tiles could be stored there as far as I understand, though (ie. in the same way OMCs are stored when building the nav mesh at the moment).

from recastnavigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.