[CF-Devel] Light and Darkness

Mark Wedel mwedel at sonic.net
Fri Dec 28 22:09:05 CST 2001


     kevin at ank.com
     
      wrote:
>
     
     
     >
     
      Hi all,
     
     >
     
     
     >
     
      I've been testing the darkness code on some of the sample maps and
     
     >
     
      find that it doesn't work nearly as well as I would have hoped.
     
     >
     
      When casting light from a light source, the light should stop at
     
     >
     
      any walls I think.  As it is, the code makes it very difficult to
     
     >
     
      throw shadows across the floor of the dungeon, and light on a wall
     
     >
     
      lights up that wall even if you are on the opposite side from the
     
     >
     
      light source.
     
     
 This is largely because the way the game is designed - everything is based on
square spaces.  For example, for line of sight, we can know if you can see that
square, and not that you see half a square or whatever.  In the case of walls,
this often means you see the small strip of floor/ground on the far side of the
wall.

 Similarly, for light, we know the light level for the entire space.  Trying to
know that the right half the square and not the left is illuminated (Because of
a wall) is not done, and in any case, that information would then have to get
communicated to the client.

 If the problem is that you see an illuminated wall because the next room over
is illuminating it, the simple solution is to just make the walls double thick. 
Then, if the next room is full bright but the room you are in is dark, the walls
will still be dark.


>
     
      Also perhaps someone can answer how to light a torch; applying the
     
     >
     
      torch doesn't light it.  And a bug I've noticed;  if you have an unlit
     
     >
     
      torch in your inventory above a lit torch your light drops to zero.
     
     
 The standard way is to mark the flint and steel and applying the torch (or
maybe you mark the torch and apply the flint in steel - one or the other). 

 Looking at the code, best I can see is that it should always take the brightest
light source in your inventory.

    
    


More information about the crossfire mailing list