04 May, 2014, wifidi wrote in the 1st comment:
Votes: 0
Three basic visibilities are normal, limited and zero. Two categories of lighting are natural and affected. Therefore, six cases exist:
normal (full descriptions):
natural: outside daytime
affected: light source
limited (vague descriptions):
natural: dusk, before dawn, a dim room, looking near the sun
affected: magically dim, magically bright
zero (can't see anything):
natural: night w/o light source, cave w/o light source
affected: magically dark, magically "stark" or better name (too bright to see)

What's the best way to program this? The exceptional lightening or darkening sources are:
"starkening" or better name
"brightening"
(normal light source)
"dimming"
"darkening"

Also there's affecting v. being affected.

Imagine people walking into rooms "vagueing" everything, canceling someone else's stark light into bright, normal, dim or darkness, seeing in spite of other peoples' lightening/darkening, etc. Would almost definitely be really fun. One thought to avoid OOPs'ing the code is simply making rooms as foo'ed as the character's level in how the character is trying to foo the room, and the highest foo is what the room is. Then have training, spells, affects, etc., to see in unusual light, that respect the level or aggregate of what's there. Some excellent administration would probably be needed to avoid this being a reason players quit a MUD, or maybe a toggle that makes some players immune. Seems like an enhancement with a lot of potential.
04 May, 2014, quixadhal wrote in the 2nd comment:
Votes: 0
The way the Dead Souls LPMUD mudlib does vision is by using a light "value" for each room, and every race has a range of light values over which they can see.

So, if a "normal" room is lit at level 100, you might say a human can see clearly between brightness 60 and 140. They can still see between 20 and 60, and between 140 and 180, but with reduced details. Below 20 or above 180, and they're blind without some form of help (a torch, sunglasses, etc).

Maybe a dark elf has a vision range from (5-10, 10-90, 90-120), so while they can see well in a room with only a candle, they still need some light.. and anything brighter than an overcast day is painful.

Rather than trying to come up with a complex system to fudge this stuff, just use a value range. If I walk into the room holding a light source that's brightness 100, and the room was only lit at brightness 50, now it's at 100. You could try to code in some temporary affects for sudden changes if you want to simulate it taking a while for eyes to adjust, but really that's just having a "blind" or "partially-blind" affect that the player (or NPC) obtains for few turns while transitioning from dark to light or light to dark.
04 May, 2014, Runter wrote in the 3rd comment:
Votes: 0
I would suggest a compromise between the two.

So if a room I set to zero light and I come in with a partial light source the room becomes partial. Likewise if I come in with a full light source it becomes full.

If I wanted to define racial vision I would simply specify which of these 3 conditions the race could see in.

I would find it too complex and unapproachable to use a measured stat for the level of light and the range that can see For each race.
04 May, 2014, quixadhal wrote in the 4th comment:
Votes: 0
The advantage of using numbers is you can do math on them.

If you wanted to be slightly realistic, you could say when the light source that enters is >= the ambient light level, add some fraction of that difference to the effective light level. If you wanted to be actually realistic, you could do the physics light falloff calculation, based on the room size and the light intensity… but then you'd probably want to use lumens, instead of arbitrary numbers. :)

It also means I can make a darkness spell that reduces the light level by 30… which isn't overpowered… but if 3 mages all cast it together, it turns a normal room into candle-light levels with no conflicts like you'll find using categories.
04 May, 2014, Lyanic wrote in the 5th comment:
Votes: 0
I use a 0 to 9 light level that adds up the values of all the light sources (sun, moon, stars, torches, negative light sources, etc) and compares against each character's vision.darkness attribute (also rated 0 to 9). I use the same system for vision checks against the hidden and invisible.
0.0/5