p3recastnavigation

Description
p3recastnavigation is a project that exposes most of the commonly used features and functionalities of the Recastnavigation library (github.com/recastnavigation/recastnavigation) to the Panda3d engine as an extension module.

The code is available at (master branch):

https://github.com/consultit/p3recastnavigation.git

To build and install it, see INSTALL in the source code.
To start with it, see NOTES in doc folder
To start use it, see the basic, test1 and test2 examples (both python and c++) in the samples folder
Here is a short video test2

Features
p3recastnavigation derives its functionality from the comprehensive “RecastDemo” application, you find in the original site, which I highly recommend you to use to find out all the features of the libraries; also it adds some extensions and flexibility that can be useful in other applications such as:

  • managing multiple nav meshes
  • ability to set parameters as strings to facilitate the use of external configuration files, such as XML (data-driven)
  • possibility to define more area types and costs
  • possibility of throwing events (currently only move or steady events)
  • integrated possibility of using “kinematic” agents which fix the position on the surface of the geometry on which is built the navmesh
  • custom update callbacks
  • implementation of the TypedWritable api to write/read nav meshes and crowd agents in/from bam files

Limitations

  • p3recastnavigation exposes only some features of “recast” and “detour” (the most useful) and is not a porting of the core functionality of the libraries
  • the code doesn’t use multithreading
  • the code, at present, is not optimized
  • development and tests has been made only on Linux, so it is greatly appreciated testing on other platforms (there is not platform specific code inside the project). Currently, it is built as an extension module using the tool, slightly modified, P3DModuleBuilder (github.com/tobspr/P3DModuleBuilder.git) by tobspr
  • development and tests have been made using recent versions of panda3d (built from git source tree using makepanda)
  • bugs and errors: don’t hesitate to signal when you find one

I hope this module could help Panda3d programmers to integrate path finding functionalities offered by Recastnavigation, in their own code.

consultit

This is a much needed thing, unfortunately my building skills aren’t all that good.

Trying to build on Win 10 64 bit:

Creating directory C:\p3recastnavigation-git\scripts\..\win_amd64_py27
Executing command:  cmake C:/p3recastnavigation-git -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_EXECUTABLE:STRING=C:\Panda3D-1.10.0-x64\python\ppython.exe -DPROJECT_NAME:STRING=p3recastnavigation -DINTERROGATE_LIB:STRING=libp3interrogatedb -GVisual Studio 10 2010 Win64 -DPYTHONVER:STRING=27 -DIGATE_VERBOSE=0 -DOPTIMIZE=1

Process output:
-- Found Windows SDK v7.1: C:\Program Files\Microsoft SDKs\Windows\v7.1\
-- Configuring done
-- Generating done
-- Build files have been written to: C:/p3recastnavigation-git/win_amd64_py27

Executing command:  cmake --build . --config RelWithDebInfo -- /m

