[CF-Devel] Darkness

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Thu May 20 02:16:05 CDT 2004


tchize wrote:
>
     
      -----BEGIN PGP SIGNED MESSAGE-----
     
     >
     
      Hash: SHA1
     
     >
     
     
     >
     
      Problems in the interpolation algorithm. In when i look at code, it's not
     
     >
     
      an interpolation algorithm but an extrapolation using the horizontal and
     
     >
     
      vertical light lines running thru center of squares. So problems at corner 
     
     >
     
      (diagonals informtions not used).
     
     >
     
      Will change it to use some bilinear interpolation (should give correct result 
     
     >
     
      at good performances)
     
     
  As the person that originally wrote that code...

  There are lots of problem with trying to interpolate the darkness code.  That 
is because it often isn't set for all the spaces around the spaces you are 
trying to fill it.

  The problem is really apparantly for blank spaces.  You have no idea if the 
space is dark, or just empty.  One might think you can always treat these empty 
spaces as completely dark, but then you start to get odd issues relating to 
things like the edge of the map, or even internall dark areas.  Think of 
something like:

DDDDD
-----
.....

  Where D are blocked (dark) spaces, ----- is the wall, and ..... is visible 
area.  You really don't want to use the D spaces to figure out what the wall 
should look like (imagine a case where the wall is well illuminate, eg, a light 
source on each of the . spaces.

  The real solution is to redo all that code on the client/server.  Instead of 
the client having to try and figure out relative light/darkness of each space, 
the server could simply say 'these are where the light sources are'.

  I had sent out mail a little while back about new protocol command to deal 
with all of that - haven't had time to work on it yet.


_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list