How to prevent readers from "cheating"?

Hello, everybody and thanks for taking your time to read this.

I know people like to cheat. I never did this in a CS-Game however, I understand the argument that it’s nice to know where a choice leads or what’s the right answer to a question. From time to time I saw in some topic that some players look at the code while playing so they have this advantage. Everybody can play the way they want.

But I really would like to make a riddle that can’t be solved without the intended thought process by the player and connecting the puzzle pieces. Also, I know that hiding content is probably a bad idea. However, the content I want to hide wouldn’t be a major plot part and rather a small reward for players who take the time to read between the lines.

The only solution I can think of would be something like this:


*input_text riddleans
*goto_scene riddle
*label riddleend

*if reward = 1
    Some text describing the reward
    *goto rewardend

*label rewardend

Usual story content


*if riddleans = "randomtext"
    *set reward 1
    *goto_scene chapterx_eventx riddleend
    *goto_scene chapterx_eventx riddleend

I thought with this the player won’t be able to look at the code since he never stays inside the riddle.txt and there is no variable which contains the answer in any other file the player is able to reach. However, there is still the possibility that someone can enter the file itself. But I guess if someone goes this far he really is desperate to know what is behind the locked door.

I would be amused and satisfied with myself since I at least forced the player to put some effort to solve the riddle. I guess that would be the savage way and something like breaking a lock with brute force instead of finding the key. With all that said I wanted to know if there is a better way to achieve my goal or if I should just accept the fact that some player will cheat.

The answer is to never publish a game.

This answer is not meant to be flippant but its the truth all game-designers included Choice developers need to internalize. The sooner the better.

Just as I tell everyone to expect people to look at their code - it is something that will happen to everyone.


Ha ha, accurate enough. Short is that no matter what you do, it’s just not going to be enough.

But like hypothetically there’s a couple of things you could try if you’re only interested in hiding information, although none of them are too fun for an actual game. For example, you could build a coder/decoder and keep all the ‘hidden’ material in variables? Like, that’s not too high on the jumping through hoops part if you leave it at that, but to put the bar even higher you could also make a ‘key’ that has to be input that alters the decoder (so the ‘correct’ input to decode the variable isn’t stored anywhere).


The only you will achieve is or They trying google it or just quit the game and not playing more. People who love cheat wants to cheat and buy games for cheating so if they can’t the only you will achieve is they force your files and end with a pirated copy. So just let them entirely enjoy their cheating they don’t harm anyone.


What’s to stop someone from publishing a walkthrough with your solution?

If you unpack a game, like say on Steam, you get access to all of the files. It’s easy enough to see what all the game files are and thus read them. Even ignoring that, it’s easy enough to notice a *goto_scene go “hrm that’s not on the scene_list” and then go check out what’s there.

Usually I play the game through straight the first time, without reading the code. I like playing games. Unless I get really stuck, and if I’m getting really stuck and frustrated then my options are read the code in order to continue, or quit the game and complain about the puzzle being too hard.

Incidentally, if you want your testers to play the game, without reading code, just ask them to. I’m sure most will be pretty good at doing what you ask, especially if you’re trying to gauge the difficulty of a puzzle.


I had to grin because this answer is so perfect. :+1:

I thought about something like that however at the same time I think that’s a bit over the top. I just want to hide it in a usual playthrough. So if someone is able to open the file itself like FairyGodfeather described it I wouldn’t mind. I just want the player to put some effort into it.

To give an example of the impact of the riddle. It would be like a parent asking their child which just started learning about numbers what the result of four plus three and this divided by seven would be. And if the child gives the correct answer it gets a cookie before dinner. Since I don’t want to hide a major part or important part behind the riddle I doubt people would stop playing the game.

Like I mentioned earlier I don’t mind if someone takes the effort to do this and finds the answer. I just want to hide it from the “easy” way to cheat. Also, like I mentioned before no matter if you got the right answer you will be able to continue the story. You only miss some little extra reward. For another example, it would be like some extra EXP by reading a document or giving an NPC an item that they need.

And if someone solved the riddle and wants to make a walkthrough or just give people the answer I won’t complain. I would be rather honored if a person enjoyed the game so much she/he thinks other people should be able to experience every part of the game and a walkthrough is born this way.


I am a role-playing I not cheat but some people want cheat and buy this as a game . Is like a game developer forbidden all cheaters encrypt they code to that. What they would achieve is angry those fan base . Let them enjoying the game as see fit. Really they will do that anyways.


I don’t think most people actually read the code.

The forums are a tiny amount of the player base for any game. Even on the forums those of us who look at the code are in the minority. And the people who do it to cheat? I’m not sure. We’d need to create a poll for that.

