Grid based pathfinding

It’s me again. So I heard that Panda3D has grid-based path finding already built in… However I can’t seem to find it, or find it in the manual, or even find a live link with any examples to it. :frowning:
Does this exist? And if so, does anyone happen to have an example, guide, or reference for how it might work?

Thank you in advance!

P.S. If anyone is going to ask why I can’t use navmesh pathfinding, it’s because I need to be able to update the navmesh in chunks as the game runs. If that’s possible, then by all means I would love to use navmesh.

It looks like PandAI has some builtin pathfinding. However, that looks to be navmesh based. Other than that, Panda has no builtin pathfinding (grid-based or navmesh).

There have been talks about integrating Recast (navmesh generation) and Detour (navmesh pathfinding). With Recast, we could probably rebuild navmeshes on the fly. However, no one is currently working on this integration at the moment.

The build-in pathfinding panda has (pandai) is kind of grid based - at least the navmesh generating tools want a grid-mesh to make a navmesh. I would not suggest using pandai any way, it’s more of a showcase/proof of concept, last time I tried to use it it was prone to crashing or hanging and the agent movement speed depended on the framerate.

Some time ago I’ve made a implementation for Jump Point Search pathfinding, it’s a cool optimization for square, grid based maps. It uses a list of list (2d list) for the map so it should be easy to load maps by chunks, or you could replace that with a dict if your maps don’t fit a square. You may also want to run the pathinding on a separate thread (or better yet a process) - it’s just Python and can be a bit slow.

Ooh I’m sorry, I should have specified. I needed grid-based path finding for 3D. Sorry for the confusion, it’s my mistake. Does this snippet work in 3D as well?

Not really. It could work for 2.5D (like heightmap displaced terrain) but if you can’t represent your world/map as a 2d array - it won’t work.