Game Development Community

Recast Informational Post

by Dale E. La Force · in Torque 3D Professional · 06/19/2013 (8:50 am) · 8 replies

I have seen posts in the forums of people stating that the Recast navMesh was only being generated for
half of the terrain. I ran across this recently, after creating a testbed level for bug fixes and feature
enhancements. After adding the Recast resource, I noticed that only half of the navMesh was being
generated for the terrain block. I spent two evenings combing the Recast code to see if something
might being causing the issue. It is NOT anything in the Recast code! I narrowed it down to the
heightmap generated terrain block. Non heightmap terrain blocks work just fine ( at least the ones
I have checked it with thus far). Before digging into the Torque terrain code, I decide to do one more
test. I changed the block size from 1 to 2 whilst leaving the navMesh bounds unchanged. I then
clicked build for the navMesh and this time the navMesh was fully generated within the navMesh
bounds. Hopefully this info will be helpful in finding why the navMesh is only generating for half of
the terrain block with heightmap generated terrains.As well, this info may help those having issue
to decide to use Non heightmap terrains or dig into the terrain code too, and see if it can be resolved
or a suitable work around developed.

#1
06/19/2013 (3:24 pm)
Oh, that is bizarre. Thanks for the detective work. I'm not an expert on the terrain system so I'll have to do some digging. I've started to redo the recast resource for submission to the steering committee, so I'll have to look into this soon.
#2
07/24/2013 (5:36 pm)
Does anyone want to try out the new navmesh code in the development branch with a large terrain?
#3
07/24/2013 (8:31 pm)
Has the NavMesh procedure changed? I noticed no build box
in the inspector pane nor any code in persistent fields
in the cpp file as with the previous version. This is from
the development branch code.May have overlooked something, as
only had a short time to look over things. Thanks.
#4
07/24/2013 (8:39 pm)
Yep for now you have to build from the console by calling NavMeshName.build()
#5
07/24/2013 (9:45 pm)
Thank you.
#6
07/24/2013 (10:03 pm)
Just performed a quick test with heightmap terrain and all is well.
Any idea what I missed when I looked at it recast before? Thanks for your time and effort.
#7
07/24/2013 (10:10 pm)
Nope, no idea, but this new code uses a different method of gathering collision information and building the navmesh. You'll notice it creates the mesh in a square grid rather than stretching long triangles everywhere.
#8
07/24/2013 (10:19 pm)
Yes, noticed that right off. Tad slower on build, but ever more
tighter and best of all covers the entire terrain mesh...lol
I also like the larger size on the intial box too.
Thanks again!