If it’s so small and unimportant why not just leave it there? If you really must put in a comment in the code file.


That would be such a fantastic meta concept to include in, say, a spy game. That’s rather an exciting thought, actually. Thank you for mentioning this possibility!

I love this idea too. I hadn’t thought of that. Now I can picture the Narrator of one of my games inserting something like *comment "I SEE YOU, CHEATER! STOP RIGHT THERE! POLICE!" right into the code. How fun! The coding version of ‘secret’ tracks back in the pre-digital days (and today too, I suppose).


I like seeing authors comments in the code files. :slight_smile:


@FairyGodfeather @Fiogan

The comment thing sounds pretty funny. I really would like to give people who watch at the code at the specific part an achievement called “Cheater” but I guess a comment will do. :joy:


The way to give a cheater achievement, would be to make a comment, in the code offering a password, and then, have an input text box, somewhere, (might even be for the name) where if they input the password you gave them, it unlocks the cheater achievement.


My code tends to be littered with these kinds of comments.


Now I feel like I should start a whole onesided conversation with the code reader. Maybe talking about my thoughts and how I feel about certain choices. That sounds like a lot of work but with the same amount of fun in it. Also thanks for the idea with the cheater achievement. I think this will do just fine. :+1:


I only started to read the code very recently, and for two reasons: learning/perfect choice of script coding skills and giving proper feedback without having to play the beta version a thousand times.

And I only do it with WIP. Never used it to “cheat” (well, in Guns of Infinity I kinda wanted to, but never did, the game was too good for using the easy way out). But I can only speak for myself.

And yeah, code readers seem to be a minority of a minority.


Well, putting a game-mechanic that’s so confusing “may” stop the cheaters cheating your game, unless those guys are totally dedicated themselves to cheat your game.

This is a fun idea. I may have to use it, but not for an achievement. I’ll give you credit if I do.


I nicked it from @FairyGodfeather really, though, so credit where it’s due. Thanks though, I appreciate the thought!


I try to do that too, like with Sun and Moon, where my first character ended up an “Angel” without me peeking. However on subsequent attempts I will usually read the code and the number of people who will read your code is likely to be the highest at these particular forums and since a forum beta is a requirement for a hosted game, I believe there’s no real way to stop it, as previous posters have said. You could do what @RETowers said, but that seems to me to be a whole lot of work for very little reward and people certainly on these forums but also on Steam and the other platforms will eventually share walkthroughs and things like “let’s play” on Youtube.
There’s also the fact that many people on these forums are wannabe authors themselves and peeking at other people’s code can be a great way to help them learn, though @Havenstone’s occasionally gives me a headache, for example.

Well with a bit of help from the Tiger I plan to mod the upcoming release version of @Havenstone’s game with my “it’s raining men” mod to gay things up, that basically should flip every gender flippable, romanceable or even character you can just flirt with to their male form. :wink:
But like @FairyGodfeather said that is just one game and I’m a tiny, tiny minority of just one person. :sweat_smile:

Now let’s just hope I can figure out a way to import modded saves into game two in another couple of years, or I may have to write a custom import scene that tailors the variables to my canon character, but that would be a lot of work.


Sorry about posting in an old thread.
I believe this thread to still be relevant to future game development so…
Here’s my entry on how to prevent players from cheating by looking at the code.

Here is a super basic example:

*temp anticheat 0
*temp passcode 0

*rand anticheat 999 999999999

Hello, this is an anti-cheat test.

Please enter the password.

*input_text passcode

*if passcode = anticheat
 The passcode is correct!
*elseif passcode != anticheat
 Sorry, wrong answer.

In this example, we do not have to rely on complex methods like trying to use a cipher to encode or decode information, nor do we have to worry about obfuscation by going to obscure scene files, or anything of the sort.

The way this works is by simply having the game engine randomly generate a key.
We then use that key as a password.
This way the player cannot possibly know what the key is unless they find out naturally by going through the story.
The only other way to find the key is to be able to see into the game’s data as the game itself is running.
This is, I’m assuming, beyond the scope of most players.

Here is an actual use example:

*temp anticheat 0
*temp passcode 0

*rand anticheat 999 999999999

*label mainmenu
Hello, this is an anti-cheat test.
Please enter the password.

 #Enter the Password
  *goto thepasscode
 #Wait! Let me do research first!
  *goto research

*label research
You do a bunch of plot stuff and somehow research the password.

The password is: ${anticheat}

*goto mainmenu

*label thepasscode
Please enter the password.

*input_text passcode

*if passcode = anticheat
 The passcode is correct!
*elseif passcode != anticheat
 Sorry, wrong answer.