Freeze when launching .p3d

Hi,

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 main.py :

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

import direct.directbase.DirectStart
import sys

class ArcnsApp(DirectObject):
    def __init__(self):
        self.accept("escape",sys.exit,[0])
        OnscreenText(text="test1",pos=(0,0,0),fg=(0,0,0,1),bg=(1,1,1,0.8))
        print "good"

app = ArcnsApp()
run()

and in a separate directory, this firstClassTest.py :

from direct.gui.OnscreenText import OnscreenText

class firstClassTest:
    def __init__(self):
        print "firstClassTest"
        OnscreenText(text="test2",pos=(-0.5,0,0),fg=(1,1,1,1))

And for the end, firstTest.pdef :

class firstTestPack(package):
    config(version="0.0")
    file("firstClassTest.py")

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

.
_ main
   _ main.py
_testpack
  _ firstTest.pdef
  _ firstClassTest.py

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 [ https://runtime.panda3d.org/contents.xml?1377073795 ]

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 runtime.panda3d.org 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.

David

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 :

.
_ main.py
_ firstTest.pdef -> change for deploy.pdef
_ test1
   _ __init__.py
   _ firstClassTest.py

and I modified deploy.pdef :

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

from panda3d.core import *

packager.setHost("http://localhost/testpack1/")

class firstTestPack(package):
    config(version="0.0")
    module("test1.*")

class gameTest(p3d):
    require("panda3d","firstTestPack")
    config(display_name="My test Game")
    excludeModule("test1")
    mainModule("main")

And to finish, the command :

ppackage.p3d -i deploy deploy.pdef

This process work, producing a new dir tree :

.
_ main.py
_ deploy.pdef
_ test1
   _ ...
_ deploy
   _ contents.xml
   _ firstTestPack
      _ 0.0
         _ firstTestPack.0.0.xml
         _ firstTestPack.0.0.mf.pz
         _ firstTestPack.0.0.import.xml
   _gameTest.p3d

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.