Process error:
Microsoft (R) Build Engine version 4.6.1038.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/8/2016 14:57:27.
     1>Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" on node 1 (default targets).
     1>Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (1) is building "C:\p3recastnavigation-git\win_amd64_py27\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
     2>InitializeBuildStatus:
         Creating "x64\RelWithDebInfo\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified.
       CustomBuild:
         All outputs are up-to-date.
       FinalizeBuildStatus:
         Deleting file "x64\RelWithDebInfo\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild".
         Touching "x64\RelWithDebInfo\ZERO_CHECK\ZERO_CHECK.lastbuildstate".
     2>Done Building Project "C:\p3recastnavigation-git\win_amd64_py27\ZERO_CHECK.vcxproj" (default targets).
     1>Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (1) is building "C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj" (3) on node 2 (default targets).
     3>InitializeBuildStatus:
         Touching "p3recastnavigation.dir\RelWithDebInfo\p3recastnavigation.unsuccessfulbuild".
       CustomBuild:
         All outputs are up-to-date.
       ClCompile:
         c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Panda3D-1.10.0-x64\include" /I"C:\Panda3D-1.10.0-x64\python\include" /I"C:\p3recastnavigation-git\source" /I"C:\p3recastnavigation-git\source\library" /I"C:\p3recastnavigation-git\source\support" /Zi /nologo /W3 /WX- /MP /O2 /D WIN32 /D _WINDOWS /D WIN64_VC /D WIN64 /D RN_DEBUG /D WIN32_VC /D WIN32 /D _HAS_EXCEPTIONS=0 /D PB_MODULE=p3recastnavigation /D PB_CFG_MODULE=p3recastnavigation /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D p3recastnavigation_EXPORTS /D _WINDLL /D _MBCS /Gm- /EHsc /RTCs /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR- /Fo"p3recastnavigation.dir\RelWithDebInfo\\" /Fd"p3recastnavigation.dir\RelWithDebInfo\vcWindows7.1SDK.pdb" /Gd /TP /wd4996 /wd4275 /wd4267 /wd4101 /wd4273 /errorReport:queue ..\source\interrogate_module.cpp ..\source\interrogate_wrapper.cpp ..\source\config_module.cxx ..\source\recastnavigation_composite1.cxx ..\source\recastnavigation_composite2.cxx ..\source\recastnavigation_composite3.cxx ..\source\recastnavigation_composite4.cxx ..\source\rnCrowdAgent.cxx ..\source\rnNavMesh.cxx ..\source\rnNavMeshManager.cxx ..\source\rnTools.cxx  /favor:blend /bigobj /Zm300 /GM-
     3>cl : Command line error D8016: '/O2' and '/RTCs' command-line options are incompatible [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>Done Building Project "C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj" (default targets) -- FAILED.
     1>Done Building Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (default targets) -- FAILED.

Build FAILED.

       "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (default target) (1) ->
       "C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj" (default target) (3) ->
       (ClCompile target) ->
         cl : Command line error D8016: '/O2' and '/RTCs' command-line options are incompatible [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.51



[!] FATAL ERROR: Subprocess returned no-zero statuscode!

as I said P3DModuleBuilder is used to build, with a minor change (i.e. to prevent “interrogate” and the compiler to visit the subdirectories of the folder “source”). But the error does not seem due to this, rather to the compiler flags: try to compile with a different level of optimization in config.ini:

optimize=2/3/4

and re-execute

pyhton build --clean

If the error persists, it will be necessary to ask the author of the build tool (tobspr) if the changes I made to are responsible or if it is another type of error.

No luck so far :cry:
“optimize=2” gave me some other output … but it’s to long to post here, so here’s a link to a gist:
gist.github.com/wezu/03b7c169af … ff2ddea5b5

yes too much errors and warnings, but please note that p3recastnavigation has been developed using recent version of panda3d (built from git source) with c++11 support and uses several c++11 features. So you could check your compiler compatibility.
Unfortunately I don’t know the windows build environments, and at this point, any help from a expert would be appreciated.

I am using a version of p3d build from git today, but all I know about building it is how to type ‘makepanda\makepanda.bat --everything --installer --no-eigen’.

After some research on google I found out that some warnings/errors are due to the peculiar interpretation of the standard by msvc. In any case I committed some changes, and you can try to build now.
Let me know

This time I only got 11 Warnings and 142 Errors :mrgreen:
log: gist.github.com/wezu/806f55ad4f … 8c7267587f

It’d be nice if someone else would also try to build it on windows, my systems are known to be cursed and just because it fails on my end it doesn’t mean it’s broken. There are numerous things that refuse to work on my PC for no apparent reason. It’s uncanny but not unexpected.

I made some more modifications and removed c++11 features.
Now it should build with much less errors (I hope).

I’m down to 13 Warnings and 3 Errors, log: gist.github.com/wezu/a1c52fb268 … 5272248b4c

Committed changes to prevent errors. The warnings are due precisely to recastnavigation library so unavoidable.
Now it should compile with even fewer errors.

1 Error:

C:\p3recastnavigation-git>ppython build.py --clean
Cleaning up output directory ..
Creating directory C:\p3recastnavigation-git\scripts\..\win_amd64_py27
Executing command:  cmake C:/p3recastnavigation-git -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_EXECUTABLE:STRING=C:\Panda3D-1.10.0-x64\python\ppython.exe -DPROJECT_NAME:STRING=p3recastnavigation -DINTERROGATE_LIB:STRING=libp3interrogatedb -GVisual Studio 10 2010 Win64 -DPYTHONVER:STRING=27 -DIGATE_VERBOSE=0 -DOPTIMIZE=2

Process output:
-- Found Windows SDK v7.1: C:\Program Files\Microsoft SDKs\Windows\v7.1\
-- The C compiler identification is MSVC 16.0.40219.1
-- The CXX compiler identification is MSVC 16.0.40219.1
-- Check for working C compiler using: Visual Studio 10 2010 Win64
-- Check for working C compiler using: Visual Studio 10 2010 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10 2010 Win64
-- Check for working CXX compiler using: Visual Studio 10 2010 Win64 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/p3recastnavigation-git/win_amd64_py27

Executing command:  cmake --build . --config RelWithDebInfo -- /m

Process error:
Microsoft (R) Build Engine version 4.6.1038.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/11/2016 17:58:50.
     1>Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" on node 1 (default targets).
     1>Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (1) is building "C:\p3recastnavigation-git\win_amd64_py27\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
     2>PrepareForBuild:
         Creating directory "x64\RelWithDebInfo\ZERO_CHECK\".
       InitializeBuildStatus:
         Creating "x64\RelWithDebInfo\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified.
       CustomBuild:
         Checking Build System
         CMake does not need to re-run because C:/p3recastnavigation-git/win_amd64_py27/CMakeFiles/generate.stamp is up-to-date.
       FinalizeBuildStatus:
         Deleting file "x64\RelWithDebInfo\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild".
         Touching "x64\RelWithDebInfo\ZERO_CHECK\ZERO_CHECK.lastbuildstate".
     2>Done Building Project "C:\p3recastnavigation-git\win_amd64_py27\ZERO_CHECK.vcxproj" (default targets).
     1>Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (1) is building "C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj" (3) on node 2 (default targets).
     3>PrepareForBuild:
         Creating directory "p3recastnavigation.dir\RelWithDebInfo\".
         Creating directory "C:\p3recastnavigation-git\win_amd64_py27\RelWithDebInfo\".
       InitializeBuildStatus:
         Creating "p3recastnavigation.dir\RelWithDebInfo\p3recastnavigation.unsuccessfulbuild" because "AlwaysCreate" was specified.
       CustomBuild:
         Building Custom Rule C:/p3recastnavigation-git/CMakeLists.txt
         CMake does not need to re-run because C:\p3recastnavigation-git\win_amd64_py27\CMakeFiles\generate.stamp is up-to-date.
       ClCompile:
         c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Panda3D-1.10.0-x64\include" /I"C:\Panda3D-1.10.0-x64\python\include" /I"C:\p3recastnavigation-git\source" /I"C:\p3recastnavigation-git\source\library" /I"C:\p3recastnavigation-git\source\support" /Zi /nologo /W3 /WX- /MP /O2 /D WIN32 /D _WINDOWS /D WIN64_VC /D WIN64 /D RN_DEBUG /D WIN32_VC /D WIN32 /D _HAS_EXCEPTIONS=0 /D PB_MODULE=p3recastnavigation /D PB_CFG_MODULE=p3recastnavigation /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D p3recastnavigation_EXPORTS /D _WINDLL /D _MBCS /Gm- /EHsc /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR- /Fo"p3recastnavigation.dir\RelWithDebInfo\\" /Fd"p3recastnavigation.dir\RelWithDebInfo\vcWindows7.1SDK.pdb" /Gd /TP /wd4996 /wd4275 /wd4267 /wd4101 /wd4273 /errorReport:queue ..\source\interrogate_module.cpp ..\source\interrogate_wrapper.cpp ..\source\config_module.cxx ..\source\recastnavigation_composite1.cxx ..\source\recastnavigation_composite2.cxx ..\source\recastnavigation_composite3.cxx ..\source\recastnavigation_composite4.cxx ..\source\rnCrowdAgent.cxx ..\source\rnNavMesh.cxx ..\source\rnNavMeshManager.cxx ..\source\rnTools.cxx  /favor:blend /bigobj /Zm300 /GM-
     3>cl : Command line warning D9002: ignoring unknown option '/GM' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>cl : Command line warning D9002: ignoring unknown option '/G-' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>cl : Command line warning D9002: ignoring unknown option '/GM' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>cl : Command line warning D9002: ignoring unknown option '/G-' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         interrogate_module.cpp
     3>cl : Command line warning D9002: ignoring unknown option '/GM' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>cl : Command line warning D9002: ignoring unknown option '/G-' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         interrogate_wrapper.cpp
         config_module.cxx
         recastnavigation_composite1.cxx
     3>c:\p3recastnavigation-git\source\library/DetourNavMeshQuery.cpp(713): warning C4351: new behavior: elements of array 'dtFindNearestPolyQuery::m_nearestPoint' will be default initialized [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>c:\p3recastnavigation-git\source\library/Recast.cpp(89): warning C4351: new behavior: elements of array 'rcHeightfield::bmin' will be default initialized [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>c:\p3recastnavigation-git\source\library/Recast.cpp(89): warning C4351: new behavior: elements of array 'rcHeightfield::bmax' will be default initialized [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         recastnavigation_composite2.cxx
         recastnavigation_composite3.cxx
         recastnavigation_composite4.cxx
         rnCrowdAgent.cxx
     3>c:\p3recastnavigation-git\source\support/DebugInterfaces.cpp(486): warning C4541: 'dynamic_cast' used on polymorphic type 'std::basic_ostream<_Elem,_Traits>' with /GR-; unpredictable behavior may result [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
                 with
                 [
                     _Elem=char,
                     _Traits=std::char_traits<char>
                 ]
     3>c:\p3recastnavigation-git\source\support\debuginterfaces.cpp(549): warning C4700: uninitialized local variable 'i' used [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         rnNavMesh.cxx
         rnNavMeshManager.cxx
     3>c:\p3recastnavigation-git\source\rnnavmesh.cxx(488): warning C4700: uninitialized local variable 'i' used [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         rnTools.cxx
     3>..\source\rnTools.cxx(194): warning C4800: 'PN_stdfloat' : forcing value to bool 'true' or 'false' (performance warning) [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
       ManifestResourceCompile:
         C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\rc.exe /nologo /fo"p3recastnavigation.dir\RelWithDebInfo\p3recastnavigation.dll.embed.manifest.res" p3recastnavigation.dir\RelWithDebInfo\p3recastnavigation_manifest.rc
       Link:
         c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\p3recastnavigation-git\win_amd64_py27\RelWithDebInfo\p3recastnavigation.dll" /INCREMENTAL /NOLOGO /LIBPATH:"C:/Panda3D-1.10.0-x64/lib" /LIBPATH:"C:/Panda3D-1.10.0-x64/lib/RelWithDebInfo" kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib "C:\Panda3D-1.10.0-x64\python\libs\python27.lib" libp3framework.lib libpanda.lib libpandaexpress.lib libp3dtool.lib libp3dtoolconfig.lib libp3direct.lib libp3interrogatedb.lib /MANIFEST /ManifestFile:"p3recastnavigation.dir\RelWithDebInfo\p3recastnavigation.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:/p3recastnavigation-git/win_amd64_py27/RelWithDebInfo/p3recastnavigation.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/p3recastnavigation-git/win_amd64_py27/RelWithDebInfo/p3recastnavigation.lib" /MACHINE:X64 /DLL p3recastnavigation.dir\RelWithDebInfo\p3recastnavigation.dll.embed.manifest.res
         p3recastnavigation.dir\RelWithDebInfo\interrogate_module.obj
         p3recastnavigation.dir\RelWithDebInfo\interrogate_wrapper.obj
         p3recastnavigation.dir\RelWithDebInfo\config_module.obj
         p3recastnavigation.dir\RelWithDebInfo\recastnavigation_composite1.obj
         p3recastnavigation.dir\RelWithDebInfo\recastnavigation_composite2.obj
         p3recastnavigation.dir\RelWithDebInfo\recastnavigation_composite3.obj
         p3recastnavigation.dir\RelWithDebInfo\recastnavigation_composite4.obj
         p3recastnavigation.dir\RelWithDebInfo\rnCrowdAgent.obj
         p3recastnavigation.dir\RelWithDebInfo\rnNavMesh.obj
         p3recastnavigation.dir\RelWithDebInfo\rnNavMeshManager.obj
         p3recastnavigation.dir\RelWithDebInfo\rnTools.obj  /machine:x64 /debug
     3>LINK : fatal error LNK1104: cannot open file 'python27_d.lib' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
     3>Done Building Project "C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj" (default targets) -- FAILED.
     1>Done Building Project "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (default targets) -- FAILED.

Build FAILED.

       "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (default target) (1) ->
       "C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj" (default target) (3) ->
       (ClCompile target) ->
         cl : Command line warning D9002: ignoring unknown option '/GM' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         cl : Command line warning D9002: ignoring unknown option '/G-' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         cl : Command line warning D9002: ignoring unknown option '/GM' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         cl : Command line warning D9002: ignoring unknown option '/G-' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         cl : Command line warning D9002: ignoring unknown option '/GM' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         cl : Command line warning D9002: ignoring unknown option '/G-' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         c:\p3recastnavigation-git\source\library/DetourNavMeshQuery.cpp(713): warning C4351: new behavior: elements of array 'dtFindNearestPolyQuery::m_nearestPoint' will be default initialized [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         c:\p3recastnavigation-git\source\library/Recast.cpp(89): warning C4351: new behavior: elements of array 'rcHeightfield::bmin' will be default initialized [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         c:\p3recastnavigation-git\source\library/Recast.cpp(89): warning C4351: new behavior: elements of array 'rcHeightfield::bmax' will be default initialized [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         c:\p3recastnavigation-git\source\support/DebugInterfaces.cpp(486): warning C4541: 'dynamic_cast' used on polymorphic type 'std::basic_ostream<_Elem,_Traits>' with /GR-; unpredictable behavior may result [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         c:\p3recastnavigation-git\source\support\debuginterfaces.cpp(549): warning C4700: uninitialized local variable 'i' used [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         c:\p3recastnavigation-git\source\rnnavmesh.cxx(488): warning C4700: uninitialized local variable 'i' used [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]
         ..\source\rnTools.cxx(194): warning C4800: 'PN_stdfloat' : forcing value to bool 'true' or 'false' (performance warning) [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]


       "C:\p3recastnavigation-git\win_amd64_py27\ALL_BUILD.vcxproj" (default target) (1) ->
       "C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj" (default target) (3) ->
       (Link target) ->
         LINK : fatal error LNK1104: cannot open file 'python27_d.lib' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]

    13 Warning(s)
    1 Error(s)

Time Elapsed 00:01:40.25



[!] FATAL ERROR: Subprocess returned no-zero statuscode!

Ok there are two pieces of news: the good news is that the code compiles correctly now (aside warnings of the library and of the compiler itself complaining for several unknown options), and that makes me happy; the bad news is that the link with python libraries:

LINK : fatal error LNK1104: cannot open file 'python27_d.lib' [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]

does not work.
python27_d.lib should be the python debug version, and probably you do not have it installed, but only the release version (without _d). The problem is that the choice of the type of library (debug / release) is made by cmake that is used by P3DModuleBuilder tool.
I think that now you can try “optimize” 3 or 4 (without debugging) and see if it is selected python27.lib, and for case 1 or 2 (with debugging) you should find out how to install python27_d.lib.

Optimize 3 gives some new error

c:\p3recastnavigation-git\source\rnnavmesh.cxx(1776): error C4716: 'RNNavMesh::toggle_debug_drawing' : must return a value [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]

Optimize 4 complains abut something else:

interrogate_wrapper.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned __int64 const `public: static unsigned __int64 __cdecl MemoryHook::get_header_reserved_bytes(void)'::`2'::header_reserved_bytes" (__imp_?header_reserved_bytes@?1??get_header_reserved_bytes@MemoryHook@@SA_KXZ@4_KB) [C:\p3recastnavigation-git\win_amd64_py27\p3recastnavigation.vcxproj]

The first error is related to p3recastnavigation and I committed a change to correct it.
Unfortunately the second one is due to a symbol that is not found in a Panda3D library in windows , so it should be investigated further (in this case I’d be of little help).
In any case if you want to enable debug drawing also with optimize 3/4 you can change the CMakeLists.txt file by replacing the section

  elseif(OPTIMIZE STREQUAL "3")
    add_definitions("/MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast")
  elseif(OPTIMIZE STREQUAL "4")
    add_definitions("/MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL /LTCG")
    add_definitions("/Oy /Zp16")

with this

  elseif(OPTIMIZE STREQUAL "3")
    add_definitions("/MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast /DRN_DEBUG")
  elseif(OPTIMIZE STREQUAL "4")
    add_definitions("/MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL /LTCG /DRN_DEBUG")
    add_definitions("/Oy /Zp16")

I’m sorry if I’m a pain in the arse.

I got it to compile (well You got it to compile, I just did what you wrote), but I can’t get the sample to work, it crashes python.

PS C:\p3recastnavigation-git\samples\python> ppython main.py
Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
RNNavMeshManager::RNNavMeshManager: creating the singleton manager.

Default creation parameters:

RNNavMesh creation parameters:
        agent_height = 2.0
        agent_max_climb = 0.9
        agent_max_slope = 45.0
        agent_radius = 0.6
        area_flags_cost = 0@0x01@1.0
        build_all_tiles = false
        cell_height = 0.2
        cell_size = 0.3
        crowd_exclude_flags = 0x10
        crowd_include_flags = 0xffef
        detail_sample_dist = 6.0
        detail_sample_max_error = 1.0
        edge_max_error = 1.3
        edge_max_len = 12.0
        max_polys_per_tile = 32768
        max_tiles = 128
        navmesh_type = solo
        partition_type = watershed
        region_merge_size = 20
        region_min_size = 8
        tile_size = 32
        verts_per_poly = 6.0

RNCrowdAgent creation parameters:
        add_to_navmesh =
        collision_query_range = 12.0
        max_acceleration = 8.0
        max_speed = 3.5
        mov_type = recast
        move_target = 0.0,0.0,0.0
        move_velocity = 0.0,0.0,0.0
        obstacle_avoidance_type = 3
        path_optimization_range = 30.0
        ray_mask = all_on
        separation_weight = 2.0
        update_flags = 0x1b

Current creation parameters:

RNNavMesh creation parameters:
        agent_height = 2.0
        agent_max_climb = 2.5
        agent_max_slope = 45.0
        agent_radius = 0.6
        area_flags_cost = 0@0x01@1.0
        build_all_tiles = true
        cell_height = 0.2
        cell_size = 0.3
        convex_volume = -15.2,-22.9,-2.4:-13.4,-22.6,-2.4:-13.1,-26.5,-2.4:-16.4,-26.4,-2.7@1
        crowd_exclude_flags = 0x10
        crowd_include_flags = 0xffef
        detail_sample_dist = 6.0
        detail_sample_max_error = 1.0
        edge_max_error = 1.3
        edge_max_len = 12.0
        max_polys_per_tile = 32768
        max_tiles = 128
        navmesh_type = obstacle
        offmesh_connection = 31.6,24.5,-2.0:20.2,9.4,-2.4@true
        partition_type = watershed
        region_merge_size = 20
        region_min_size = 8
        tile_size = 32
        verts_per_poly = 6.0

RNCrowdAgent creation parameters:
        add_to_navmesh =
        collision_query_range = 12.0
        max_acceleration = 8.0
        max_speed = 3.5
        mov_type = recast
        move_target = 0.0,0.0,0.0
        move_velocity = 0.0,0.0,0.0
        obstacle_avoidance_type = 3
        path_optimization_range = 30.0
        ray_mask = all_on
        separation_weight = 2.0
        thrown_events = move@move-event@0.5
        update_flags = 0x1b
RNNavMesh::setup
        GeomNodes number: 2
         Geoms number: 1
           Vertices number: 2640 - Start index: 0
          Primitives number: 1
        ---
           Primitive type: GeomTriangles - number: 996
           Decomposed Primitive type: GeomTriangles - number: 996
         Geoms number: 1
           Vertices number: 1295 - Start index: 2640
          Primitives number: 1
        ---
           Primitive type: GeomTriangles - number: 616
           Decomposed Primitive type: GeomTriangles - number: 616
navmeshMemUsage = 55.7 kBBuild log nav_test.egg:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
AL lib: (EE) alc_cleanup: 1 device not closed

This is strange: it seems related to audio library (for example see stackoverflow.com/questions/1616 … losed-mean).
But sample code does not use absolutely audio (obviously).
Look at panda3d.org/manual/index.ph … _Variables to see if you can disable audio; may
be “audio-active 0”.
Let me know.

P.S.:Your cooperation has been invaluable to make this application more portable :wink:

I don’t think it’s audio related, it crashes python (“python has stopped working”), I have to kill the window and Open AL complains about that. I put in loadPrcFileData("", “audio-library-name null”) and the open al error is gone… but the program hangs just as it did.

Ok, could you use a debugger and going step by step, inside the various functions too. And report me where it exit?
From the output the nav mesh should be correctly set-up: this is good.
Now I’m busy, but later I can write a simpler example so you can test essential steps to see if the api is ok, even without a debugger

I committed a small program “test.py” in samples to test the essential functions of the module.
Also every time you change config.ini P3DModuleBuilder requires to execute

python build --clean

(in doubt you should always run it)
Now try running the test.