Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

In almost every game I've come across that includes a dark situation designed to change the way a user interacts with the environment, there are always some players who turn up their monitor's gamma correction in order to negate the desired effect.

Is there a way to prevent users from adjusting their gamma correction to 'cheat' their way out of a challenge? (the darkness)

I'd imagine if you could reliably retrieve the current gamma correction of the user's monitor, you could use that to more or less prevent the advantage it would otherwise grant without causing the normal users any inconvenience.

share|improve this question
14  
Is this for a multiplayer game where I could gain an unfair advantage? If not, as a player, I'd much rather you left my display settings alone, thanks. –  Alex M. Jun 18 '13 at 0:24
3  
Just as Cong Xu stated, you get minimal effect adjusting the gamma because it only changes the brightness of what's actually visible. If you don't want something seen, draw it completely black and there will be virtually no way for the player to cheat by adjusting the gamma. –  CPP_Person Jun 18 '13 at 2:09

4 Answers 4

up vote 38 down vote accepted

If you absolutely need to control whether the player can see something or not, possibly for multiplayer anti-cheat or if it's key to your game mechanics, then completely obscure them. This way no amount of gamma correction will make them visible.

Not the best example, but in Closure, areas not being lit are in complete darkness:

enter image description here

... if you could reliably retrieve the current gamma correction of the user's monitor ...

Please don't go down this path; there are many reasons - other than cheating - for correcting gamma; maybe the player has poor eyesight, or a bad monitor, or is playing during the day. Please respect your users! Don't let a few cheaters/pirates/what-have-you ruin the experience for everyone else.

share|improve this answer

There are a couple of Windows API functions that might do the trick: SetMonitorBrightness and SetDeviceGammaRamp. However, this will be hardware-dependent; probably not all monitors support setting the brightness programmatically, and different monitors may produce different results, etc.

Moreover, it doesn't sound like a very good idea. Locking the gamma/brightness to some fixed value will surely annoy your players, and very probably render the game unplayable for some, because it happens to come out too dark (or too bright) on their setup.

Ultimately, if it's a singleplayer game and the player wants to make the game easier for themselves, that's their right. Why should you stop them? If it's a multiplayer game, then other strategies are needed, such as only sending the player information about events close enough for them to see or within their flashlight beam, or something of that nature.

share|improve this answer

What I'd suggest is adding a small amount of white noise to the rendered output. In bright scenes this won't be visible, in dark scenes with ordinary gamma setting it's similar to what cameras or the human eye actually do in reality. But for someone who cranks up the gamma, this noise would be a strong nuisance. Not only won't dark objects become properly visible, the boost of the low-range noise will then also distract from bright objects; so it should sufficiently discourage people from doing that.

(Of course, very clever guys might still come up with sophisticated de-noising techniques, but those are at least not available in ordinary monitors)

share|improve this answer
    
an example of this technique is the flash game don't escape –  user1937198 Jun 20 '13 at 15:25

Given the random brightness/contrast/gamma of the user's screens, not the mention the room lighting where the user sits, there's no reliable way to make something that will be "just visible enough" or "just invisible enough". If you want something to be invisible, make it black. If you want to make something ambiguously perceptable, you have to accept that some players will have a better opportunity to see it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.