Pdeploy

Just tested the installer and it worked this time, so the majic word is “main.”

I’m going to just forget about the -m option then, because it didn’t specify the .py file I was using as “main.”

Thank Madonna that drama is over… but… Why do I have the feeling something else is going to pop up?

Anyway,

My first PM2 App is wrapped up. The only thing left to do is touch-ups…if I wanted to, but I’m going to finish off the site. Already added URL generators for forum pages, so every thread page will display its direct URL at the top (for those who wish to bookmark or direct link in other forums).

I’m going to take the rest of the day off because packp3d and pdeploy knocked the wind out of me for two days!!!

Next week sometime should be show-time. A few people are already looking to register right at launch, which is sweet. You need some early members to help spread the presence of a social site. :smiley:

I knew something esle would pop up…

How do you include the audio setup when running Pack/deploy? I noticed the sound I played in my test App is not playing in the .p3d and installation file.

Hum… Could it be adding a -n or -e to packp3d? -n for uncompressed and -e for compressed…
Wave files are usually not compressed and therefore larger in size… I guess I could try the -e, but if OpenAL is not automatically included, that won’t matter…

—update
-e didn’t work

I’m not sure why you’re not getting the hints. Read the relevant manual sections first. Please.

The answer to your question is in here:
panda3d.org/manual/index.ph … g_packages

I am reading the manual and I think it’s -r.

You just have to dig so much through the manual for something so minor.

-r audio or -r openal included the audio, put the sound is broken when running the .p3d file. Any suggestions on that?


http://csns.calstatela.edu/department/cs/forum/topic/view?id=4461453

So OpenAL is broken…at least with the 1.7.0 build of P3D. Sound worked correctly with Fmod and it’s a good thing my Project is a freeware title because Fmod = $$$$$$$$$$$$$$$$$$$$

I’m wondering now if OpenAL supports mp3 files better (or at all, guess I’ll check out the site)?

The best thing for me to do is install another audio lib into P3D’s python installation and import it, into the run-time (for commercial projects).

Thanks for the knowledge input, Drwr and rdb.

There’ll be an OpenAL fix for 1.8.2. But OpenAL should work fine in 1.8.0. Not sure why you’re choosing to use 1.7.0, there is no reason to use 1.7.0.

I included a mod folder in my test installation:


import direct.directbase.DirectStart
from direct.showbase.DirectObject import DirectObject
from direct.showbase import Audio3DManager
from pandac.PandaModules import *
from direct.actor.Actor import Actor
from direct.gui.OnscreenText import OnscreenText
from direct.gui.OnscreenImage import OnscreenImage
from direct.gui.DirectGui import *
from direct.filter.CommonFilters import CommonFilters
from direct.filter.FilterManager import *
from direct.stdpy.file import open
from direct.stdpy.file import listdir

from math import floor, ceil, pi, sin, cos
import sys
from os.path import isfile, isdir, join, basename, splitext, abspath
from os import mkdir, rmdir, rename, remove, system
from os import name as os_name
from random import *
import gc

WingameDir = abspath("")
MYGameDIR = Filename.fromOsSpecific(WingameDir)

ModPath = Filename(MYGameDIR+"/mod")
OSModPath = ModPath.toOsSpecific()
sys.path.append(OSModPath);
from modtest import *



class QQme(DirectObject):
    def __init__(self):
        self.accept("escape", self.Leave)
    def Leave(self):
        base.exitfunc()
        sys.exit()
Qopt = QQme()


def SetResolutioN(DirectObject):
    wp = WindowProperties();
    wp.setSize(1024, 768);
    wp.setFullscreen(True);
    if os_name == 'posix': 
          base.openMainWindow();
          base.graphicsEngine.openWindows();
          base.win.requestProperties(wp);
    else:
        base.win.requestProperties(wp);
#SetResolutioN();


ImageONe = loader.loadTexture(MYGameDIR+"/data/imgs/ri.jpg")
Sound = loader.loadSfx(str(MYGameDIR+"/data/mus/air.wav"))
Sound.setLoop(True)
Sound.setVolume(0.1)
Sound.play()

Ship = loader.loadModel(MYGameDIR+"/data/egg/tship1")
Pobj = NodePath(PandaNode("fsfsf"))
Pobj.reparentTo(render)
Ship.reparentTo(Pobj)
Pobj.setPos(0,0,0)
base.cam.setPos(0,-30,0)
base.cam.lookAt(Pobj)

Ship.setTexture(ImageONe, 1)

ModText = PrintMe()
TText = OnscreenText(parent=render2d, text = ModText, pos = (0.0, -0.5), scale = 0.05, fg=(1, 1, 1, 1), bg=(0, 0, 0, 0), align=TextNode.ACenter, shadow=(0,0,0,1), mayChange=True);


render.setAntialias(AntialiasAttrib.MFaster+AntialiasAttrib.MAuto)

run()

When running packp3d, it ends with an error:

KeyError: ‘mod’
Failure on startup


\mod\modtest_init_.py

Solved it… I had two init.py files because of the complied one the creeps in.

However… The .p3d files does not run (close on startup). Any takers…?

--------------Update-----------------
The command line error says no module named modtest… So I’m guessing the way I’m importing the module isn’t going to work.

