Creating a navmesh with ladders

Ok… here is where these are defined for generating the nav mesh… they are used somewhere along the way when generating paths (iirc).

https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/sdk/jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshGenerator.java

And she fails again. I did rewrite the pathfinding classes and I don’t see anything in mine that account for traversable slope either. So, long and short of it is… this should not be happening >.< How helpful was that?

Did you try removing the floor inside the building to see if the pathfinding still fails?

lol, well im glad youre as confused by this as i am atleast :smiley:

when i removed the the ground under the roof from the navmesh, the end result was that the PathFInder would totally fail and not find a path at all when targeting the roof (the path would have no waypoints in it).

atleast that narrows it down to the lower part of the house not interfering (i think?), so theres something weird the roof and ladder part.

interestingly though. if i walk the ninja to the ladder to descend down it, as soon as hes on the ladder it can find a path to him and it looks pretty correct. (it is re running the path finder every 1 second on a timer).

though im not sure if this is because im on the ladder, or if because im also just barely on top of the regular ground part of the navmesh (not sure if that makes any sense).

if i can figure out how to do it (Im just now learning blender) im going to try and give the vertical porton of the navmesh some depth, maybe that will help, somehow someway… though my original experience in trying to make a navmesh by hand was that using a plane worked, but a shape with depth (like a thin cube) did not, atleast for the ground anyway.

Thats a good thing… sort of…

Next question, are the vertical ladders actually attached to the ground and ceiling?

Actually, I think you just answered this. If I followed correctly. Yeah… one mesh and all should work fine.

EDIT: Even though the mesh will be over-complicated. Try using a grid, extrude the roof… remove all faces of the walls except the ladder and try that. If it works, add the floor to the building and make sure all is still good. After you are sure all is working, you can simplify the nav mesh…

I’m not sure what state the nav mesh generator is in, but you may want to give this a shot as well, once the above issue is resolved.

ok im starting to learn new things about the issue:

1- if i remove the ground floor of the house AND then put very minor slant on the ladder’s nav mesh. then sinbad will get pathed as expected

2- if i put the ground floor nav mesh back it doesnt work

3- if i only remove half of the ground floor nav mesh, when the ninja stands on the part of the roof where theres no ground floor navmesh, sinbad will get pathed properly. but if ninja stands on the part of the roof where theres the ground floor nav mesh below him… then sinbad gets pathed to inside the house

sooo… something about the code that doesnt like it when theres two pieces of walkable land on top of eachother in the vertical direction.

@t0neg0d said:

I’m not sure what state the nav mesh generator is in, but you may want to give this a shot as well, once the above issue is resolved.

well now that i know where the actual code is for the nm generator i might have to try that. though i have a feeling itd have the same flaw , assuming i can get it to generate the kind of nav mesh i want to use.

If you’re planning on altering the source… I’d go to the source and get the latest build for Java. NavMesh is using an old build of CritterAI. The sources for the current version are available for download.

@t0neg0d, do you happen to know what version the ai plugin is using specifically? on the website it says the last update was in 2012.

btw ive created a test scene with a few various types of multi-leveled structures. Interestingly what ive come to figure out is that there is no problem with working with upper/lower floors if the path simply requires going through the upper floor. the problem is specifically if the start or end point is an upper floor.

if im able to just make a small alteration to the existing code i might just go that way, maybe ill even post the fix back here :D.

anyway thanks for helping me troubleshoot this t0neg0d

well this is unfortunate…

In NavMeshPathFinder.comutePath(Vector3f, DebugInfo)

all i had to do to fix this issue was take these lines…

Vector3f newPos2d = new Vector3f(currentPos3d.x, 0, currentPos3d.z);
Vector3f goalPos2d = new Vector3f(goalPos.getX(), 0, goalPos.getY());

and turn them in to it

Vector3f newPos2d = new Vector3f(currentPos3d.x, currentPos3d.y, currentPos3d.z);
Vector3f goalPos2d = new Vector3f(goalPos3d.getX(), goalPos3d.getY(), goalPos3d.getZ());

so this had been a fun ride… not sure why y=0 was coded in here, perhaps a workaround for navmeshes generated from terrain in the sdk? or just something that accidentally got uploaded. who knows.

well for anyone who is having my issue and stumbles in to this thread and reads all two pages. theres your reward.

2 Likes

Hi icamfromspace, I have one question how did you turn on path finding debug app state?. I also want to see the path created by “computePath” method in the map. Many thanks