Giter VIP home page Giter VIP logo

libpandadna's Introduction

libpandadna

libpandadna is a library made for Panda3D that creates a common format for storing entire 3D worlds containing many groups, models, and textures in a tree-like form. It also handles some logical aspects of games, such as creating groups of models, textures, and nodes that can be hidden or shown on the fly, and enemy pathing.

NOTE - This project is inspired, and based off of Disney's DNA file format created for the now-closed MMORPG - Toontown Online, and therefore will be geared towards supporting it.

Usage

In order for the parser to understand a raw DNA file, the DNA file must first be converted into a small, easily readable and understandable binary format. This is to more or less what Panda3D does with their bam model files, and is done to speed up the process of reading and processing the files. Raw DNA files have a dna extension, and binary DNA files have a pdna extension. This is, of course, for convenience. The extensions can be changed to whatever is desired.

To convert a raw DNA file to binary format, the compiler utility included with this project can be used.

Features

  • compiler utility converts raw DNA files into a small, easily readable and understandable binary format.
  • pdna compression.
  • pdna reader written in C++ extended for use in Python and Panda3D.
  • Logical aspects, such as visible groups and enemy pathing.

The Team

The main people behind libpandadna are listed below:

  • loblao - The lead developer of the project, and coordinator who writes most of the graphical parts of the project.
  • xPythonic - Keeps the project clean, and writes most of the logical/lexical parts of the project.

Contributing

We welcome all potential contributors.

libpandadna's People

Contributors

alexanderr avatar darthmdev avatar denialmc avatar dissonancepm avatar jwcotejr avatar loblao avatar mfwass avatar xpythonic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libpandadna's Issues

undefined symbol on Ubuntu 14.04

TTLocalizer: Running in language: English
OTPLocalizer: Running in language: English
:AstronInternalRepository: Using connect method 'http'
DCFile::read of dependencies/astron/dclass/toontown.dc
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/root/git/server/toontown/uberdog/ServiceStart.py", line 55, in <module>
    config.GetInt('air-stateserver', 4002))
  File "toontown/uberdog/ToontownUberRepository.py", line 15, in __init__
    ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')
  File "toontown/distributed/ToontownInternalRepository.py", line 17, in __init__
    dcSuffix=dcSuffix, connectMethod=connectMethod, threadedNet=threadedNet)
  File "/usr/share/panda3d/direct/distributed/AstronInternalRepository.py", line 139, in __init__
    self.readDCFile(dcFileNames)
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 311, in readDCFile
    self.importModule(dcImports, moduleName, importSymbols)
  File "/usr/share/panda3d/direct/distributed/ConnectionRepository.py", line 408, in importModule
    module = __import__(moduleName, globals(), locals(), importSymbols)
  File "toontown/suit/DistributedSuitPlannerAI.py", line 6, in <module>
    import DistributedSuitAI
  File "toontown/suit/DistributedSuitAI.py", line 7, in <module>
    import SuitPlannerBase
  File "toontown/suit/SuitPlannerBase.py", line 6, in <module>
    from toontown.dna.DNAParser import *
  File "toontown/dna/DNAParser.py", line 3, in <module>
    from libpandadna import *
ImportError: ./libpandadna.so: undefined symbol: _ZN14PointerToArrayIhEaSEOS0_
Warning: pandac.PandaModules is deprecated, import from panda3d.core instead

I don't know whats going on to be honest with you. I had an issue earlier where it said libstdc++.so.6: version GLIBCXX_3.4.20 not found. Fixed that but now i can't even get it to load past that.

Building libpandadna fails with latest panda3d on windows 11

