NPCs actually are affected by the dark, detection is based on ambient light as well as many other factors (noise, sneak skill, perception). The problem here is that you're either 100% detected or you aren't. If you're detected then it doesn't matter how dark it is, they know exactly where you are.
I can't do a damn thing about that ...
Hi Hattix,
I have been doing a fair amount of research recently on the detection algorithms used in the game, so perhaps I may be able to shed some light (pun intended) as to what is happening with the seemingly prescient enemies in the dark of night.
You are correct that NPCs are affected by the dark based upon a variety of factors, but its not true that you are "either 100% detected or you aren't". Enemies can be alerted to noise, or other factors, without knowing exactly where you are. You see this indoors with the CAUTION indicator in the hud.
However, it generally feels that enemies are much smarter in the darkness when outdoors.
In fact they are. They are almost twice as able to detect you at night outdoors, than when they are inside.
The reason for this has to do with the way the game calculates detection radius. Indoors in the stock game the variable 'fSneakMaxDistance' limits enemy ability to detect you to about 40 yards. Obviously this would seem too short for outdoors, so the stock game doubles this using an exterior distance multiplier.
Unfortunately 'fSneakMaxDistance' acts as a sort of global sensitivity variable, so doubling the distance also doubles enemies ability to detect you.
It is possible to correct this issue. If you reduce the fSneakExteriorDistanceMult to 1, enemies will have the same detection ability as they have indoors, however it will be at very limited (for outdoor scale) range.
At the risk of sounding self-promoting, I have overcome this problem in the latest version of my own Stealth mod, by nearly tripling the detection radius, while reducing exterior distance multiplier to below stock levels. The result of this is that enemies can detect you at a somewhat greater range than in the stock game, but are actually less sensitive than they would be indoors. I think this makes sense, as there is considerably more ground cover and ambient noise outside.
If you would like to have a look at the numbers, or even give it a try, I have included a spreadsheet with all my calculations in the archive. (http://www.gamesas.com/bgsforums/index.php?showtopic=1070865&st=0#entry15565082)