NavMeshPathFinder in jme 3.1

Hi guys…

I was using

for path finfding in my game… I recently switched to using jme3.1
and i had to copy the project and change a few

intersectionPoint.interpolate(wall.getPointB(), wall.getPointA(), distBlend);


intersectionPoint.interpolateLocal(wall.getPointB(), wall.getPointA(), distBlend);

To get it to work… However now my game crashes fairly regularly with the following stack trace

"pool-6-thread-1" #34 prio=5 os_prio=31 tid=0x00007f9a2300f000 nid=0x3b0b runnable 
java.lang.Thread.State: RUNNABLE
- locked <0x0000000741bb6df8> (a
at com.jme3.lostVictories.objectives.TravelObjective.planObjective(

im not actually 100% sure whats going on here.
Does this mean its in an infinite loop ?
I do call path finding outside the main update loop… As it doesn’t change the scene graph… annoyingly the game doesn’t seem to crash when i debug it… So im finding it very difficult to tell whats happening apart from taking thread dumps once it has crashed

I found that calling jme3-ai outside the main thread is fine as long as there’s no more that one thread doing so.
Are you doing that? I used a Executors.newSingleThreadExecutor() to run my searches.

btw, I did this before 3.1.

1 Like

Ah… I see i do have multiple threads calling it… and thought i would only allow one thread in at one time by putting synchronised on the top level method that does path finding…

ill try you suggestion…

Btw there is MeFisto94/jme3-artificial-intelligence on github which has that change you did for 3.1, for any one wondering if there is an updated version