.rpyc files and obfuscation

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
trueheartsdestiny
Newbie
Posts: 6
Joined: Sat Jun 15, 2013 5:22 pm
Projects: Lotus of the Junk Heap
Tumblr: atelierursine.tumblr.com
Contact:

.rpyc files and obfuscation

#1 Post by trueheartsdestiny »

Hi guys.

I just read some disheartening news about free Ren'Py games getting stolen and earning people other than the creator a nice chunk of profit. This has brought me to think of how the "game" folder look for some of the games I played. I noticed that some games have .rpy and .rpyc files while other just have .rpyc files. After some poking around, I figure that .rpyc files seems to hide the original code. Yet, if I tried to delete the .rpy files in the folder, the game would stop working.

So my question is, how do other game makers do it? How do their games not rely on .rpy files? What about images in the game? Where do those pictures go?

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: .rpyc files and obfuscation

#2 Post by apricotorange »

IIRC, if you have the .rpyc files, you shouldn't need the .rpy files to run the game. Not sure why that isn't working for you. See http://www.renpy.org/doc/html/build.html#archives for the most common way used to protect the files in Ren'Py games. That said, nothing is going to stop someone who is sufficiently determined from pirating your game; this happens to even the biggest commercial PC games with publishers who spend a lot of money to build elaborate DRM schemes.

(On a side note, if someone is selling your game without your permission, I would suggest talking to a lawyer; it's a pretty open-and-shut copyright infringement case.)

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: .rpyc files and obfuscation

#3 Post by PyTom »

trueheartsdestiny wrote:I just read some disheartening news about free Ren'Py games getting stolen and earning people other than the creator a nice chunk of profit.
Can you point out where this has happened? As far as I can tell, this is more of a theoretical problem - people may pirate games, but it's pretty rare for someone to take credit and make money of a game someone else created.
This has brought me to think of how the "game" folder look for some of the games I played. I noticed that some games have .rpy and .rpyc files while other just have .rpyc files. After some poking around, I figure that .rpyc files seems to hide the original code. Yet, if I tried to delete the .rpy files in the folder, the game would stop working.
Consider:

Code: Select all

init python:
    build.classify("**.rpy", None)
Actually deleting the .rpy files is scary - too much potential for data loss. This command will tell Ren'Py to not include rpy files in the distributions.

Note that .rpyc files are obfuscation - people can recover something resembling a .rpy script from a .rpyc file. That's true of every script file format - the game has to be able to run, after all.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
trueheartsdestiny
Newbie
Posts: 6
Joined: Sat Jun 15, 2013 5:22 pm
Projects: Lotus of the Junk Heap
Tumblr: atelierursine.tumblr.com
Contact:

Re: .rpyc files and obfuscation

#4 Post by trueheartsdestiny »

Thank you for all of the responses! They were very helpful.

Is there a code that would also prevent image files from showing up in the game folder as well? Does this affect the size of the packaged game? It does seem to, but I don't want to leap to any conclusions.

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: .rpyc files and obfuscation

#5 Post by Ryue »

trueheartsdestiny wrote:Thank you for all of the responses! They were very helpful.

Is there a code that would also prevent image files from showing up in the game folder as well? Does this affect the size of the packaged game? It does seem to, but I don't want to leap to any conclusions.
build.classify("**.jpg", None)
build.classify("**.png", None)
.....

Thus for each filetype (aka file ending) you want to be obfuscated you need to include one such line.
But be sure to test the distribution afterwards......some of the methods for accessing files won't work any longer (although that problem is restricted to a handful of commands that probably most ppl won't use anyways, but I wanted to mention it in case you stumble upon a problem there). With testing it you can see if it all functions
as intended (normally like I said it should be no problem as only a few very specific commands are affected).

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: .rpyc files and obfuscation

#6 Post by pwisaguacate »

trueheartsdestiny wrote:Is there a code that would also prevent image files from showing up in the game folder as well?
If you haven't yet, click on "Build Distributions" once (no need to build) to add build information to the end of options.rpy, and you will find archive stuff too at the end of options.rpy.
Last edited by pwisaguacate on Mon Jun 17, 2013 1:56 am, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: .rpyc files and obfuscation

#7 Post by PyTom »

You don't want that - the .jpg and .png files won't show up, but then the game won't be able to use them either.

You likely want to archive the files instead - check out the docs for more on that.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
netravelr
Miko-Class Veteran
Posts: 504
Joined: Thu Jan 28, 2010 2:31 am
Completed: Culina: Hands in the Kitchen, Culina: The Spirit of Cooking, Saving Zoey
Projects: Love at the Laundromat
Organization: Lakeview Interactive
Deviantart: netravelr
Location: USA
Contact:

Re: .rpyc files and obfuscation

#8 Post by netravelr »

As a commercial developer, I'm also wondering where exactly you've seen an instance of someone stealing someone's code and passing it off as their own. I've seen it done for Flash games and the like, but I don't think it's happened to RenPy, as far as I know.

Working with RenPy you accept the risk that someone may have an easier time getting to your source code than others. For the images, you can put them into an archive; but again someone can get them from .rpy files if they really tried. Since all of the functions and code are provided, it's fairly trivial to be able to figure out when and how certain functions are being called through the source. You need to weigh that with your desire to use the engine. I personally don't think it's too much of an issue, but if you have evidence to the contrary, I'd love to hear it.

That being said, you can do things to make it harder for people to figure out what your code is doing; but a semi-skilled programmer would be able to decompile anything made in a publicly available engine, even using something like Unity or Unreal. But it's not something to worry about for 95% of people.

Hope this helps you!
Image
Technical Designer/Programmer
Game Design Portfolio - Project updates on my Twitter
Experienced in: C/C++/C#, Python, Unreal, Unity, and Flash
_________________
"Space can be very lonely. The greatest adventure is having someone share it with you."

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: .rpyc files and obfuscation

#9 Post by Ryue »

Wolf wrote:
trueheartsdestiny wrote:Thank you for all of the responses! They were very helpful.

Is there a code that would also prevent image files from showing up in the game folder as well? Does this affect the size of the packaged game? It does seem to, but I don't want to leap to any conclusions.
build.classify("**.jpg", None)
build.classify("**.png", None)
.....

Thus for each filetype (aka file ending) you want to be obfuscated you need to include one such line.
But be sure to test the distribution afterwards......some of the methods for accessing files won't work any longer (although that problem is restricted to a handful of commands that probably most ppl won't use anyways, but I wanted to mention it in case you stumble upon a problem there). With testing it you can see if it all functions
as intended (normally like I said it should be no problem as only a few very specific commands are affected).
Just had to look twice :/ meant:
build.classify("**.jpg", "archive")
build.classify("**.png", "archive")

that way they are in the archive

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]