Cheats are proving a problem

Sun Jun 13, 2021 6:57 pm

This has been bothering me for years now, but unfortunately, I've never actually found any help on this issue due to some strange belief held by GZDoomers that CHEATS should always be available or unchanged. My game is a stand-alone, non-DOOM related game. It has nothing in common with DOOM except for the fact it runs on the GZDoom Engine. And I have an issue with the cheat codes being available to those who play it.

I do not want people to use cheats from DOOM in my non-Doom game. Last time I asked about this, there was some kind of strict brick wall that nobody was willing to assist me with getting past, and now my game is getting very, very close to release and this issue needs to be taken on, because I'm not going to release it until it is fixed.

I completely understand why cheats may not be looked fondly upon being changed in DOOM mods, and I completely get it. I am in that same camp. They are iconic and important to DOOM and changing them causes people to not only to troll players with bad trap maps but also takes away from its legacy. I get it. Totally. But my game is not a DOOM game. I chose to use the GZDoom Engine because I love the doom "VIBE" while having all the newer features that my own project requires to work the way it was planned. But the cheats from DOOM are not suitable as an option in my game. Giving full everything, invincibilty, walking through walls... these really should not be in my game, at all. It's not what I want in my own game.

So I took the alternate route of trying to figure out some way I can modify GZDoom itself to either replace, remove or rewrite the cheat code system. The most I could do was change the display message when activating these cheats. This didn't help at all. So I tried an alternate, popular option I've seen on other peoples threads. DISABLECHEATS in the MapInfo. This is NOT the method I wanted to use. I wanted my own cheats, no disable cheats entirely. But this didn't even work whatsoever when I booted the game up anyway.

This is a serious problem. I was told last time, that I should leave the cheats, and if people want to cheat that's their problem. Yes, I agree it is. But I should have the ability to decide what the cheat is, what it does and why in my own game. I shouldn't have to have it based on the original DOOM cheats. Those belong to DOOM. Not my game. I had a similar problem with save points, something that offended so many people that I got rather harsh, unpleasant responses when I said I wanted save points rather than "save anywhere". This is a problem that still remains in my game now, over 2 years later because nobody was willing to help me remove the function for a new one, tailored to my own game project that isn't DOOM.

But the focus here is NOT on save points, that's a seperate issue. This one is on cheats. I'm not entirely sure why these cheats (or save points for that matter) are being gatekept because this is hindering the developer from making something original with this amazing open source engine. I would be surprised if people didn't remember what Heretic did with cheats. Using IDDQD in that game caused the player to die instantly. This is a doom engine game, that isn't doom, using a doom cheat differently. Because it is NOT Doom, it seems perfectly reasonable to me that this is the effect the cheat has. My game should have the same freedom (although I will not want any suicide cheats in my game, I used Heretic as an example). I need a solution of some kind, because I really do not want my game released with cheats for an unrelated game still active inside them.

I do appreciate that GZDoom is, at its very core, DOOM, but many game projects have been made using this engine since DOOMEngine, in reality, is an open source engine allowing for developers to make games with it. I'm almost certain a condition of this was not demanding DOOM's cheats remain active within their projects.

Can someone, anyone, please, help me ... even if its in PM and you don't want just anyone knowing how to do it, show me how to replace cheats with my own or switch them off entirely. I can't release my game until I have a solution, and sadly, it's very close to being finished now.

Thanks in advance.

Re: Cheats are proving a problem

Sun Jun 13, 2021 10:31 pm

The thing is, fighting with cheaters is futile. People will always find a way. Even if built-in cheats are disabled, people can load a mod that makes them invulnerable. Or open your WAD/PK3 and put medikits everywhere. Or load your game with custom modified engine version where they have infinite ammo. Or play a game in a virtual machine with save states.

Adding more cheats is doable. Here is an example made with ZScript: (Download ZIP, which is usable as a PK3).
This mod reads player key input, and if it matches "givesoul" or "shotg", gives a soulsphere or a shotgun to the player. I tried to comment the code to make it readable. This way, you can add your own cheat codes with custom behavior. You can also add additional effects to existing Doom codes. My pk3 doesn't override original cheat codes and cannot be disabled by DisableCheats.

Edit: just to add a note, custom cheat codes were already done before. For example, SWWM GZ has them.

Edit2: update: added check for chat commands.
Last edited by m8f on Tue Oct 26, 2021 8:33 pm, edited 3 times in total.

Re: Cheats are proving a problem

Mon Jun 14, 2021 1:36 pm

Hmmm - I think he's referring to the IDDQD, IDFA, etc cheats, specifically, not necessarily the ones from the console. As far as I know there was a feature implemented to disable those. It's called "nokeyboardcheats" and it's available in one of the definition sections, I can't remember if it's mapinfo/gameinfo or iwadinfo.

