Freeze when launching .p3d


I started to code a small game few months ago, but now it grew and became to big to use a single p3d file, so I looked at package, but I ran into some issues I don’t understand.

I tried with a small test program, and I have the same problem, so if you can take five minutes to take a look, I will thank you.

I wrote this in my :

from direct.showbase.DirectObject import DirectObject
from direct.gui.OnscreenText import OnscreenText

import direct.directbase.DirectStart
import sys

class ArcnsApp(DirectObject):
    def __init__(self):
        print "good"

app = ArcnsApp()

and in a separate directory, this :

from direct.gui.OnscreenText import OnscreenText

class firstClassTest:
    def __init__(self):
        print "firstClassTest"

And for the end, firstTest.pdef :

class firstTestPack(package):

The and the two others files are in separate folders, like this :

_ main
  _ firstTest.pdef

I used this command for my package :

/home/me/workspace_panda/tools/ppackage.p3d -i /var/www/testingpack/ firstTest.pdef

And this one for the p3d file :

/home/me/workspace_panda/tools/pack3d.p3d -o test_pack.p3d -d /home/workspace_panda/testpack/main/ -r firstTestPack,0.0,http://localhost/testingpack/

The commands ran correctly, with some missing modules like “panda3d.core” and “direct.gui.onscreenText”, but they passed.

when I tried “./test_pack.p3d”, the program freeze, and I have the window with the panda and a warning sign. In the shell, the program stay with :

:downloader: [0xb43c90] begin GET [ ]

and in the log/p3dcore.log, I can read this:

Couldn't find package firstTestPack.0.0 in contents file.

When I close the window, I have this output:

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 36 requests (30 known processed) with 0 events remaining.

The number of request can change.

I don’t understand what’s happen. Thanks for your help.

What does your contents.xml look like? It’s complaining that it didn’t find your firstTestPack package with a version of 0.0 listed there; so let’s take a look and see what is listed there.

Or is it only downloading the contents.xml file, and never even looking at your locally hosted contents.xml file? You should see both of them mentioned in the log. Check also the p3d_info.xml file within your p3d file to see where, precisely, it’s being told to look for your firstTestPack package.


It works !

I don’t know what was the real problem in fact. I checked the contents.xml like you wrote, and it is correct, similar to the one I obtained with the new process I found. I don’t understand why, but after two days and a solution, I think it’s the process itself, and not an error.

To explain a little bit, and to help people who will go through the same issue, I bought online this afternoon the excellent book of Christoph Lang, the Panda 1.7 dev cookbook, and he explain in a better way to use ppackage.

Instead of create the two multifiles separately, I change the dir tree like this :

_ firstTest.pdef -> change for deploy.pdef
_ test1

and I modified deploy.pdef :

# -*- coding: utf-8 -*-

from panda3d.core import *


class firstTestPack(package):

class gameTest(p3d):
    config(display_name="My test Game")

And to finish, the command :

ppackage.p3d -i deploy deploy.pdef

This process work, producing a new dir tree :

_ deploy.pdef
_ test1
   _ ...
_ deploy
   _ contents.xml
   _ firstTestPack
      _ 0.0
         _ firstTestPack.0.0.xml
         _ firstTestPack.0.0.import.xml

Just another action to copy under the apache dir, in my case /var/www/testpack1/, and it’s ready.

With the documentation it’s not so easy to reach a solution. I hope this explanation can help.