Ren'Py Hiding NTR secrets from code readers (mainly for REN'PY) - authors please read :)

CobraPL

NTR PALADIN
Donor
Sep 3, 2016
2,020
4,047
So, guys we know that:
1. In REN'PY we have two types of end-users. Players and code readers.
2. Authors publish their games unfinished (Patreon, beta, alpha, intro,. etc.)
3. Good NTR often contans "Mystery NTR" elements. For example, during game's opening certain girl MAYBE fucked with other male (and what exactly she did wtih him?). While official/visible/uncovered sex should (in NTR) start at 33-66% of the game, after player attaches to females.

So, if author leaves answer for question - DID SHE FUCK? - in the code, it could spoil game for many.

So, I think, authors should take steps to prevent that.

Solution I found:
Parameters like girlclass.sex=+1 or append to diary like "Prince fucked me" can be stored inside secret1() function (EDIT: Or just jump to label.) in another rpy file. There will be two versions of that file. Internal usage with proper function and beta file with bogus one. Until it is relevant, players will receive code with bogus one.


Savegames will be incompatible, but they already are for 90% of REN'PY games new versions. For me, it is worth it.

What do you think?
 

blubbat0r

Newbie
Donor
May 8, 2017
30
102
I you don't want to spoiler yourself don't purposely look under the hood/behind the curtain/whatever. I don't see why devs should spend more time and effort on an arguably convoluted solution for a problem that's not really a problem if you just... well... play the game.

If you look at the code of a game, the wiki for a story or comments on movies online or anything of the sort you're gonna spoiler yourself. That's your problem, not the problem of the people creating the product.
 

CobraPL

NTR PALADIN
Donor
Sep 3, 2016
2,020
4,047
I you don't want to spoiler yourself don't purposely look under the hood/behind the curtain/whatever. I don't see why devs should spend more time and effort on an arguably convoluted solution for a problem that's not really a problem if you just... well... play the game.

If you look at the code of a game, the wiki for a story or comments on movies online or anything of the sort you're gonna spoiler yourself. That's your problem, not the problem of the people creating the product.
You forget people doing stupid things and people spoiling others game.
 

DarthSeduction

Lord of Passion
Donor
Game Developer
Dec 28, 2017
3,360
5,241
So, guys we know that:
1. In REN'PY we have two types of end-users. Players and code readers.
2. Authors publish their games unfinished (Patreon, beta, alpha, intro,. etc.)
3. Good NTR often contans "Mystery NTR" elements. For example, during game's opening certain girl MAYBE fucked with other male (and what exactly she did wtih him?). While official/visible/uncovered sex should (in NTR) start at 33-66% of the game, after player attaches to females.

So, if author leaves answer for question - DID SHE FUCK? - in the code, it could spoil game for many.

So, I think, authors should take steps to prevent that.

Solution I found:
Parameters like girlclass.sex=+1 or append to diary like "Prince fucked me" can be stored inside secret1() function (EDIT: Or just jump to label.) in another rpy file. There will be two versions of that file. Internal usage with proper function and beta file with bogus one. Until it is relevant, players will receive code with bogus one.


Savegames will be incompatible, but they already are for 90% of REN'PY games new versions. For me, it is worth it.

What do you think?
You're right, the content for the NTR shouldn't start until after the first act. So why does it matter if the girl had sex with someone else before then? Unless said girl was already in a relationship with you at the beginning then it wouldn't be NTR. If she was already in a relationship with you at the beginning and they're trying to shove us into a situation where she's already unfaithful, then maybe, but why make that a variable? It can be something you slowly hint at as time goes by over the course of the first act and then at the end of that act reveal it to be the truth without ever using a variable. Unless the implication is that she only fucks this guy if we do something wrong, in which case, you simply name your variable innocuously, like "default ch1_label_pass = False" and change it to true if you pass it. No need for the variable to spoil anything.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,190
Solution I found:
Parameters like girlclass.sex=+1 or append to diary like "Prince fucked me" can be stored inside secret1() function (EDIT: Or just jump to label.) in another rpy file. There will be two versions of that file. Internal usage with proper function and beta file with bogus one. Until it is relevant, players will receive code with bogus one.
And how you'll achieve this exactly ?

If both files are present in the distribution, then Ren'py will overwrite one function/label with the other one. While the author will have the possibility to decide which one will be overwrote (the one in the rpy file read first), he have no way to revert this overwriting. The only thing he can do is to rename the files, and force a reloading of the game, which can lead to problems sometimes ; the reloading feature of Ren'py is for developers only and shouldn't be used in prod.
And if both files aren't present in the distribution, then Ren'py will have to download the correct one, which will need that the author have his own web site ; and I mean not just a blog, a real site. Yet Ren'py will still need to reload the script ; see above.
There's a way to overwrite by yourself the function/label, but it will imply that, at some place in the code, it will be obvious that "this function" now replace "this one". But well, anyway it will be obvious in the code that suddenly "this file" now replace "this one"...
The only way that will works, is that the regular file will replace the bogus one... in the update where the scene will effectively appear. And here, why bother with two files, when you can simply not wrote the useless code that will be used only ten versions in the future ?