Build started...
1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>Checking Build System
2>------ Build started: Project: libpandadna, Configuration: Release x64 ------
2>Interrogate
2>/d/Github/TTG/Galaxy/dependencies/panda/include/DNAStorage.h(94,68): error G7418736E: syntax error, unexpected IDENTIFIER, expecting ')'
2>  PT(DNASuitPoint) store_suit_point(DNASuitPoint::DNASuitPointType type, LPoint3f pos);
2>                                                                   ^~~~
2>Error parsing file: 'SuitLegList.h'
2>Interrogating base
2>Interrogating suit
2>
2>The following command return a non-zero value (1): D:\Github\TTG\Galaxy\dependencies\panda\bin\interrogate -D__inline -DCPPPARSER -DP3_INTERROGATE=1 -D__cplusplus -fnames -string -refcount -assert -S"D:\Github\TTG\Galaxy\dependencies\panda/include/parser-inc" -S"D:\Github\TTG\Galaxy\dependencies\panda/include" -I"D:\Github\TTG\Galaxy\dependencies\panda/include" -I"D:\Github\TTG\libpandadna\src/base" -I"D:\Github\TTG\libpandadna\src/suit" -I"D:\Github\TTG\libpandadna\src/components" -srcdir "D:\Github\TTG\libpandadna\src/suit" -oc "D:\Github\TTG\libpandadna\src/suit_igate.cxx" -od "D:\Github\TTG\libpandadna\src/suit.in" -python-native -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D_X86_ -DWIN32_VC -DWIN32 -module libpandadna -library suit -Dvolatile= DNASuitEdge.h DNASuitPath.h DNASuitPoint.h SuitLeg.h SuitLegList.h
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: The command "setlocal
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: D:\Github\TTG\Galaxy\dependencies\panda\python\python.exe D:/Github/TTG/libpandadna/src/run_interrogate.py D:/Github/TTG/Galaxy/dependencies/panda
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: :cmEnd
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: :cmErrorLevel
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: exit /b %1
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: :cmDone
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
2>H:\Developer-tools\Visual Studio\2022\professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3073: :VCEnd" exited with code 1.
2>Done building project "libpandadna.vcxproj" -- FAILED.
3>------ Skipped Build: Project: ALL_BUILD, Configuration: Release x64 ------
3>Project not selected to build for this solution configuration 
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========

[cxx-parser] getSuitPath always fails on Sellbot Factory exterior, Cashbot and Lawbot HQ files.

When reading the original TTO DNA files for the three locations (zones: 11200, 12000, 13000), assigned SuitPlanners appears to be failing to spawn any cogs in those areas, with them printing out a "Couldn't get a destination" message when notify level for it is set to debug, leaving the player with empty areas.

This issue may have something to do with the recent rewrite that occured in bdcccd6, because when set to debug, the function results in an spam of "path is too short", or "path not found" messages.

(OSX) Unable to find library while interrogating

When interrogation starts after building the files, this is what happens.

Linking CXX shared library liblibpandadna.dylib
Interrogate
/Developer/Panda3D
/Users/username/libpandadna/src
Interrogating base
dyld: Library not loaded: libp3dtool.1.9.dylib
Referenced from: /Developer/Panda3D/bin/interrogate
Reason: image not found
src/run_interrogate: line 12: 1736 Trace/BPT trap: 5 $PANDA_DIR/bin/interrogate -D__inline -DCPPPARSER -DP3_INTERROGATE=1 -D__cplusplus -fnames -string -refcount -assert -S $PANDA_DIR/include/parser-inc -S $PANDA_DIR/include -I $PANDA_DIR/include -I$SRC_DIR/suit -I$SRC_DIR/base -I$SRC_DIR/components -srcdir $SRC_DIR/$MODULE -oc $SRC_DIR/base_igate.cxx -od $SRC_DIR/$MODULE.in -python-native -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -longlong int64 -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32 -module libpandadna -library $MODULE -Dvolatile= DNAStorage.h DNALoader.h
Interrogating suit
dyld: Library not loaded: libp3dtool.1.9.dylib
Referenced from: /Developer/Panda3D/bin/interrogate
Reason: image not found
src/run_interrogate: line 18: 1737 Trace/BPT trap: 5 $PANDA_DIR/bin/interrogate -D__inline -DCPPPARSER -DP3_INTERROGATE=1 -D__cplusplus -fnames -string -refcount -assert -S $PANDA_DIR/include/parser-inc -S $PANDA_DIR/include -I $PANDA_DIR/include -I$SRC_DIR/suit -I$SRC_DIR/base -I$SRC_DIR/components -srcdir $SRC_DIR/$MODULE -oc $SRC_DIR/suit_igate.cxx -od $SRC_DIR/$MODULE.in -python-native -DCPPPARSER -D__STDC
=1 -D__cplusplus -D__inline -longlong int64 -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32 -module libpandadna -library $MODULE -Dvolatile= DNASuitPoint.h DNASuitPath.h DNASuitEdge.h SuitLeg.h SuitLegList.h
Interrogating components
dyld: Library not loaded: libp3dtool.1.9.dylib
Referenced from: /Developer/Panda3D/bin/interrogate
Reason: image not found
src/run_interrogate: line 24: 1738 Trace/BPT trap: 5 $PANDA_DIR/bin/interrogate -D__inline -DCPPPARSER -DP3_INTERROGATE=1 -D__cplusplus -fnames -string -refcount -assert -S $PANDA_DIR/include/parser-inc -S $PANDA_DIR/include -I $PANDA_DIR/include -I$SRC_DIR/suit -I$SRC_DIR/base -I$SRC_DIR/components -srcdir $SRC_DIR/$MODULE -oc $SRC_DIR/components_igate.cxx -od $SRC_DIR/$MODULE.in -python-native -DCPPPARSER -D__STDC
=1 -D__cplusplus -D__inline -longlong _int64 -D_X86 -DWIN32_VC -DWIN32 -D_WIN32 -module libpandadna -library $MODULE -Dvolatile= DNAGroup.h DNAVisGroup.h DNANode.h DNAProp.h DNASign.h DNASignBaseline.h DNASignGraphic.h DNAFlatBuilding.h DNAWall.h DNAWindows.h DNACornice.h DNALandmarkBuilding.h DNAAnimProp.h DNAInteractiveProp.h DNAAnimBuilding.h DNADoor.h DNAFlatDoor.h DNAStreet.h DNABattleCell.h
make[2]: *** [liblibpandadna.dylib] Error 133
make[1]: *** [CMakeFiles/libpandadna.dir/all] Error 2
make: *** [all] Error 2

