Lightweight Panda3D Library

Ive been messing around with other 3d engines and was not really pleased with any of them. I did find one however that did not require any installation. You just threw the folder in your src folder. Would there be any way to do that with panda3ds runtime so you dont need to have people who wish to play your game dl the runtime or have your game be at least 200mb in size?

The problem with the “200mb” standalone distribution is that all of Panda3D is included. And Panda3D has dozens of modules you probably won’t use in your game/application. So the solution if to leave away those parts of the Panda3D SDK which are not required by your game/application.

The tricky thing is that it is difficult to determine which parts are required and which are not required.

I remember a pissing contest some years ago, where I packed a full Panda3D application in about 8Mb. But this has been just a dirty proof-of-concept and is definitely not recommended practice [url]pack-panda Installer SIZE]

You first have to make up your mind on how your end-users should install your game/app. For example:

  • installer vs. unpack-zip-and-drop-somewhere?
  • proper version of python already installed on end user machine, or shipped together with your game/app?

Note that the pdeploy command is capable of making a standalone executable that has a minimal copy of Panda included. It’s still considerably bigger than 8mb, but it’s also smaller than 200mb. It might be an easy compromise.

Of course, there’s also the p3d file model of distribution, which includes only your application and so is quite small, but it does require your friends to install the Panda3D runtime separately. It’s a win if your friends might receive more than one Panda3D application from you. :slight_smile:

David

It’s all about not including some libraries which you do not use. If you are not using pdeploy/packpanda, just exclude some .dll or .so files in your “bin” or custom folder (which you can set in the pth file).

One of our viewers takes up 15 MB archived and 78 MB uncompressed, but we are using some third party libraries. I think if you just need the 3d renderer and are okay with only one graphics library, you can shrink your game folder to less than 50 MB. You can go even further and use UPX to compress the dll files. And this is when including a local Python.

Is there a list of Panda’s dlls and what each is for in the manual? I had some difficulty myself in figuring out which ones I need.

Using packp3d/pdeploy I obtain a small “overload”. Currently my game is 43.6 MB (this is the size of the p3d file, namely the “contents” of the game without Panda3D’s stuff), and the resulting installers are 58.2, 64.6 and 69.2 MB for Windows, OSX and Linux installers. So, the overload is not very big (the installers require panda3d, openal and morepy in mycase, and are built with the -s switch). So, Panda adds only 25 MB in the worst case, which is good to me in my case (and, anyway, if you look at sizes of other engines you can see that they are comparable).

Wow i didnt think i woukdstart thisbig of a thread :stuck_out_tongue: i would prefer the installation to be just a drag and drop. But in tgeory if i track down only the libs my game is using it would work?

Thanks cor all the replies!!

edit - that post was from my tablet, still getting used to big toucscreen keyboards :stuck_out_tongue:

I essentially want my game to be zipped/rared and all they do is download, unzip and run the w/emygamenamneis.pyc so i would want python and only the needed panda libs with it

Requiring Python and Panda is too strict imho. Instead, you could make the installers with pdeploy, then uncompress them and distribute their contents in a zipped file: so the user can just extract the files and launch the executable.

i was just thinking have a folder. In said folder is a script to launch the game, the required panda libs and the required python runtimes. Small simple and no installation needed :smiley:. Drag, drop, play

We have found the Python and Panda tools for distributing an application not suitable for our case.
We need to distribute a game as an archive which contains everything to run the game, but allows the user to access and modify the source and all the assets too.
This is how we do it:

We have is a folder containing the folders “engine” and “data”. The engine folder contains the folder “panda3d”, where “python”, “direct”, “etc”, “pandac” and “bin” folders are located and folder “src”, where the game’s source code is located. We have an exe in the root folder written in C++ which runs “engine/src/main.pyc” with “engine/panda3d/python/python.exe”. The “data” folder contains the game’s assets.
This works as-is, as Python looks for the Panda modules in its parent folder, which is still the case with this folder structure.

:smiley: so then from there its just a matter of finding only the panda libs that your using, right?

You could use pdeploy to get an already stripped down version of Panda3D, and then manually remove libs that aren’t used.

awesome :smiley: thanks!

What I said was exactly this, only replacing “script to launch the game” with “an executable” and without requiring Python.

Are you sure that you can’t use the current tools? You could use packp3d to create a p3d file which contains the application code which the user should not modify (the core code, without assets and modifiable code), and build the corresponding installers. Then you could modify the installers to make them placing the assets in the installation directory (or wherever you want), and you can access these assets from the executable. Imho using packp3d/pdeploy and customizing the installation phase would be easier than managing all the dependencies for each operative system for each version of Panda (if the life cycle of your game is long), but, since you built that method, we have a different opinion on this. :slight_smile:
EDIT: moreover, with your approach you must also provide customized installers, anyway.

Yes, I’m quite sure.
The tools don’t give enough control and seem to do more for what is needed for our particular case.

I never said we use installers.

Oh, sorry, I made that assumption, which was too strict, excuse me. Indeed, there are scenarios where installers should be avoided, you are right.

If you mean .dll or .so files (the C++ part), then yes. I’m not sure if the manual explains what each one is needed for. I couldn’t contribute such a list myself because I don’t know what every single lib is needed for.

As for the Python libs (direct and pandac packages), I suppose you could exclude some modules from the direct package, but since it takes up so little space, I doubt it would be worth it.