Python installation requirement on user's machine

Hello,

Is it a requirement that the users will have to have python installed in order to install and play a game created with Panda 3D 1.7.2/1.8.0 ?

Secondly as the game logic files will mainly be a collection of .py files (the source of which are readable using simple text editor), how can I hide the source code of my game from the end user or prevent them from getting tampered ?

Thanks,

Juggernaut

Well, short answer:

Yes, they will need Python.
And no, you cannot hide the source for someone who really want to see it.

Long answer (about the source hiding)

You can convert .py files to bytecode equivalent, which become .pyc files. They are not readable with a normal text editor.
However, there are programs on the web (ex: http://www.depython.net/) who can easily decompile them (matter of seconds).

Now, you can make it someone a little bit harder, by ‘obfuscating’ your code. Obfuscation is making things harder to read. (ex: http://pawsense.com/python…obfuscator/) But, someone willing to read your code, can do it, you just slow them down.

So, no, you can’t stop anybody.
You should choose C++ if you want to make it even harder, because C++ must be compiled before you can run it.

Correct me if i’m wrong,
And I hope you understand what I’m typing, lol. (Not native English)

Hello Carharttguy,

Thank you for your explanation. I do understand what you have typed in and yes C++ will make it harder - though there are de-compilers available out there too.

Now regarding the first point - python installation - can I package the python within the installer file - which gets installed automatically as the user installs the game ? Or is there no such option available and the user has to do the python installation himself/herself manually ? I am asking this because if the "second case " is true then it can hinder the popularity of the game.

Thanks,

Juggernaut

Well, you could use PyInstaller. As one of the features states:

This is the site: http://www.pyinstaller.org/

Cheers!
Carharttguy.

Carharttguy,

Thanks for showing me pyinstaller. Wish it had support for the python win32 extensions.

Thanks,

Juggernaut

the recommended way of distributing panda applications are:

  1. create a p3d file. in this case the user has to download and install the panda3d-runtime. (easiest choice for you as one p3d file runs on all supported platforms)

  2. let panda’s packing system create a self-contained installer for each platform you want to support.

neither require any other installation of python, it comes with the runtime/selfcontained installer.
in both cases you can ask panda’s packing system to convert your py files to pyc, not sure if it is default or not. for more detailed information see the manual panda3d.org/manual/index.php/Main_Page
bit down the page, chapter III Distributing Panda3D Applications

General piece of wisdom. Once you release your game/app/code, there is no way to prevent people from tempering with it. If the code can execute, it can be tempered with, no exception. Many systems tried to prevent this, and not one remains unhacked.
So in the end, you are better off to not waste your time with that. And instead, write better server-code that will prevent bad gameplay experiences for other players.

Please read this: panda3d.org/manual/index.ph … plications
and the following pages.
Especially this one: panda3d.org/manual/index.ph … _installer.

You only need to make your co-developers (who need to edit the code) install Panda3d SDK and Python is shipped with the SDK on Windows. On Mac and Linux Python is almost always preinstalled anyway.

Argh, ThomasEgi was a bit faster :smiley:

You can easily turn your source code (text) into a .p3d file (a sort of multifile, a bit like a zip, a bit like a executable .jar ) and then turn that p3d into a binary stand-alone (.exe) file. All that is needed is to run a command line utility (as the manual explains).

The end user won’t need python and if you pack it to a binary file he won’t need anything else than a working video driver.

Your code will be protected as good as any other game/program/operating system out on the market.

Locking a door is a good analogy when it comes to protecting your code from snoopers. If someone has a lockpick and knows how to use it, then opening a locked door is only a mater of time - for the rest a locked door stays locked.

An average user will not have the skills needed to decompile a panda3d game distributed as a exe (or even p3d), a pro cracker will most likely never bother (if there’s no profit from it).

Thank you … all of you … specially the creators of last three posts … which came a bit late fostering my early departure from Panda3D. Now since I know that it is possible to hide my code and assets from misuse by the end user I am back again with Panda3D. Thank you all of you once again.