[crossfire] Re: LOS and lighting map redo

Lalo Martins lalo at exoweb.net
Tue Sep 6 03:30:34 CDT 2005


And so says Mark Wedel on 06/09/05 15:19...
>
     
      3) Send all light sources for map area, regardless if visible or not. 
     
     >
     
      Easiest to do, but starts to give away a fair amount of informatin,
     
     >
     
      especially for non static light sources (hmmm - a lot of light behind
     
     >
     
      that wall - must be something there) - probably not a good option.
     
     
there are two simple fixes for that.

with CURRENT CODE (lighting is calculated on server side):

  Right now, a square having an object that 'blocksview', is as lit as
  the lightest "side".  IMHO, it should instead be as lit as the
  "darkest" side (eg, it blocks light *before* the square itself is
  drawn).

  With smoothing, it wouldn't even look bad.

  If you want to get really fancy, you can make special cases when the
  darker side is no_pass or void.

with PROPOSED NEW CODE (lighting on client side):

  even better ;-)

  A cell with a 'blocksview' object should be lit according to the
  side(s) you're viewing it from exclusively.  So even if there is a
  light source behind it, the client should ignore it, since it's
  "behind" the "wall", and therefore, by game logic, it's "view" is
  "blocked".

  (The "(s)" above means, if you're standing on a doorway, between two
  rooms with lights in their centers, then the wall just beside you will
  be lighted exactly as it would be now, because you can "see" both
  light sources.)

A separate concern is that the server would need to send not only the
light sources, but also objects that block your view.  But sending the
actual objects can give space for cheating.

One way to get around that is to send fake objects of a new client type,
let's call it the SOMETHING (meaning, it's something that 'blocksview',
but it's none of your business what exactly it is).

But then, in practice, you'd be sending the footprint to the whole map.

An alternative is to do just that - send a completely separate map
structure, the "lightmap" (term borrowed from 3d engines), which for
each cell, says only how much light they give out, and how much
light/view they block.  Then leave actual lighting algos to the client.

That obviously still allows cheating, though :-( but I don't think
that's terribly important - seeing the footprint of your map is not the
smartest cheating you can do, and if you really want to, you can just
download the maps and open them in the editor.

best,
                                               Lalo Martins
--
      So many of our dreams at first seem impossible,
       then they seem improbable, and then, when we
       summon the will, they soon become inevitable.
--
     
     http://www.exoweb.net/
     
                       mailto:
     
     lalo at exoweb.net
     
     
GNU: never give up freedom                 
     
     http://www.gnu.org/
     
     
    


More information about the crossfire mailing list