AW: [CF-Devel] problems with darkness

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Sat Mar 22 01:31:02 CST 2003


Michael Toennies wrote:

>
     
      Some of the fixes and some of the extensions i put in daimonin are now reput
     
     >
     
      in
     
     >
     
      crossfire. But this always comes in a bit odd way ignoring daimonin and the
     
     >
     
      code.
     
     >
     
      I really wish more sharing here - it will be help us all and reduce work for
     
     >
     
      all of us.
     
     
  Probably true.  The 'problem' is that someone from each project needs to 
monitor the other project and see if there is interesting things to crossport. 
That obviously involves some people time - it's hard enough for me to keep up 
with my mailbox when just related to crossfire information.

  Also, doing a quick search on sourceforge, it seems there are 3-4 projects 
that list crossfire as a basis or inspiration (interestingly enough, Daimonin is 
not one that shows up).  But the point is really that as this number grows, that 
just means more things that people have to watch (now some of these may have 
very little or no cross project interest, as they are sufficiently different).

  Watching what goes on in other project, looking at code added, etc, is 
probably one of the less interesting things to do (most people would rather 
write new code, maps, whatever) - just look at bug fixing - it is one of the 
less glamorous areas of development, but something that needs to be done.  But 
most people would rather add some new feature than track down a few bugs (unless 
those bugs proved very annoying).


>
     
     
     >
     
      The only way to notice it, is to generate a set of test maps and test
     
     >
     
      situations. Then the
     
     >
     
      tester have to drive with a char over the maps and test the functions with
     
     >
     
      it. Sadly, nor
     
     >
     
      crossfire or daimonin has it. This is a major mistake from both projects and
     
     >
     
      i will change
     
     >
     
      it for daimonin asap when i have some more time after beta. We should think
     
     >
     
      for both projects about the right test maps.
     
     
  Well, this bug as described was very easy to track down on a simple test map. 
  But yes, crossfire for the most part has no test suite to really evaluate if 
things are working as expect.  Something shows up, and then a test map is made 
to isolate the problem.  This really isn't the ideal solution - it'd obviously 
be better to have test maps to find these bugs first.  But once again, writing 
test suites/maps is probably one of the less interesting areas of development.

>
     
     
     >
     
      When a map is redrawn, this function in info.c is called first:
     
     >
     
     
     >
     
      void draw(object *pl) {
     
     >
     
     
     >
     
          if(pl->map == NULL || pl->map->in_memory != MAP_IN_MEMORY)
     
     >
     
      	return;
     
     >
     
     
     >
     
          if(pl->contr->do_los) {
     
     >
     
      	update_los(pl);              <- *here is the bug*
     
     >
     
      	pl->contr->do_los = 0;
     
     >
     
          }
     
     >
     
     
     >
     
          draw_client_map(pl);
     
     >
     
      }
     
     >
     
     
     >
     
      This function is redundant code and must be removed - the functions who
     
     >
     
      calls it must call
     
     >
     
      draw_client_map() direct instead.
     
     
  Yep - I've removed that from crossfire source - since draw_client_map does the 
right thing, that isn't needed.

In face, the draw function really isn't needed anymore - I think I'll remove it.




>
     
      There is a good way to see the broken LOS and how this fix it.
     
     >
     
      In Navar is in the south-east corner a tower which is totally dark in it.
     
     >
     
      Enter it,
     
     >
     
      stay on the door and cast a spell like firebolt which lights up the area in
     
     >
     
      a
     
     >
     
      flash effect. Then apply the door without moving and you will see outside
     
     >
     
      still artifact
     
     >
     
      of the other map including LOS/darkness bugs.
     
     >
     
     
     >
     
      You have perhaps try it one or two times - even try different positions.
     
     >
     
      This kind of
     
     >
     
      effects are hard to track without test maps desinged for it.
     
     
  Well, I also found this bug in just a dark map with nothing special.  It turns 
out it was related to my hack to handle spaces at the edge of darkness special - 
while the server cleared what it things the space should look like, instead, the 
client just got a 'that space is really dark', so it wouldn't draw it, but would 
still hold the the faces that were on that space for potential fog of war use.

  In theory, it could perhaps be a client fix.  But really, that bit in the 
server was a bit of a hack to try and make per pixel lighting look better. 
There isn't a really good reason for that code - per tile lighting didn't need 
that hack.

  Also, once that code is removed from the server, it seems the fog of war works 
a bit better with dark maps.


_______________________________________________
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