[CF-Devel] SDL enable GTK client / Fog of war

Scott MacFiggen smurf at CSUA.Berkeley.EDU
Thu Jun 7 14:54:54 CDT 2001


On Wed, Jun 06, 2001 at 09:47:08PM -0700, Mark Wedel wrote:
>
     
      Scott MacFiggen wrote:
     
     >
     
      > 
     
     >
     
      > I've been working on enabling SDL on the GTK client and also
     
     >
     
      > adding a fog of war feature where seen but currently out of view
     
     >
     
      > tiles are still displayed but with a black square with 50%
     
     >
     
      > translucense set. It pretty much works at this point, and SDL seems
     
     >
     
      > to blit about 3x faster the gdk although it doesn't feel any faster.
     
     >
     
     
     >
     
       That may be a really good gain then with the latest client that does shading
     
     >
     
      for darkness.  Performance on that is pretty poor.
     
     >
     
     
     >
     
       Note that the client and server now support the sending of larger viewable maps
     
     >
     
      - I don't know how much need there will still be for a fog of war, but its
     
     >
     
      probably still useful for servers that have a max viewable map smaller than what
     
     >
     
      the players really want.
     
     
Well, currently the fog code is only used for squares that are in the
viewable area but out of LOS. So if you run over and peek down a hallway
then run back, you will still see the hallway, shaded down 50%, and any
monsters that might have been standing down there. I'll merge my changes in
with your client changes this weekend and also add support for using
large views on a server with smaller update areas. I think it goes a long way
towards making the game look nicer...

>
     
       The problem here is that the client is presumed non trust worthy. Depending on
     
     >
     
      peoples opinion, sending the players x,y coordinate may be giving away extra
     
     >
     
      knowledge.
     
     >
     
     
     >
     
       Not for example it would then make it very easy to have it also automap, and
     
     >
     
      this then may let players find secret treasure chambers or their way around
     
     >
     
      mazes much more easily (I remember one maze map in brest which was no magic in a
     
     >
     
      lot of it as well as having teleports to make life more difficult - if client
     
     >
     
      knows the x,y whenever they hit a teleporter, such a map now becomes trivially
     
     >
     
      easy).
     
     
This is workable.. What I can do is store the map state in a 510x510 array
and just always start from the middle and use a virtual coordinate system.
Each map cell in the array is an array of 5 shorts, an 8 bit count value
and an 8 bit cleared value. So 12 bytes * 255*255 comes out to be 780K.
If I bring it up to 510*510, it comes to 3 meg. Thats why I would rather have
the client know about the x,y coordinates. 

But if I use the virtual coordinate idea then all I need to know from the server 
is when to reset state.  I'll do it that way in my patch and we can go from there.

	-Scott

    
    


More information about the crossfire mailing list