How do i make a game closed source

You know all the stuff we dont want seen and edited client sided
I mean like i have all the folders and files
i want to know how to close source files and folders i want closed source

If you package your game with packp3d/pdeploy then the source code will become hidden.

Is there a simple way to disable this feature for open source games, so that the python scripts and content unpack for easy end user modification?

@deus:

Well, when you package your game using packp3d, you should sort of see it as a binary version of the game. You can always distribute your source separately for people who want to run the game via the SDK.

But in theory, there is nothing preventing a .p3d archive from containing .py files instead of .pyo files. There’s no convenient option to packp3d to do that as far as I know, but it could be done manually using multify, or by modifying Packager to set storePythonSource to True on the FreezeTool instance.

However, keep in mind that people would still have to go out of their way to use multify to extract the .p3d file contents. If you used pdeploy to compile it into an executable, people would actually have to use a hex editor or some custom script to extract the actual payload.

There’s of course the possibility of a hybrid solution, in which the p3d file simply contains a small stub that imports a module that’s defined in an external file. Then, people would be able to easily modify the source code.

C:\Panda3D-1.7.2\direct\p3d>packp3d -o toontownworld.p3d -d c:/toontownworld -m
toontown.toonbase.ToontownStart
:AppRunner: Total Panda3D disk space used: 169 MB
:AppRunner: Configured max usage is: 2048 MB
DCFile::read of /c/toontownworld/RetroResources/phase_3/etc/otp.dc
DCFile::read of /c/toontownworld/RetroResources/phase_3/etc/toon.dc
couldn’t import toontown.pets.PetDCImports
couldn’t import toontown.pets
couldn’t import toontown
couldn’t import toontown.coghq.InGameEditorDCImports
couldn’t import toontown.coghq
couldn’t import toontown
DCFile::read of /c/toontownworld/ToontownInfiniteRetro/astron/otp.dc
DCFile::read of /c/toontownworld/ToontownInfiniteRetro/astron/toon.dc
couldn’t import toontown.pets.PetDCImports
couldn’t import toontown.pets
couldn’t import toontown
couldn’t import toontown.coghq.InGameEditorDCImports
couldn’t import toontown.coghq
couldn’t import toontown
Traceback (most recent call last):
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 424, in __taskChainDispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 482, in __dispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\Ap
pRunner.py”, line 748, in __startIfReady
main.main(self)
File “VFSImporter”, line 153, in load_module
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/packp3d.py”, line 225, in
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/packp3d.py”, line 215, in makePackedApp
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/Packager.py”, line 2744, in endPackage
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/Packager.py”, line 444, in close
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/Packager.py”, line 546, in installMultifile
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 869, in done
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 959, in __loadModule
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 1411, in load_module
File “c:\python27\lib\modulefinder.py”, line 305, in load_module
File “c:\python27\lib\modulefinder.py”, line 414, in scan_code
File “c:\python27\lib\modulefinder.py”, line 323, in _safe_import_hook
File “c:\python27\lib\modulefinder.py”, line 125, in import_hook
File “c:\python27\lib\modulefinder.py”, line 162, in determine_parent
KeyError: ‘ToontownInfiniteRetro’
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\Ap
pRunner.py”, line 638, in run
except SystemExit:
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\T
ask.py”, line 502, in run
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\T
ask.py”, line 460, in step
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 424, in __taskChainDispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 482, in __dispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\Ap
pRunner.py”, line 748, in __startIfReady
main.main(self)
File “VFSImporter”, line 153, in load_module
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/packp3d.py”, line 225, in
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/packp3d.py”, line 215, in makePackedApp
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/Packager.py”, line 2744, in endPackage
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/Packager.py”, line 444, in close
File “/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/
p3d/Packager.py”, line 546, in installMultifile
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 869, in done
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 959, in __loadModule
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 1411, in load_module
File “c:\python27\lib\modulefinder.py”, line 305, in load_module
File “c:\python27\lib\modulefinder.py”, line 414, in scan_code
File “c:\python27\lib\modulefinder.py”, line 323, in _safe_import_hook
File “c:\python27\lib\modulefinder.py”, line 125, in import_hook
File “c:\python27\lib\modulefinder.py”, line 162, in determine_parent
KeyError: ‘ToontownInfiniteRetro’
Failure on startup.
help please

It is just that if you are already exclusively using python for the logic, then the game has the potential to be fully mod-able out of the box.

Interesting solution, thanks.