I don’t fully understand the structure of the p3d multifile, so is there a specific way to import your own modules?

------------Update-------------
My test module does importe when running via ppython… But not after converting to a .p3d file.

Just printed the module path…

.p3d files are looking for the module in:

AppData\local\Panda3D\start\mod

So the .p3d files (and installer versions) do not address local paths such as /game directory/mod?

If you want to see what’s contained in your .p3d archive, use the SDK command “multify -tvf yourgame.p3d”. This will print out a directory listing. From there, you should see if anything is missing from the .p3d file.

As I said earlier, the .p3d file is mounted into the Panda3D/start directory. Anything you access within that directory will actually be reading from the .p3d archive.

I’m checking out py2exe right now.

So far, I have successfully created an main.exe with the p3D files needed to run my test App, and it works!! Module path and all!!!

The good thing about this is… I can run my own install creator now (yeeessss!!! :mrgreen: )

The bad part is… I might be limited to distributing just for windows. I’m going to continue to look into it.

If things turn out really really good… I’m going to create a tutorial on this and post it on PMME2. Anyone using Panda3D should know this… Again, if things turn out good that is…

PS,

The makers of the Vamprye Story took the same route.

--------------------update—
For the time being…I’m going to develop as windows only.

Although… I believe it’s call Wine…? One could probably still execute the .exe on Linux or Mac using Wine, because of the cross-platforming nature of the package.

I just don’t have enough time to look into the matter futher. There is another app similar to py2exe called py2app, which is for Mac users. There is no py2rpm, not that I know of.

I could probably install a Linux partition on one of my current PCs.

Options are there, but one would most likey need access to machines running each of the different platforms in order to take advantage of the options.

For now…on with the show. :smiley:

PS,

Not too thrilled with manually converting every single .egg to .bam one by one (with my py2exe setup). I didn’t see any directory converting options available with egg2bam.

Any egg files found within the application folder will be automatically converted to bam files for storing in the p3d file. Bam files are usually a much better choice for distributing an application, because they’re smaller and they load much faster. However, this does mean that you can’t specify the “.egg” extension to your model files when you load your models in code, because they won’t have that extension within the p3d file; you must omit the filename extension altogether. If you want to keep some of your egg files as they are, without converting them to bam files, you must use the more advanced ppackage utility to create your p3d file.

You don’t need to convert all the modes manualy (but if tyou wish to do so- make a python script for that , the function writeBamFile() is there for you).

After packing your game to a p3d file you can’t use the current working directory as a place where all the files where before packing. It will point to the ‘start’ dir in some obscure place. If you try to construct absolute pathnames to models and textures at runtime - you’re gonna have a bad time. Just use a relative path - if before packing your models where in c:\my_game\data\3d\models\ then just point the loader to ‘data/3d/models/’ using the panda filename syntax -panda will know where to look even if that dir is just there in a virtual filesystem.
I’d also suggest trying the standalone option - it gives a ‘portable’ version, no installation needed just click and run.

Using py2exe or py2app with panda 3d is like an arrow to the knee - you can do it but why would you want to? If you have a game packed as a p3d file then just using pdeploy will make all the binary files for all the platforms panda supports - I’ve made a few of these and not once did I have problems that a p3d file worked and a pdeployed exe did not. You can pack the game for other platforms (like for mac and linux on windows) - as far as I know non of the py2xyz packing systems can do that. What I remember from using py2exe - it always packs the full python interpreter and that’s about +20-30MB, panda can do way better (my game unnpacked is about 200mb - a ziped, p3dpacked, pdeployed exe is under 50mb).

packp3d+ pdeploy is a very good packing system, one of the best I know, the only thing the manual lacks is mentioning that the ‘-s’ option for pdeploy also works in the ‘standalone’ mode. Can really understand why You have so many problems with it.

The “-s” option means that it includes all of the required packages. This doesn’t make sense in standalone mode, in which you want only a single .exe file, and not all of the Panda libraries and multifiles to go with it.

It does work in the sense that it does not give an error, but it does require you to then manually copy all of the required packages into the installation directory. Otherwise, since the -s option instructs it specifically not to download anything at runtime, it won’t run on a machine that didn’t recently run a different Panda3D game.

In the future, I will most likely setup an Apple machine and run py2app on the files I develop on windows; and stick with distributing for Windows and Mac. :smiley:

Even though Macs have high powered graphic cards now, the majority of PC games are stilled made for non Mac and Linux machines. DirectX is a huge part of that, but personally I like OpenGL because I favor cross platforming.

PS,

Even scripting relative paths for game files…packp3d and pdeploy versions of your App will still fail. I seems no one has really tried to import their own written modules from their own folder. Packp3d and Pdeploy may be good options for those who do not use their own external modules and develop their package folder “by the book.” I’m sure you know what I mean when I type “by the book.”

Another advantage of not using pack and deploy is the fact I can now add another .exe file as my startup file, which will act as a configuration file and then have that configuration .exe call for the game .exe and terminate. The only thing I have to do is link the desktop shortcut to the configuration exe…no problem there.

My prc files can be written to or re-written on the fly now, which adds power and ease to configurating the game. The installer app I’m going to use also gives more options, more art work input, more legal input, etc then pdeploy.

:mrgreen:

You did try using the -d option to packp3d to include the scripts in your modules directory, correct?