I try to do some game develop pipeline to make easy web publish. If i work in my game just load models from folders i´ll get hurt when i change it to p3d (i think in modular way).
Then i think in multifiles.
Multify program make files ended .mf
Ppackage program make files ended .mf.pz
It´s right to think ppackage make a multifile … but just pziped?
But i try load .mf,pz in normal multifile ways and don´t work (i guess ´cos .pz).
How to load a mf.pz in a stand-alone (developer or without base.appRunner) application ?
The multifiles are only pzipped for download. After they have been downloaded, they are automatically unzipped to just their original .mf extension, from whence they are mounted directly.
Still, the design is that you’re supposed to be able to have just ordinary folders in your development environment, then when you run packp3d (or ppackage) it automatically puts it all in a p3d or mf file, maintaining the same structure, so that it works more-or-less the same way as in your development environment. You should be able to write code that works in either environment without change. You don’t have to pre-package all of your assets in a multifile.
So, were you having a specific problem with the auto-packaging system that was making you think you should do it this way instead?
Maybe i´m very confuse … lemme tell you more.
I want load game assets just in time, when the game need. If i pack everything in p3d file and publish on web the user have wait more time to load … all right, this is very logical.
But when i develop the game, i have no base.appRunner to call installpackage … i must change my .py in .p3d and my folders in multifiles. It´s the source of my confusion because without a base.appRunner i cannot test the load of resources and i fear to call a resource who´s not loaded yet when i publish my game.
Then i think in a pre-designer the packages and game level dependencies to make my code more portable when i change it from .py to .p3d.
How do you work with that in your everyday Panda? I a little stuck about that.
Ah, you can simulate a base.appRunner at development time with this code:
if not hasattr(base, 'appRunner'):
base.appRunner = AppRunner.dummyAppRunner()
Then you can call base.appRunner.installPackage() or whatever. You will still need to use ppackage to build your packages, and host them somewhere you can access them.
hasattr(base, “appRunner”) return true ´cos base had appRunner … but in None. It´s fine … i did in the top of my code:
from direct.p3d.AppRunner import *
if base.appRunner==None: base.appRunner=dummyAppRunner()
When i run i have
*** Process started (C:\Python26\Python.exe -u "c:\panda3d-1.7.0\panda_projects\application\katana_virtual.py") ***
DirectStart: Starting the game.
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
File "c:\panda3d-1.7.0\panda_projects\application\katana_virtual.py", line 8, in <module>
File "C:\Panda3D-1.7.0\direct\p3d\AppRunner.py", line 1173, in dummyAppRunner
appRunner.addPackageInfo('panda3d', platform, version, hostUrl)
File "C:\Panda3D-1.7.0\direct\p3d\AppRunner.py", line 799, in addPackageInfo
raise OSError, message
OSError: Couldn't find panda3d dev on https://runtime.panda3d.org/
*** Process terminated with exit code:0 (9,83 seconds) ***
I didn´t understand … it coudn´t handshake with server? My internet was on when i try.
Hmm, no, the problem is really that you are running with a development version of Panda3D, not the rtdist version that’s distributed with the runtime.
Hmm, so it’s more complicated to use the dummyAppRunner than I thought. Let me think about this some more.