edit: Okay just looked it up. It's IWADINFO, and you simply add the line "NoKeyboardCheats" it should work.

This, in addition to m8f's solution, should disable the arbitrary iddqd's and allow you to replace them with whatever you want instead.

Re: Cheats are proving a problem

Mon Jun 14, 2021 2:49 pm

Ah wonderful thank you so much.

One quick question. Am I doing something wrong here? My IWADINFO is as follows:


But when I test run, the cheats still work. I imagine I've set the Iwad up wrongly?

Re: Cheats are proving a problem

Mon Jun 14, 2021 3:22 pm

First off - how are you running it on the command line?

Second - is your "allcheats" cvar turned off?

Thirdly - are you running GZDoom or LZDoom? I don't know if LZDoom has this feature or not.

Fourthly - what is your complete IWADINFO like?

Fifthly - I have not tested this feature extensively so I don't know how well it really works.

Re: Cheats are proving a problem

Tue Jun 15, 2021 4:25 pm

I'm using GZDOOM, and the example I posted is my entire IWADINFO. There's nothing else in it. Is that the issue? Did I do something wrong?

I'm not sure what you mean by how am I running it on the command line though. Or what an allcheats cvar is?

Re: Cheats are proving a problem

Tue Jun 15, 2021 4:35 pm

The IWADINFO needs to be fleshed out a bit, I think.

I think this is about minimal, this should get you started:
   Name = "My Excellent Game"
   BannerColors = "a8 00 00", "a8 a8 a8"
   Autoname = "myexcellentgame.official"
   Game = "Doom"
   Config = "MyExcellentGame"
   IWADName = "myexcellentgame.ipk3"

Re: Cheats are proving a problem

Sun Jun 27, 2021 5:28 pm

I also had a problem with custom cheats, but I just wanted to mention that m8f's solution works quite well. Though I shortened the wait time on keyboard inputs. Only issue with it is if you hit the "say" function (whatever it's mapped to on your keyboard) it interrupts the cheat so you can talk. Which might be an issue depending on how you do your cheats. Mine are number codes so it shouldn't be a problem.

Also apparently I forgot my password and can't recover it since I used an ancient email on zdf apparently.

Anyway, thanks for just-about solving this m8f.

Re: Cheats are proving a problem

Thu Jul 01, 2021 6:42 am

Added a check for chat commands. If player typed something, and then hit a chat key, it's ignored. Chat commands still work if pressed separately.
Updated the PK3 in my previous post: viewtopic.php?f=122&t=72552&p=1192380#p1192380

Re: Cheats are proving a problem

Fri Jul 02, 2021 9:43 am

I've been trying to get this to work but for whatever reason I'm still having the same problem. I think I'm way out of my depth here. I really need more help. :(

Re: Cheats are proving a problem

Fri Jul 02, 2021 9:50 am

"The same problem" - which one? Are you referring to my custom cheats or IWADINFO issues?

Re: Cheats are proving a problem

Fri Jul 02, 2021 9:52 am

m8f wrote:"The same problem" - which one? Are you referring to my custom cheats or IWADINFO issues?

Oops! Sorry I should have been more specific. The cheats setup is still giving me problems (most likely nobodys fault but my own lack of understanding). I'm still able to activate cheats with doom keyboard inputs. I think I'm a bit out of my depth. But I can't realease my game without it fixed.

Re: Cheats are proving a problem

Sat Jul 17, 2021 12:07 am

Found my acct...
Thanks for the updated pk3 m8f, your solution is very much appreciated.
Really though custom cheats should be allowed by the engine imo, since there's like 4 layers of back and forth between the author and player to try and tackle the issue. Seems needlessly complex.
nokeyboardcheats -> allcheats -> hiding allcheats from the menu -> console cheats existing anyway... It seems like just allowing console cheats, that work on all iwads anyway, and allowing authors to change the keyboard cheats would make most sense. Especially since GZDoom is practically a standalone game engine at this point anyway.
Still trying to figure out a way to get a noclip cheat working, since you can't run a console command from zscript, and setting a NOCLIP flag via A_changeflag doesn't seem to do anything.
But I made a cheat that spawns a little friendly rabbit, so that's cool. And my invuln cheat makes projectiles bounce off the player. So yeh. Having fun with it.

Re: Cheats are proving a problem

Sat Jul 17, 2021 1:53 am

Noclip can be activated with ZScript like this: ... ice.zs#L46

Re: Cheats are proving a problem

Sat Jul 17, 2021 8:37 am

Thank you very much.
I haven't used much zscript, or even decorate or acs for that matter, so I'm just hacking away over here with whatever tool I can find.