How do I compile a game built in panda3d version 1.10.0? (Solved)

Hey, long time no see, in a couple of days I wanted to show off a alpha build (or demo) of the project I was building in the last 10 months, and I found this article how to do so.
https://www.panda3d.org/manual/?title=Distributing_as_a_self-contained_installer
It would be fine, though there is a issue.

It says this feature was deprecated for panda3d versions 1.10.0 and up, my panda3d sdk is 1.10.0, so, does anyone have any ideas what to do? I wanted to make standalone versions for both mac and windows machines so that I can get feedback from anyone. any help would be appreciated.

The developers replaced PDeploy with a new Deploy-NG. But I haven’t tried it.

hmm… well, how would you use Deploy-NG? and would with Mac OS X? I ask because a another issue is comes up if using PDeploy, because the instructions for it seemed be design for command prompt (windows) in mind, not terminal (mac).

Anyways, thank you for your response.

Here’s a manual page on using deploy-ng, or just setup tools (as far as I know the name deploy-ng was only used when the tool was in development).
https://www.panda3d.org/manual/?title=Distributing_Panda3D_Applications
It’s designed to work with mac os, but me and Apple don’t mix so I can’t say what kind of problems you can encounter.

It’s also covered in my “beginner’s tutorial”, in the following lesson, specifically: https://arsthaumaturgis.github.io/Panda3DTutorial.io/tutorial/tut_lesson16.html

okay, thanks wezu and Thaumaturge I will take a look at the articles.


Edit: so I got it to compile, but when I loaded it up in my windows XP virtual machine to test the build I got a error message “The procedure entry point GetFinalPathNameByHandleW could not be located in the dynamic link library KERNEL.32.dll” and the executable will not start.

Does anyone have any clues to what this means?


Edit2: well I decided to do 5 minutes of research and found out the issue is windows XP is not compatible, so I ask another question, how do I build a XP build of panda3d or is XP deprecated?

I typed in “win32” into the setup.py, I thought win32 was universal for all x86 window machines.

I believe XP is still supported. However, the setuptools deployment tools have seen a lot of bug fixes (especially to less common platforms). I would recommend trying again with Panda 1.10.3.

well, during the building process it had to download 2 separate versions of panda3d to build with, one for mac OS X and the other for win32 (or windows x86), the thing is, I use the mac sdk.

does it download a match of the sdk version?

Hey, I was just wondering if anyone can answer if a compiled build of a panda3d game (standalone app) can be tested on the same system as it was built on (with the panda3d sdk)? or would ruin (interfere with) the sdk?

I thank anyone who is willing to help.

Edit: so I went ahead and tried it myself on my mac OS X, the window popped up briefly was all black, then closed up, no error messages either, did I do something wrong? I,m going to research but I will leave this here if anyone has any clues

I don’t know whether this works under Mac, but what I do under Linux is to run the game via command-line within a terminal. This may allow you to see any terminal output that’s printed before or as a result of the game’s crash, and thus perhaps give a clue as to the problem. (If there’s no output in the terminal, then look for a log-file, instead.)

I’ve had such experiences with distributable builds a number of times–in my case, there’s often some small mistake that I’ve made, such as not instructing setup.py to include a particular resource, or some such minor thing.

hmm… okay, I’ll try to run with terminal, but there was a issue that I did not notice during the building process but did notice when I rebuilt right now, and that was a warning message just before it starting the file copy process, here is a paste of what it said.

“There are some missing modules: [‘builtin’, ‘_winapi’]”

Do you think that this is the problem? do you know what this means?

Edit: so I tired your suggestion Thaumaturge, and yes I got a error output, it says that the files for the level cannot be found, is because they are in the resources folder?

Edit2: I.m going to post the error below

Warning: pandac.PandaModules is deprecated, import from panda3d.core instead
Known pipe types:
CocoaGraphicsPipe
(all display modules loaded.)
:audio(error): load_dso(libp3fmod_audio.so) failed, will use NullAudioManager
:audio(error): No error.
Traceback (most recent call last):
File “Main.py”, line 11982, in load
FileNotFoundError: [Errno 2] No such file or directory: ‘room/room1.txt’
:task(error): Exception occurred in PythonTask TXTLoader

So what do you think? (also sorry for posting so frequently thanks Thaumaturge.)

Don’t worry about posting frequently. :slight_smile:

I don’t know about the “missing modules” error, myself–I’ll leave that to others who may have a better idea.

As to the missing file, does that file exist within the folder of the game, in that specific sub-folder?

If not, you may not have instructed the build-system to include them in the distributable version. In this case, go and have another look at the tutorial to which I believe that I linked above; note in particular the “include_patterns” section of “setup.py”, and the discussion of it in the tutorial-text. With that, you should, I believe, be able to include such files in the distributable version of your project.

No the files are all there in the resource folder of the package, I,m going to take a another look at the setup.py though, thanks for the suggestion.
Edit: so in the guide you showed me, it said “These can be specific file-names, or file-patterns” for patterns, can I use folder names to include whole folders?

So as I was rerunning the program and messing with files, I noticed that the models and music and images were loading or anything under panda’s loaders, the thing is txt files are loaded in with the python command “open”.

So txt files are not loaded through panda3d but python, maybe python itself cannot find the files?

I doubt it, unless you’re using absolute paths instead of relative ones, or your paths are somehow incorrect in a way that happens to be unproblematic in your development folder.

It’s tempting to suggest that the problem might be that your paths aren’t correct for the OS–but you say that you’re using the SDK on a Mac, and that this problem is also occurring on a Mac. Further, you say that other files are being loaded correctly. So that seems unlikely.

Would you please show me the code-section in which you load your text-files, and a screenshot or two (as appropriate) of the directory into which you installed/unzipped your distributable build of your game?

Try loading files relative to ExecutionEnvironment.getEnvironmentVariable("MAIN_DIR") (also saved as base.mainDir). This is set to the resources directory when running in a frozen macOS environment. The resources directory is already on Panda’s model path, which is why it can find the various assets via the loader.

I am not sure what MAIN_DIR is set to when not using a frozen environment, so you may need some code similar to this that checks a couple of places.

Sorry, I missed this earlier:

Indeed, I believe that you can.

(I’m not sure offhand of how it handles absolute paths, so for safety’s sake, I suggest sticking to relative paths.)

Thaumaturge, here the function is small enough to post

def load(self, task):
    global room
    global run
    global load
    global rlf
    global inop
    global analyze
    global cleanup
    global job
    global sload
    if not job:
        if load is 0:
           job = True
           if not sload:
              run = False
    else:
        if load is 0 and cleanup is 0:
           inop = True
           analyze = True
           txt = open('room/room'+str(room)+'.txt')
           rlf = txt.readlines()
           txt.close()
           load = 1
               
    return Task.cont 

There seems to be nothing wrong about it, hmmm, oh and your 2nd post, I already tried using file paths for the patterns but without good syntax examples I couldn’t get it to work.


Moguri I,m going to look into this, thanks

As a friendly heads up, you should avoid using the global statement and avoid opening files without using with.

sorry, I,m not a experienced coder, so I used what works, though I said before that I would look into taking programming more seriously after I get this project published, would “open with” do anything different then “open”?

EDIT: okay, I get it, open with is far safer, I’ll look into it once my project is published, thanks for the tip.