[CF-Devel] darkness in client display.

Mark Wedel mwedel at scruz.net
Mon Jun 11 23:48:44 CDT 2001


 Soliciting thoughts for how to deal with darkness in the client.  This is
because with the new map1 protocol command for sending larger maps, the way
darkness is sent is now different.

 For referance, with the old code, darkness was not actually sent as a value. 
Instead, the server would notice the relative darkness of a space, and send an
masking image that would then make it appear darker (basically, for 25%
darkness, the masking image had 25% of its pixels set to black, the other 75%
transparent, for 50% darkness, 50% black, 50% transparent, and so on for 75%
darkness).

 This works, but IMO the results were not all that great looking.  Also, a
player could easily avoid this by using image caching and replacing those
masking images with ones that are 100% transparent.

 With the new map1 protocol command, instead of sending masking images, instead
that actual darkness value is sent.  In this way, the client can do appropriate
cleverness for displays.  An example of that is at
     
     http://tavern.santa-clara.ca.us/inter.gif
     
      (this requires using the -pngximage on
the client).

 Currently, if not using pngximage, the client does not do anything at with
darkness when using the larger map area.

 This then gets me thinking - if the client isn't going to use the information,
why send it to the client.  Adding an option in the server to enable/disable
darkness would be pretty easy to do.  I had thought of adding the masking
pixmaps to the client and have it use that same logic for the other display
mode, but IMO the quality of that is really pretty questionable.  Hopefully,
with the SDL additions to the client, performance will improve a bit on the
drawing to making that lighting code more usable on all systems.

 So the basic questions is:
1) Should players/clients be able to turn off darkness pixmaps/information as
sent from the server?  Such a change is easy to make, and would also apply to
the old (11x11 and smaller) map code.
2) Is there demand/want to use the masking information on the client side for
slower systems/people that don't want to use pngximage for whatever reason?

 NOTE - in all cases, this does not turn off darkness on the server - you will
still only be able to see some number of spaces as dictated by lighting
conditions.  What changes here is what we do with half dark spaces.

    
    


More information about the crossfire mailing list