Problems compiling libpandadna on Ubuntu 18.10 with Panda3D 1.10

Hello,

I am attempting to build libpandadna on Ubuntu 18.10 using Panda3D 1.10.

At first, I tried to just compile it using the usual cmake ., but I received the following output:

$ cmake .
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found version "3.6.7") 
-- Found PythonInterp: /usr/bin/python3.6 (found version "3.6.7") 
/bin/sh: 1: /stuff/tt/libpandadna/bin/interrogate: not found
Interrogating base

The following command return a non-zero value (127): /stuff/tt/libpandadna/bin/interrogate -D__inline -DCPPPARSER -DP3_INTERROGATE=1 -D__cplusplus -fnames -string -refcount -assert -S /stuff/tt/libpandadna/include/parser-inc -S /stuff/tt/libpandadna/include -I /stuff/tt/libpandadna/include -I/stuff/tt/libpandadna/src/base -I/stuff/tt/libpandadna/src/suit -I/stuff/tt/libpandadna/src/components -srcdir /stuff/tt/libpandadna/src/base -oc /stuff/tt/libpandadna/src/base_igate.cxx -od /stuff/tt/libpandadna/src/base.in -python-native -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -longlong __int64 -D_X86_ -DWIN32_VC -DWIN32 -module libpandadna -library base -Dvolatile= DNAStorage.h dnabase.h DNALoader.h config_dna.h
-- GCC Version: 8

-- libp3interrogatedb not found
-- libp3pandatoolbase not found
-- Configuring done
CMake Error at CMakeLists.txt:178 (add_library):
  Cannot find source file:

    src/base_igate.cxx

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx


CMake Error at CMakeLists.txt:178 (add_library):
  No SOURCES given to target: pandadna


-- Build files have been written to: /stuff/tt/libpandadna

First thing that I notice is that it is not correctly detecting where interrogate is installed. After making the following change,

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93e7c02..6152ce8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,9 @@ endif()
 if (WIN32)
     SET(PANDA_DIR "C:\\Panda3D-1.10.0" CACHE STRING "Panda3D directory.")
 endif()
