Protection of games produced using panda3d

Hello.
I am just starting to learn using python as well as panda3d. So please help me clear a doubt arising in my mind.
My question is how do you protect your panda3d game from piracy once you have written it? As far as I have understood from the tutorials, the game is produced as a python script file (e.g. game.py), which is a simple text file. :cry:
So, I think that the code of a panda3d game can be easily disclosed. Is it really so? How do you solve this problem? How about programs like py2exe?

Welcome! You can produce byte-code from Python-file (those .pyc files), and deployment tools of Panda do this automatically. Py2exe is already used inside deployment tools of Panda. So the problem you pointed out doesn’t exist.

Thank you!
And sorry for not checking the tutorial completely.

You can also use apps like Py2exe that you mentioned, although setting them up is not very simple or easy. For various inbuilt methods of ‘hiding’ your code and distribution, see http://www.panda3d.org/manual/index.php/Distributing_Panda3D_Applications.

One of the downsides of Python is that someone with the right skill and enthusiasm can just about always find out how your stuff works, but ultimately the same can be said for compiled apps as well. This shouldn’t really be a problem unless you were planning to write a 3D banking transaction tool or something of the sort :wink:

Ive been able to successfully decompile a pyc file to a human readable py code.
I think you can encrypt the panda3d multifiles though

Packing your game into .p3d will hide your source code. Using pdeploy will convert your Panda game into .exe, similar to py2exe.

long answer short: it’s impossible. anything can be hacked if people are spending enough time trying to do so. so usualy you’d only want some very basic “dont edit my plain text files” which is done by using python bytecode. and ignore all other attempts because trying to prevent piracy or hacks will only waste your time.

up until today, i think there is not a single known-to-work-and-yet-unhacked system for preventing hacks or piracy.

furthermore most projects could be happy if someone is interested in hacking it :laughing: . Even if someone is really interested in “hacking” your system i.e. a gameserver they will use exploids etc. So i guess for a average (hobby) project you do need to care about that topic.