OOM Error with Recast extension

Please see linked video:

You can get a copy of the nav mesh obj here:

http://hh.destef.com/download/2nav.crushbone.obj
http://hh.destef.com/download/2nav.crushbone.mtl

Also, FWIW, I tried processing this OBJ in a barebones node process (babylon null engine), got the same OOM error, so can’t really blame it on Electron.

try this recastjs compiled with emscripten 1.38.48 by CedricGuillemet · Pull Request #7480 · BabylonJS/Babylon.js · GitHub or rollback to old version

Not sure what you want me to get from there. If there’s an updated recast.js somewhere, can you link it?

if you use preview version of recast from preview channel you got errors. Cedric update new version and published on github and i provide link on updated version. what is problem with your navmesh i don’t know but i think if everything worked before and now it stops then just try the new version or go back to the old one. Babylon.js/recast.js at 30809255a3ed924911803e232b0d3caf50d92b5e · BabylonJS/Babylon.js · GitHub

Downloaded that copy of recast, still OOM’d. :frowning:

Adding @Cedric the recast genius :slight_smile:

Hi @Joseph_DeStefano

I may have an idea! Your navmesh seems totaly flat. Can you please try to move 1 vertex upward so the bouding box will get volume on the up axis. Or add a small inaccessible cube. Anything that will grow the BBox on the up axis.
I guess I have a division by the height at some point, resulting in a NaN and wrong memory allocation.
This test will confirm my guess and can be a work around until I fix it :slight_smile:

2 Likes

I tried with a flat plane but didn’t get the issue and when I opened your mesh, I’ve seen it’s not flat either.
So, I tried to open your mesh with recast compiled for native. I didn’t get an OOM error but it took like 10 seconds to build the navmesh with default cell size (cs : 0.3, ch:0.2).
I’d recommand you to try with bigger cell size (like 1.0 or 2.0) and see if you get the error.

No crashes with cs 1 and ch 1 - thanks. I’ll toy around with this for awhile.

Sweet! You can display the debug mesh for what’s been computed. The ideal goal is to have the biggest cell size while maintaining the resulting mesh quality.
The smaller cell, the more memory it uses and the more time it takes to compute the navmesh.

Thanks. I’ll look into that. Can you link any better documentation? I had to console.log() the plugin object just to find the .computePath function.

Here’s some initial fiddling: https://youtu.be/4T1ivzZdOeI

1 Like

I guess you already found these pages :
https://doc.babylonjs.com/extensions/navigationmesh
https://doc.babylonjs.com/extensions/crowd

Yeah but even those pages don’t mention the computePath function. I’ll see what I can get accomplished, though.