Some games have cheat codes in them, but I'm not sure I want to add some to mine because I fear they'll ruin the game by making it too easy to beat.
What would be the advantages of putting cheat codes into my game?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
One major feature is that they make debugging easier.
If there's a broken puzzle door that's not unlocking, and you can bypass it by clipping through the walls, or skip past some tough combat with invulnerability and an insta-kill weapon, or shortcut the economy grind by giving yourself infinite money to make sure the last-game purchaseables all work, you've saved yourself a lot of time! Being able to manually spawn an object or character you need to test on demand, rather than finding them organically in the world, can be another huge time-saver.
Without these ways to break the rules, then if the rules themselves aren't working in one part of the game, you can be blocked from testing everything else in the game that depends on or comes after the glitched part (something we call a "walkthrough break," one of our highest priority classes of bug)
This is especially important on large teams where even once you find a bug and someone is actively working to fix it, other developers and testers can be blocked from doing their work, massively slowing down development. Being able to cheat around small issues gives some insulation against this kind of deadlock.
Here's a tweet I spotted today from @Ed_dV that illustrates this nicely (click through for video):
Made a little floating window with all of my debug tools, cheat toggles, time of day slider etc. I can't believe I didn't implement cheats earlier - noclip/fly is vital in the early bug-ridden days.
(Of course, you must still follow-up with cheat-free playthroughs whenever possible, to make sure it's not just the cheated version of the game that works)
Once you've put in the work of developing these cheats, there's often little to no cost to leave them in for players, accessible by a secret key combo, cheat menu, or debug console - as long as the game is single-player so they can't be used to interfere with other players' games.
These codes can be a delightful easter egg for players - how many times have you tried entering the Konami Code on a game or website, just to see if it would do something? A lot of us have fond childhood memories of no-clipping through walls in DOOM or giving ourselves all the weapons in GTA, or spawning so many rings and springs in Sonic the Hedgehog that the framerate stuttered. :)
If you give out the cheat codes in-game as rewards for solving difficult challenges, it's an impactful prize that's reasonably cheap to implement, compared to giving the player a new ability or item that needs to be balanced against the rest of the game. With cheats, there's a tacit understanding that it's allowed to break the balance or fiction, in an opt-in way. And it lets players feel elite, entrusted with secret knowledge (which they can share with their friends for social cred too).
Lastly, these can provide additional accessibility for players who, for medical or other reasons, might not be able to get to all parts of your game on their own otherwise. If it's the difference between a player enjoying a lower-challenge version of my game than I'd originally intended, versus not getting to enjoy my game at all, I'd rather offer them that lower-challenge version, to the extent that they want to use it.
And for the most part, cheats don't negatively impact the players who dislike them. Players are very good at challenging themselves - for example, opting into difficult "Ironman" or "Nuzlocke" play styles even when not enforced by the game's rules. So players who want a difficult experience generally don't use or even look up the cheat codes.
Yes, you totally should have cheats in your game.
~to open the console, enter
SETVAR QUEST_7457_COMPLETED 1and you can continue playing". Which answer would have a better chance to get accepted? Here is a literal example.
And all that for a feature which usually does not cost you a lot of money to add because you usually add them anyway for debug purposes.
Regarding your fear of breaking immersion and making the game too easy: Players are fully aware that cheatcodes are not the way the game is meant to be played. They understand that using a cheat can harm their game experience. They will only use them when they think that the game is more fun that way. And when it turns out that the cheatcode breaks the game, they are aware it's their own fault they cheated and will disable them again.
An exception are of course multiplayer games. You don't want any player to ruin the other player's fun with cheating. But even multiplayer games can obtain a lot more variety if you have cheats which can be enabled by the server admin and apply to everyone equally. Reducing the gravity in a first person shooter, for example, adds new navigation paths to the old maps and thus completely changes their game experience. The game experience might not necessarily be objectively better, but it is different. And differences in gameplay are what creates long-term motivation.
What's most important is that the players enjoy themselves playing the game, even if it breaks "your game". Showbiz is about the audience's enjoyment.
Hiding the cheat codes rather than putting them right in the option menu is a compromise between allowing some players to adjust the difficulty while at the same time officiating the game's original vision of "how it should be played" by putting a small obstacle to enabling the cheats.
Some cheat codes can also be created just aesthetic for entertainment purpose (easter eggs) and some cheat codes can be created to actually make the game more difficult.
But there are more "practical" reasons than simply adjusting the game difficulty:
Keep in mind that "cheat codes" don't necessarily have to make the game easier. You can have "cheats" that do cosmetic changes, like making all the enemies have huge heads or making your gun shoot paintballs. They could make the game harder, by making enemies tougher or move faster. Not every cheat code has to be unlimited ammo or God Mode. Adding this type of cheat to a game provides some variety for players who are getting tired of the normal game mode.
Additionally, not all cheats have to be readily accesible. Cheats can be a reward for accomplishing certain things in the game, further adding replayability. This ensures that players will experience the game "as intended", and will only be able to use the cheats after becoming familiar with the regular game.
My frame of reference for this answer is the classic N64 game GoldenEye 007, in which cheats are unlocked by beating a level under a time limit. These cheats can make the game easier, harder, or just different. I know I spent many, many hours just unlocking the cheats. To be honest, I don't think I actually played with the cheats on for nearly as many hours as it took me to earn them!
Once upon a time, I played a very fun game called Kittens, by bloodrizer. It was super fun. It's an incremental game where your kittens collect catnip and also take over the galaxy (as tends to happen after consuming catnip.)
I shared my code, and while the creator couldn't do anything to stop it, she certainly wasn't going to support my position. She considered it cheating. I fundamentally did not see it as cheating - I simply found, and this is key,
a different way to experience the game. My enjoyment from the game was in figuring out the maximum efficient way to play it. It wasn't the progress I wanted, it was the zero tick waste.
Cheat codes allow your users to experience the game in different ways. Playing Quake 1 on
noclip was super fun. It doesn't take anything away from the game unless a user wants to - and it's their fun that you want, so don't try to limit it. If people want to enjoy the game as you released it, they will simply play without cheats.
Naturally, this implies they can't hurt others. If I want to play multiplayer, either we all get cheats or no one gets cheats. And really, make it no one gets cheats because multiplayer godmode just seems boring after a few minutes. Or maybe it's not, who knows. Test it - go nuts. HAVE FUN.
Something not touched on by others, is that adding cheat codes also allows players greater agency in the game, as they can play in a way they find fun, without it being the "intended" way. The Sims is a good of this for the "casual" crowd, in that the money cheats are mostly universal; if you've played one The Sims game, you know the code, and how to access it. The game suddenly evolves from a "life simulator" to a House Designing game (Which is ironic, given that, that is what the "game" was initially).
I think GTA V, is a more action oriented example. Various cheat codes allowed the early modding, from my understanding, which allowed people to come up with crazy new activities. I also imagine many of the stunt jumps shown on Youtube, are initially setup using cheat codes (or other forms of hacks), to allow a fast reset and new try. Suddenly, you have a fun activity that's sort of new (They do have stunt jumps, yes, but many of the ones shown on the 'net are new and crazy ones)
"Cheat" codes can have two main purposes:
Easter eggs, which allow cool stuff in the game, like changing a character skin, game speed, difficulty etc. This is mostly just for fun and to improve the replay-ability of the game, which used to be part of the magazine review rating back in the day (before the internet). These eventually evolved into "unlockables", and then into downloadable content. This is 99% of cheat codes now.
Unpublished features, which while cool, were useless, too powerful, or just broken, and so were never part of the final game, though remained in the source code. This came about because games used to be made on chips, to be put in cartridges for consoles. Adding or removing data from these chips was expensive, and source control was virtually non existent at the time, so codes were used to enable or disable features. Due to deadlines, some of these features were never officially published, but remained on the cartridges. Later, these codes got leaked, and people started messing around with them. Nowadays this is only possible on the pc, where modding is possible via scripts and command lines, to gain access to, and change, the game state in-memory.
As a game hacker, the existence of cheats in a game deters people like me from reverse engineering your game to manufacture cheats of my own. Take, for instance, a game like Skyrim, which allows a player--via the in-game console--to do just about any and every generic type of cheat: health, money, ammo, attributes, levels, etc.
So, if people reversing your game doesn't appeal to you, then adding cheat functionality in yourself is a good way to deter that. On the other hand, not adding cheats can be a good way to gauge how drawn people are to cheating your game in the first place. That data can be valuable on its own merits, provided you're interested in it.
Cheats could be also very helpful for presentation purposes: e.g. you want to show key points of your game quickly, without having to play through all the tough parts. This is especially helpful, if your game is hard to play and you won't bore the public with a lot of death, before you come to the interesting part.
In this case you can decide, either to code some additional user interface with buttons, that allows you to "teleport" yourself to the interesting part of the game, or you implement this game mechanic in the old-style way, using e.g. special key-bindings.
You should of course remember to remove this mechanics when you decide to release. Alternatively you can also reuse them, if you add to your game "story-mode"-difficulty, that allows you to skip the hard parts. But this is up to you to decide.
Most of the cheats and cheat codes that are put into games are for legacy reasons. Long before we could just Google or YouTube how to open a door / defeat the boss / get to the end, a player who weren't good or patient enough to do these things would usually give up and not play the game any more. Putting cheats into them made it so that any player could complete the game.
These days they are still put in but much less frequently. You're more likely to find an Easter Egg than too many cheats.
To be honest, I have rarely used cheat codes - apart from some bugs, that I have encountered, but it was only when I was playing a game soon after a release. Afterwards, when they have already patched the game and fixed the bug, I very often went through the mission again, so I'm not labeled a "cheater" by myself. Also, if somebody has some disabilities and still want to play a game, cheats may turn out to be very helpful. For example I have a friend, who was playing GTA:SA with a broken arm. Of course he couldn't play for too long and his mouse movement was heavily limited back then, but he still wanted to play it because all of his high school buddies were talking about it, so he had to use cheats - of course he never told anyone about it except for me as I was his closest friend back then. So yes, cheats should be included in every single game, you can't even imagine how helpful they can become in this situation and after all, it's optional and up to you whether you use them or not, so I don't see anything wrong with them being implemented. Rather than that, I would prefer game developers to make harder games - with cheats included for people, that simply want fun or are unable to finish the game, but without forgetting about old-school gamers, which are used to spending a whole day grinding one mission ;)
I would say that adding cheat codes is to some degree useful if you cannot beat the game or if you get stuck. That is a pretty good reason to put cheats into a game. However, I've actually seen cheat codes go a bit further.
In one game engine I'm a bit familiar with there is a function that takes in some ascii string and will execute it as if it were compiled code. I think it was put in as a means of implementing lambda expressions if you've ever heard of the term. Regardless, someone decided to be a bit clever and put in a box into their game that you could enter such code into. The nice thing about it was that you couldn't just cheat the game with it. You could also load in external scripts, code up your own enemies or bosses, and just make fun stuff to add to the game. So I would argue that for games that are more action-based like platformers or general adventure games that cheat codes can be a fun way of having a sort of "post-game-content" feel. Someone might make a cheat code (if your system is sophisticated enough) that lets you fight some boss battle in the overworld rather than a dungeon or other location it was fought at. Some people find such a "mod" interesting. Furthermore, if there are cheats to give you infinite lives or health, some people might like that as a convenient way to just explore once they finish the game and just want to "check things out".
Of course, there are the gameplay advantages but I don't think cheating to give a player a handicap isn't the only purpose. After all, if something is too hard there are more fluid ways to make it easier if they successively lose (such as something appearing to let them skip that mission with a penalty of not completing it on the initial pass or something) or just get tired a section. Cheat codes shouldn't be an excuse to not cater the game to varying levels of skill, but sometimes it is just fun to run around shooting 20 bosses at once in the overworld while riding in a mech suit*.
However, there is such a thing as too many cheats or going a bit too far. I'll elaborate on that example. See the following screenshot from the game.
You can enter literally any line of code that is valid in the engine it was made in. That's a serious problem though as it can exploited as a security breach. In lamen's terms you better not let anyone trying to break into your computer gain access to that thing because then they pretty much own your computer. Granted, in that case they'd already need to be using your mouse and keyboard so it's a bit esoteric of a way to break your PC, but irregardless similar things can occur. Hence, I would warn one not to make a system too advanced because then it might become a means of transmitting viruses hidden in mods or whatever.
Just don't go overkill or at least don't give cheat codes access to file input and output arbitrarily.
*I've never actually tried doing that.