No, the only way to do is to use a .py file and to only distribute it's "compiled" version ; by example like I do with my mods/tools. Yet, it's not a one way thing and you can easily retrieve the code source, so know what the author search to hide.
The only advantage of this solution is that, while any player can learn that unren.bat exist and use it to access the .rpy files, few know how to revert a .pyo file into its source ; and installing the needed code isn't as obvious than installing unren.bat. The need for a most advanced knowledge generally imply that the player will respect the decision of the author ; "this is clearly hidden... To avoid being spoiled, I'll not look at it until I've finished the game".


Savegames will be incompatible, but they already are for 90% of REN'PY games new versions.
Er... I don't see why your solution would imply save incompatibility. Oh, by the way, 99% of Ren'py games could achieve save compatibility if the author really want it.
 

CobraPL

NTR PALADIN
Donor
Sep 3, 2016
2,020
4,047
Guys, I still remember how someone spoiled that Eric fucks Kira in BB. Yes, he used SPOILER (nested). But temptation is too big.

I have secret.rpy with secret labels. Production file will contain bogus data.
 

DarthSeduction

Lord of Passion
Donor
Game Developer
Dec 28, 2017
3,360
5,241
Guys, I still remember how someone spoiled that Eric fucks Kira in BB. Yes, he used SPOILER (nested). But temptation is too big.

I have secret.rpy with secret labels. Production file will contain bogus data.
I still don't see why you need to include a variable defining it in plain terms. In the case of Kira, the variable should have probably been along the lines of "MC_Fucks_Kira_bondage" As long as that has been tripped, the scene where Eric fucks her would be available in that release.

If you're complaining about spoilers from within the current release, then you're the one making the mistake of reading a games thread without playing up to date.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,190
I have secret.rpy with secret labels. Production file will contain bogus data.
If the game can work with bogus data, then it can works without these data. Just don't include them and you'll achieve the exact same result.

If the data are needed for this update, then :
  • at one point Ren'py will have to download by itself the secret file (don't expect it to works on my computer and many others) ;
  • you'll need your own site (and not just a blog, a real hosted site) to achieve this ;
  • you'll risk to break the game by forcing Ren'py to reload the source ;
  • if you don't be careful enough, you'll messed it and Ren'py will still use the bogus data.

If you use a compiled Python file for the data, you don't need a "bogus file", you can include the file from the start, and less that 5% of the players who'll look at the code will be able to effectively see your code.
But you can even achieve the same without the need of a compiled Python file, and have your code in plain sight while still being not understood by more that 75% of the players who will look at the code. There's many many way to obfuscate, more or less efficiently, the code, this even if none is effectively irreversible. Like I have no intent to pass a full day deciphering a game I want to mod, I'll keep them for myself, just giving the easiest one as example :
Code:
define obfuPict = [ [ 110, 116, 114 ] ]
define obfuDial = [ [ 84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 115, 116, 117, 112, 105, 100, 32, 105, 100, 101, 97, 46 ],
                            [ 73, 32, 107, 110, 111, 119, 46],
                         [...] ]

init python:
    cleanIt( l, i ):
        return "".join( [ chr[ f ] for f in l[i] ] )
label you_will_never_expect_this:

    scene expression cleanIt( obfuPict, 0 ) + "Pict1"
    girl "[cleanIt( obfuDial, 0 )]"
    guy "[cleanIt( obfuDial, 1 )]"
    scene expression cleanIt( obfuPict, 0 ) + "Pict2"
    [...]
Note: wrote on the fly, it works, but perhaps not as it.

All this said, the problem while still be exactly the same whatever the solution used ; even your solution. I mean, the problem is not that the code is readable, but that you can't see a spoiler without looking what behind it.
As long as someone have played the update, whatever how much the truth can be hidden in the code, there nothing preventing this person to go on the game's thread and write a spoiler saying what he saw while effectively playing the game ; "hey, you know what ? This girl fuck with this guy if you do that".
And like you apparently have difficulty to contain your curiosity, if he played the update before you, you'll be sent back to the start of this thread.
 
  • Like
Reactions: forbidden101v

forbidden101v

The Hentai Witcher
Modder
Jun 2, 2018
802
7,425
Have to agree with anne here. You can never stop spoilerfags from trying to spoil things for others. Honestly devs should put their time into making the game better than trying to make it harder to hack. I understand making such systems for fun but beyond that it should only be used for information thats truly sensitive like credit card info or for online gameplay.

Best course of action is to avoid reading the game thread before completing the game if people don't want to be spoiled.