[CF-Devel] map bug

Mark Wedel mwedel at scruznet.com
Tue Oct 31 20:14:02 CST 2000


Michael Toennies wrote:
>
     
     
     >
     
      Hi
     
     >
     
     
     >
     
      On some spot, for example the transport dragon to pupland or the new
     
     >
     
      arena patch from AV, you got a bad effect.
     
     >
     
     
     >
     
      If your char move on the spot, the house/item vanished, and the underground
     
     >
     
      like gras was shown.
     
     >
     
     
     >
     
      The attached jpg shows it. Left i stand on the hangar, all is ok.
     
     >
     
      Right, i stand on the dragon, but the dragon part under me is not shown.
     
      
This is actually true for many items.  I'll look into a more general fix than
the old double floor fix that you originally see (that fix was that if there
were two floors, you would see both of them to make things look better).

 But the more general long term approach is to have a stacking value that the
client can set.  Way back when, crossfire only used bitmasks with no masking, so
it only made sense to draw one image per space.  Then Xpm came around with
masking, so it made sense to draw 2 items per space.  But that got into the case
you see - character standing on a building that is on top of something else
which doesn't look very good, so double floor patch came about.

 I briefly tried drawing all items on a space.  Aside from consuming a lot of
cpu time (but back then that was on a 20 mhz 68020 - sun3/60, 3 mips), at some
point it just didn't look very good because everything sort of got muddled
together and it just looked like a blob.

 the cpu performance should not be as much of an issue - especially if we make
some linked lists to more quickly identify the items to draw.  But determining
what items to draw may get difficult (for example, if standing on the store, you
want the store to be drawn and the ground beneath the store, but you don't want
the store to bubble up on top of swords and other things dropped there (we'll
ignore the fact that this happens anyways right now when maps are saved due to
the way multi part objects are handled).

 but if you then need to look through a space each time an item is
inserted/deleted and update a stack of visibility for all those spaces, that can
get expensive cpu wise.  Think of the effects of a large fireball case in a room
full of monsters that have treasure or other items beneath them (or that they
drop as they die).

 Another thing on the long TODO list is to just update how the server deals with
map updates.  Right now, whenever anything is inserted/removed from any space on
any map, the server determines how that space now looks.  What I really want to
do is only determine what the spaces that the player sees looks like - who cares
what something 20 spaces off the map may look like.  This would entail adding a
bitmask to the map structures which shows which spaces are up to date (as they
are/were in the players view, got updated, and haven't changed yet), and which
are stale.  Before we send the map to the player, we update all these stale
spaces.

 When something is inserted/removed, we just mark the space stale and leave it
at that until it goes within view.

    
    


More information about the crossfire mailing list