+if (UNIX)
+    SET(PANDA_DIR "/usr" CACHE STRING "Panda3D directory.")
+endif (UNIX)
 SET(BUILD_STATIC_LIB OFF CACHE BOOL "If true, will build a static lib")
 execute_process(COMMAND ${PYTHON2_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/run_interrogate.py" "${PANDA_DIR}")

I get a different error:

$ cmake .
Warning: ignoring deprecated -longlong option.
/stuff/tt/libpandadna/src/base/config_dna.h:22:20: error: syntax error, unexpected IDENTIFIER, expecting ')'
NotifyCategoryDecl(dna, EXPCL_DNA, EXPTP_DNA);
                   ^~~
Error parsing file: 'DNAStorage.h'
Interrogating base

The following command return a non-zero value (1): /usr/bin/interrogate -D__inline -DCPPPARSER -DP3_INTERROGATE=1 -D__cplusplus -fnames -string -refcount -assert -S /usr/include/parser-inc -S /usr/include -I /usr/include -I/stuff/tt/libpandadna/src/base -I/stuff/tt/libpandadna/src/suit -I/stuff/tt/libpandadna/src/components -srcdir /stuff/tt/libpandadna/src/base -oc /stuff/tt/libpandadna/src/base_igate.cxx -od /stuff/tt/libpandadna/src/base.in -python-native -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -longlong __int64 -D_X86_ -DWIN32_VC -DWIN32 -module libpandadna -library base -Dvolatile= DNAStorage.h dnabase.h DNALoader.h config_dna.h
-- GCC Version: 8

-- libp3interrogatedb not found
-- libp3pandatoolbase not found
-- Configuring done
CMake Error at CMakeLists.txt:181 (add_library):
  Cannot find source file:

    src/base_igate.cxx

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx


CMake Error at CMakeLists.txt:181 (add_library):
  No SOURCES given to target: pandadna


-- Build files have been written to: /stuff/tt/libpandadna

Next, I opened up the makepanda script that is used to build Panda3D and inferred the following interrogate commands by recreating the commands executed from there:

interrogate -srcdir /stuff/tt/libpandadna/src/base -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L -D__attribute__\(x\)= -D_LP64 -oc /stuff/tt/libpandadna/src/base_igate.cxx -od /stuff/tt/libpandadna/src/base.in -fnames -string -refcount -assert -python-native -S/stuff/tt/panda3d/built/include/parser-inc -I/stuff/tt/libpandadna/src/base -S/stuff/tt/panda3d/built/tmp -S/stuff/tt/panda3d/built/include -S/usr/include/eigen3 -I../components -S../components -I../suit -S../suit -module libpandadna -library base DNAStorage.h dnabase.h DNALoader.h config_dna.h
interrogate -srcdir /stuff/tt/libpandadna/src/suit -oc /stuff/tt/libpandadna/src/suit_igate.cxx -od /stuff/tt/libpandadna/src/suit.in -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L -D__attribute__\(x\)= -D_LP64 -fnames -string -refcount -assert -python-native -S/stuff/tt/panda3d/built/include/parser-inc -I/stuff/tt/libpandadna/src/base -I/stuff/tt/libpandadna/src/suit -S/stuff/tt/panda3d/built/tmp -S/stuff/tt/panda3d/built/include -S/usr/include/eigen3 -I../components -module libpandadna -library suit -Dvolatile= DNASuitPoint.h DNASuitEdge.h SuitLeg.h SuitLegList.h DNASuitPath.h
interrogate -srcdir /stuff/tt/libpandadna/src/components -oc /stuff/tt/libpandadna/src/components_igate.cxx -od /stuff/tt/libpandadna/src/components.in -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L -D__attribute__\(x\)= -D_LP64 -fnames -string -refcount -assert -python-native -S/stuff/tt/panda3d/built/include/parser-inc -I/stuff/tt/libpandadna/src/base -I/stuff/tt/libpandadna/src/suit -I/stuff/tt/libpandadna/src/components -S/stuff/tt/panda3d/built/tmp -S/stuff/tt/panda3d/built/include -S/usr/include/eigen3 -I../components -module libpandadna -library suit -library components -Dvolatile= DNAInteractiveProp.h DNABattleCell.h DNAAnimProp.h DNANode.h DNAWall.h DNASign.h DNAStreet.h DNACornice.h DNAWindows.h DNAFlatDoor.h DNAFlatBuilding.h DNAVisGroup.h DNAAnimBuilding.h DNALandmarkBuilding.h DNAProp.h DNADoor.h DNAGroup.h DNASignGraphic.h DNASignBaseline.h

After executing each command in the appropriate folder src/base, src/suit and src/components, each completed successfully and created their respective output files:

$ ls
base            components            run_interrogate.py  suit.in
base_igate.cxx  components_igate.cxx  suit
base.in         components.in         suit_igate.cxx

Then I commented out the following 2 lines in run_interrogate.py in order to get the final interrogate_module command to run:

#for module in ('base', 'suit', 'components'):
#    interrogate(module)

After that, cmake . worked perfectly. Finally, I had to make a few other changes to the CMakeLists.txt to get it to see p3interrogatedb (I also had to get it to use Python 2, but that can be ignored):

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93e7c02..b44f121 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,16 +1,19 @@
 cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
 project(libpandadna)
 
-find_package(PythonLibs)
-if (NOT PYTHONLIBS_FOUND)
-    message(FATAL_ERROR "Python libs not found.")
-endif()
+set(PythonLibs_FIND_VERSION 2.7)
+set(PYTHONVERSION 2)
 
 find_package(PythonInterp)
 if(NOT PYTHONINTERP_FOUND)
     message(FATAL_ERROR "Python interpreter not found.")
 endif()
 
+find_package(PythonLibs 2)
+if (NOT PYTHONLIBS_FOUND)
+    message(FATAL_ERROR "Python libs not found.")
+endif()
+
 if(PYTHON_VERSION_MAJOR EQUAL 2)
     set(PYTHON2_EXECUTABLE "${PYTHON_EXECUTABLE}")
 else()
@@ -24,6 +27,9 @@ endif()
 if (WIN32)
     SET(PANDA_DIR "C:\\Panda3D-1.10.0" CACHE STRING "Panda3D directory.")
 endif()
+if (UNIX)
+    SET(PANDA_DIR "/usr" CACHE STRING "Panda3D directory.")
+endif (UNIX)
 SET(BUILD_STATIC_LIB OFF CACHE BOOL "If true, will build a static lib")
 execute_process(COMMAND ${PYTHON2_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/run_interrogate.py" "${PANDA_DIR}")
 
@@ -103,9 +109,11 @@ include_directories(src/base)
 include_directories(src/suit)
 include_directories(src/components)
 include_directories(${PANDA_DIR}/include)
+include_directories(${PANDA_DIR}/include/panda3d)
 include_directories(${PYTHON_INCLUDE_DIR})
 include_directories(/usr/include/eigen3)
 link_directories(${PANDA_DIR}/lib)
+link_directories(/usr/lib/x86_64-linux-gnu/panda3d)
 
 set(LIBPFX "")
 if(WIN32)
@@ -138,8 +146,9 @@ if (NOT BUILD_STATIC_LIB)
 
     # Add p3interrogatedb, if it exists
     find_library(HAVE_P3INTERROGATEDB
-                 ${LIBPFX}p3interrogatedb
-                 HINTS ${PANDA_DIR}/lib)
+	         ${LIBPFX}p3interrogatedb
+	         PATHS /usr/lib/x86_64-linux-gnu/panda3d
+	         HINTS ${PANDA_DIR}/lib) 
                  
     if (HAVE_P3INTERROGATEDB)
         message(STATUS "libp3interrogatedb found")
@@ -151,6 +160,7 @@ if (NOT BUILD_STATIC_LIB)
     # Add p3pandatoolbase, if it exists
     find_library(HAVE_P3PANDATOOLBASE
                  ${LIBPFX}p3pandatoolbase
+		 PATHS /usr/lib/x86_64-linux-gnu/panda3d
                  HINTS ${PANDA_DIR}/lib)
 
     if (HAVE_P3PANDATOOLBASE)

Finally after all these actions, I was able to build libpandadna and successfully ran the tests.

I am sure many of these things should be generalized, which is why I am not going to simply submit a pull request at this point.

For example, the linking part of the panda3d problems can possibly be solved by actually using the find_library output. I am not much of a CMake buff so some of this stuff is not "my thing".

I just want to share my experience in case it will help others.

Segfault 11 in nirai compiled game (macos 10.11)

I'm still not sure whether this is a Nirai or Libpandadna issue, but I'll post it here just to be safe:

When loading DNA files, my game (compiled with Nirai) will get a segmentation fault 11 and crash. I don't know what else to say about it, because I also don't know much about this type of error.

Can't use libpandadna with Nirai due to unresolved externals when calling init_libpandadna()

I posted this in the Nirai issues, but further investigation leads me to believe the problem is on libpandadna's end:
Linking libpandadna.lib from the Release directory in the project folder with a Nirai executable, then trying to call init_libpandadna() will result in a linker error:

error LNK2001: unresolved external symbol _init_libpandadna

Yet, a definition for this function is defined in config_dna.cxx and extern'd by config_dna.h.
In my code, I am also externing it with __declspec(dllexport):

extern "C" _declspec(dllexport) void init_libpandadna();

AI server crashing after recompiling DNA files

TTLocalizer: Running in language: english
from toontown.toonbase.TTLocalizerEnglish import *
OTPLocalizer: Running in language: english
from otp.otpbase.OTPLocalizerEnglish import *
DCFile::read of astron/dclass/otp.dc
DCFile::read of astron/dclass/toon.dc
:AstronInternalRepository: Now connecting to 127.0.0.1:7100...
:AstronInternalRepository: Connecting to gameserver directly (no proxy).
:AstronInternalRepository: Connecting to //127.0.0.1:7100 via HTTP interface.
:AstronInternalRepository: Successfully connected to //127.0.0.1:7100.
:AstronInternalRepository: Connected successfully.
:AstronInternalRepository: Creating ToontownDistrictAI(401000001)...
:AstronInternalRepository: Claiming ownership of channel ID: 401000001...
:AstronInternalRepository: Created ToontownDistrictStats(401000002)
:AstronInternalRepository: Creating managers...
:AstronInternalRepository: Creating safe zones...
:HoodAI: Creating objects... Toontown Central
:HoodAI: Creating objects... Toontown Central, Silly Street
Assertion failed: _current_index + sizeof(tempvar) <= _datagram->get_length() at
 line 203 of c:\users\toontowninfinite\desktop\github\panda3d\panda\src\express\
datagramIterator.I
Traceback (most recent call last):
  File "C:\Panda3D-1.9.0\direct\extensions_native\HTTPChannel_extensions.py", li
ne 36, in doTask
    task.callback(*task.callbackArgs)
  File "C:\Panda3D-1.9.0\direct\distributed\ConnectionRepository.py", line 563,
in httpConnectCallback
    successCallback(*successArgs)
  File "C:\Panda3D-1.9.0\direct\distributed\AstronInternalRepository.py", line 4
77, in __connected
    self.handleConnected()
  File "toontown\ai\ToontownAIRepository.py", line 191, in handleConnected
    self.createSafeZones()
  File "toontown\ai\ToontownAIRepository.py", line 138, in createSafeZones
    self.hoods.append(TTHoodAI.TTHoodAI(self))
  File "toontown\hood\TTHoodAI.py", line 17, in __init__
    ToontownGlobals.ToontownCentral)
  File "toontown\hood\HoodAI.py", line 35, in __init__
    dnaData = simbase.air.loadDNAFileAI(dnaStore, dnaFileName)
  File "toontown\ai\ToontownAIRepository.py", line 218, in loadDNAFileAI
    return loadDNAFileAI(dnastore, filename)
  File "toontown\dna\DNAParser.py", line 50, in loadDNAFileAI
    data = dnaLoader.loadDNAFileAI(dnaStorage, file)
  File "toontown\dna\DNALoader.py", line 268, in loadDNAFileAI
    self.__loadDNAFileBase(store, str(file))
  File "toontown\dna\DNALoader.py", line 253, in __loadDNAFileBase
    self.handleStorageData(dgi)
  File "toontown\dna\DNALoader.py", line 141, in handleStorageData
    endPoint = dgi.getUint16()

Linking static library with Nirai produces a LNK2001 error relating to NodePathCollection with VS2017.

Hey there,

I am trying to link a modified version of Nirai with libpandadna as a static library for a game, however, I get this error here.

libpandadna.lib(DNAFlatBuilding.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class NodePathCollection & __cdecl NodePathCollection::operator=(class NodePathCollection &&)" (__imp_??4NodePathCollection@@QEAAAEAV0@$$QEAV0@@Z)

This appears to happen because NodePathCollection is defined in DNAFlatBuilding, and it seems to be expecting the main Panda3D DLLs to contain the NodePathCollection symbol.

This does not make sense, because I am building statically.

I am using a modified version of Nirai to support VS2017. I also modified libpandadna a bit to work with static linking.

Can anyone help me fix the problem as soon as possible?

Thanks.

Cannot import libpandadna

I'm not sure if I've done something wrong, but I compiled libpandadna successfully for Python 3.8, but I still cannot import the .pyd file! I have it in my current directory and whenever I try:

from panda3d.core import *
import libpandadna

I always receive the same error.

ImportError: DLL load failed while importing libpandadna: The specified module could not be found.

Is there something special I have to do? Or is this just not working on Python 3 still?
I need to compile my .dna files for the Python PDNA loader I'm using, and I have one stubborn .dna file that converts but it fails to read past the check that looks for if it was compressed or not.. So was going to instead use libpandadna since it's a tad cleaner, however, I need a bit of help with this.

EDIT: Turns out it was all Interrogates fault, Visual Studio was supplied the wrong Python library, even though I explicitly set the Path with CMake, and changed some references. Even removed said other Python library, but it still found it. Ended up having to edit the VCXPROJ file, manually changing each reference from the Python not even on the Path, to my Panda3D Python libs directory (which WAS on the path) and now it works.

how to load?

I'm having a hard time. Can you explain where exactly the .DNA file has to go to? Thanks!

fail to compile libpandadna

ugh im using panda3d 1.9 and it fails
*** Error in dnabase.h near line 35, column 39:
syntax error, unexpected IDENTIFIER, expecting '{' or ';' or ':' or '='
Error parsing file: 'dnabase.h'

mac osx fail to build libpandadna

MacBook-Pro-2:build mgracer48$ make
[ 3%] Building CXX object CMakeFiles/libpandadna.dir/src/base/DNALoader.cxx.o
[ 6%] Building CXX object CMakeFiles/libpandadna.dir/src/base/DNAStorage.cxx.o
[ 9%] Building CXX object CMakeFiles/libpandadna.dir/src/base/config_dna.cxx.o
/Users/mgracer48/Downloads/libpandadna-master/src/base/config_dna.cxx:31:1: error:
duplicate explicit instantiation of
'NotifyCategoryProxy<NotifyCategoryGetCategory_dna>'
NotifyCategoryDef(dna, "");
^
/Developer/Panda3D/include/notifyCategoryProxy.h:176:3: note: expanded from
macro 'NotifyCategoryDef'
NotifyCategoryDefName(basename, #basename, parent_category);
^
/Developer/Panda3D/include/notifyCategoryProxy.h:164:18: note: expanded from
macro 'NotifyCategoryDefName'
template class NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename>;
^
/Users/mgracer48/Downloads/libpandadna-master/src/base/config_dna.h:27:1: note:
previous explicit instantiation is here
NotifyCategoryDecl(dna, EXPCL_DNA, EXPTP_DNA);
^
/Developer/Panda3D/include/notifyCategoryProxy.h:137:39: note: expanded from
macro 'NotifyCategoryDecl'
EXPORT_TEMPLATE_CLASS(expcl, exptp, NotifyCategoryProxy<NotifyCategory...
^
/Developer/Panda3D/include/dtoolbase_cc.h:199:30: note: expanded from macro
'EXPORT_TEMPLATE_CLASS'
exptp template class expcl classname;
^
1 error generated.
make[2]: *** [CMakeFiles/libpandadna.dir/src/base/config_dna.cxx.o] Error 1
make[1]: *** [CMakeFiles/libpandadna.dir/all] Error 2
make: *** [all] Error 2
MacBook-Pro-2:build mgracer48$

__main__.DNAError: no such font: mickey

C:\libpandadna-master\compiler>python compile.py toontown_central_sz.dna toontow
n_central_sz.pdna
DirectStart: Starting the game.
:audio(error): load_dso(libp3openal_audio.so) failed, will use NullAudioManage
r
:audio(error): Not a valid Win32 application
Reading DNA file... toontown_central_sz.dna
Traceback (most recent call last):
File "compile.py", line 148, in
process_single_file(file)
File "compile.py", line 99, in process_single_file
rootData = loadDNAFile(dnaStore, filename)
File "compile.py", line 72, in loadDNAFile
return str(root.traverse(recursive=True, verbose=args.verbose))
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 53, in
traverse
packer += self.traverseChildren(verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 59, in
traverseChildren
packer += child.traverse(recursive=True, verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 53, in
traverse
packer += self.traverseChildren(verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 59, in
traverseChildren
packer += child.traverse(recursive=True, verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAVisGroup.py", line 50,
in traverse
packer += self.traverseChildren(verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 59, in
traverseChildren
packer += child.traverse(recursive=True, verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 53, in
traverse
packer += self.traverseChildren(verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 59, in
traverseChildren
packer += child.traverse(recursive=True, verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAProp.py", line 28, in t
raverse
packer += self.traverseChildren(verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 59, in
traverseChildren
packer += child.traverse(recursive=True, verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNASign.py", line 28, in t
raverse
packer += self.traverseChildren(verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNAGroup.py", line 59, in
traverseChildren
packer += child.traverse(recursive=True, verbose=verbose)
File "C:\libpandadna-master\compiler\dna\components\DNASignBaseline.py", line
84, in traverse
font = globalStorage.getFont(self.code)
File "C:\libpandadna-master\compiler\dna\base\DNAStorage.py", line 33, in getF
ont
raise DNAError('no such font: %s' % code)
main.DNAError: no such font: mickey

C:\libpandadna-master\compiler>pause
Press any key to continue . . .

Unclear instructions.

I'm pretty sure this goes in the issues area:
This part, make absolutely no sense to me:

"*Almost done. Now, in Visual Studio:

  • Add all panda3d directories to include/lib path (and python dirs too!)*"

...What? I honestly don't get what I'm supposed to be doing here. Where? What directories? I don't see any in VS.

Game Crashes while loading PDNA Files

The game stopped responding, I compiled libpandadna with Visual Studio 14 2015.

Here is the log:

ToontownStart: Polling for game2 to finish...
ToontownStart: Game2 is finished.
ToontownStart: Starting the game.
ToontownStart: setting default font
TTLocalizer: Running in language: english
from toontown.toonbase.TTLocalizerEnglish import *
OTPLocalizer: Running in language: english
from otp.otpbase.OTPLocalizerEnglish import *
ToontownStart: Loading default gui sounds
ToontownStart: serverVersion:  dev
TTAccount: accountServer from launcher:  
TTAccount: default accountServer:  https://toontown.go.com
{401000001: <toontown.distributed.ToontownDistrict.ToontownDistrict instance at 0x0E8C8AD0>}
Warning: NodePath.remove() is deprecated.  Use remove_node() instead.
Warning: NodePath.remove() is deprecated.  Use remove_node() instead.
Warning: NodePath.remove() is deprecated.  Use remove_node() instead.
local
Reading DNA file... phase_3.5/dna/storage_tutorial.pdna

Then i get ppython.exe is not responding.

Suit Spawning

Suits instantly appear on their path instead of flying down/walking out of an entrance

Bug when Compiling PDNA files on Windows 10 build 10586.63

This is the error I get when compiling .pdna files on Windows 10 build 10586.63

Traceback (most recent call last):
File "compile.py", line 106, in
process_single_file(file)
File "compile.py", line 67, in process_single_file
rootData = loadDNAFile(dnaStore, filename)
File "compile.py", line 61, in loadDNAFile
root.read(f)
File "C:\Users\Josh\Documents\libpanda\libpandadna-master\compiler\dna\components\DNARoot.py", line 20, in read
parser.parse(stream.read())
File "C:\Users\Josh\Documents\libpanda\libpandadna-master\compiler\ply\yacc.py", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "C:\Users\Josh\Documents\libpanda\libpandadna-master\compiler\ply\yacc.py", line 1181, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File "C:\Users\Josh\Documents\libpanda\libpandadna-master\compiler\ply\yacc.py", line 193, in call_errorfunc
r = errorfunc(token)
File "C:\Users\Josh\Documents\libpanda\libpandadna-master\compiler\dna\parser\parser.py", line 1031, in p_error
raise DNAError('Syntax error at line %s token=%s' % sub)
main.DNAError: Syntax error at line 1400 token=LexToken(UNQUOTED_STRING,'PDNA',1400,0)

Interrogating fails on Linux. [Ubuntu 14.04]

When attempting to build on wip/cxx-signs branch (which have experimental linux support), this happens:

cmake .. -DPANDA_DIR=/usr/local
/usr/local
/home/littlecat/libpandadna/src
Interrogating base
*** Error in config_dna.h near line 26, column 37:
syntax error, unexpected ','
Error parsing file: 'DNAStorage.h'
Interrogating suit
*** Error in /home/littlecat/libpandadna/src/base/config_dna.h near line 26, column 37:
syntax error, unexpected ','
Error parsing file: 'DNASuitPoint.h'
Interrogating components
*** Error in /home/littlecat/libpandadna/src/base/config_dna.h near line 26, column 37:
syntax error, unexpected ','
Error parsing file: 'DNAGroup.h'
-- GCC Version: 4.8

-- Configuring done
CMake Error at CMakeLists.txt:121 (add_library):
  Cannot find source file:

    src/base_igate.cxx

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


-- Build files have been written to: /home/littlecat/libpandadna/build

Problems with CMake

CMake Error at CMakeLists.txt:176 (add_library):
Cannot find source file:

src/base_igate.cxx

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx

CMake Error at CMakeLists.txt:176 (add_library):
No SOURCES given to target: libpandadna

I am getting this error when I attempt to build.

How do I make a Cmake script

so I am a little bit of a noob when it comes to this stuff but I was wondering how do I compile the .dna files to be .pdna instead?

Port to Python 3

Synopsis: Ported fork of this tool over to Python3, unsure if it works, have no real way to test produced file

Not sure if this is the best place to post this, but I've been wanting to port this tool over to Python3, so I've forked it, ran it through the 2to3 tool, and made some minor tweaks. It appears that it works successfully, however, I have no way as of yet to actually... test to see if the pdna files produced actually work.
I guess what I'm asking is, would anyone be-able to point me in the right direction for testing to see if this really works? I know, probably not the best place to ask this and maybe a bit too vague, but this is about the only place I found, thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.