Page 1 of 2

Is there any anti-cheat code

Posted: Sun Jul 28, 2019 9:05 am
by rayminator
Is there any anti-cheat code or anti-save-edit code for renpy i have look for it by google doesn't show anything and tried to search here it always show a white blink screen that says you have cheated game over

Re: Is there any anti-cheat code

Posted: Sun Jul 28, 2019 11:09 am
by trooper6
If you want an anti-cheat code for your game, you’d have to make it yourself.

Re: Is there any anti-cheat code

Posted: Sun Jul 28, 2019 11:29 am
by namastaii
I'm not sure what you mean. How would the player cheat? Is this specific to your game or are you worried about players editing the script?

Re: Is there any anti-cheat code

Posted: Fri May 29, 2020 10:50 pm
by rayminator
it's just that I want to learn how to do it that all it's just that I'm trying to learn how too that's all

and trooper6 that was kind of being rude I wasn't rude to you in anyway at all

Re: Is there any anti-cheat code

Posted: Fri May 29, 2020 11:38 pm
by prestristan
Hmm.. now this is an intriguing question right here..
I too want to learn about it.

But when you say cheating, you mean, memory manipulation like what "Cheat engine" does?

There's got to be a way to compare if the values have changed.
I did a bit of searching myself and found this:

From reddit:LordAlfredo:
Explanation: When you cross certain points in the game, the game generates a value called "anticheat" and stores it to the Ren'py "persistent" save file. It will also store this value to any saves you create. If you try to load a save where the anticheat value does not match the persistent file's (eg, you try to load someone else's save or one of your previous runs), you will get this scene. At the end of this scene, you're dumped back to the title screen.

This works regardless of whether the "cheating" save's player name matches the current save's. If they don't match, the last screen will show the current save's name - the "cheating" save's name is never shown. This also works for a brand new install - you can try to load a save before you even set your character name. If you do so, your name will be blank.

*white flag*

Re: Is there any anti-cheat code

Posted: Fri May 29, 2020 11:39 pm
by uyjulian
What is your use case?
How would the player "cheat", and what are you trying to prevent?

Re: Is there any anti-cheat code

Posted: Sat May 30, 2020 12:56 am
by rayminator
Well think about it about it money or love something like that how to stop people from changing the variable what they want to do so if they change it.. it changes back to the original where they started at to say they started to love at 10 if they change it to 20 it will go back to 10 or it will cancel the game

Re: Is there any anti-cheat code

Posted: Sat May 30, 2020 1:07 am
by rayminator
what I want to do is that If anybody change the veritable will end up in a very bad ending like death

so if love is at 50 and someone change it to 100 the game will fail

I'm am learning how to do thing on me own but I 'll do need help on thing I need help on but I'm just for a example on how to

Re: Is there any anti-cheat code

Posted: Sat May 30, 2020 2:49 am
by Per K Grok
rayminator wrote: Sun Jul 28, 2019 9:05 am Is there any anti-cheat code or anti-save-edit code for renpy i have look for it by google doesn't show anything and tried to search here it always show a white blink screen that says you have cheated game over
If what you want to achieve is to prevent a player from going into the script files and change variables in the script, another way to go is to archive the script-files in the build options.

build.classify('game/**.rpy', 'archive')
build.classify('game/**.rpyc', 'archive')

It makes it harder for the user to make that kind of changes (but not impossible).

https://www.renpy.org/doc/html/build.html#archives

Re: Is there any anti-cheat code

Posted: Sat May 30, 2020 4:21 am
by akio93
I agree to above me. The only solution you can do is to archive the files if you don't want players to access your game script.

But if you really want something like you're describing, i think 'Save the date' is a good example when a player open the game files then changes something on the script. They get a fake happy ending instead of really saving your date.
There's also '[redacted] life' that uses the same tactic but opposite. You have to 'hacked' the game to win the game. I think doki doki game also do that but I never played the game so I'm not sure.

Re: Is there any anti-cheat code

Posted: Sat May 30, 2020 4:34 am
by isobellesophia
Similar to DDLC, can be cheated however, only when you restore the deleted files by the character Monika, and after when the player loads a save, the character will be prevented on continuing the game and it will be pushed back to the main menu or forced to quit the game completely, its kinda hard i would imagine.

Re: Is there any anti-cheat code

Posted: Sat May 30, 2020 10:33 am
by rayminator
I know all that but look at bright past
https://www.patreon.com/kosmosgames

he or she figured out how to do it courage if someone changes the number it resets back where it was

Re: Is there any anti-cheat code

Posted: Sat May 30, 2020 10:54 am
by uyjulian
One way to do that is to store a calculated variable.
Example (if original variable is a):

b = a * 2

Where a is used, you can do this instead:

b / 2

This means that it is more difficult to change the variable when you don't know how it is calculated.

Re: Is there any anti-cheat code

Posted: Wed Jun 10, 2020 8:40 pm
by rayminator
it just that I want to learn how to do this that's all I just need a example of it that all

Re: Is there any anti-cheat code

Posted: Thu Jun 11, 2020 12:49 pm
by rames44
Essentially, you can make this harder for the casual player by being tricky about how you store your data, having multiple copies, using checksums and the like, but, at the end of the day, you can’t completely prevent it. People can recover your Ren’py code with decompilers that are out there, analyze what you’re doing, and then either just call your functions from the console, or recreate what you did, or disable your checks, etc. This is similar to DRM - everything is in their hands, so you can’t totally prevent it, just give them more hoops to jump through.

Ren’py isn’t unique in this respect, by the way. Unity has the same issue, since it’s possible to decompile C# with relative ease. My advice? Don’t worry about it. If they want to cheat, they’ll cheat. Not your problem. Give them something they’ll enjoy (whether by cheating or not) and your job is done.