[CF-Devel] issues with random maps

Mark Wedel mwedel at scruz.net
Thu Apr 12 23:31:50 CDT 2001


Peter Mardahl wrote:

>
     
      Well, I agree with you here:  the problem is that the code for placing
     
     >
     
      monsters is unaware of exits:  I borrowed it from crossfire at large,
     
     >
     
      and the crossfire-at-large code for placing things doesn't care
     
     >
     
      about exits.
     
     >
     
     
     >
     
      A phase of monster-removal might be added, but great care
     
     >
     
      would have to be taken not to remove an important key from the map.
     
     
 Actually, probably better placement would be the thing to do.

 You can't control where monsters move to after the map has been loaded, but I
believe what PC is describing is the first time you enter a map, monsters are on
top of exits.  It would seem that we could modify the code to not place monsters
on top of exits.

 I have also noticed chests on top of exits.  This is really annoying when the
exit is a type that is automatically applied when you move on top - you go to
look at the chest, and find yourself on the next map.


>
     
      > Traps on Walls:
     
     >
     
      >
     
     >
     
      > I've seen some maps generated that had traps on most of the walls.  I was
     
     >
     
      > able to search and disarm them, though running into the walls would not set
     
     >
     
      > them off.  Either they shouldn't be there, or they should be set off by
     
     >
     
      > bumping into the wall (which would require some new code, I suspect).
     
     >
     
     
     >
     
      I've never seen this.  Ever.  Where did you see this?
     
     
 Might the rune placing code not be smart enough to know there is a wall on some
space, and thus is placing a trap on top of it?


>
     
     
     >
     
      Next time I'll melt all my icecubes and make sure.
     
     >
     
     
     >
     
      Would it be possible to save all the parameters and random number seed as
     
     >
     
      comments in the map file so that it would be possible to reconstruct the
     
     >
     
      original map?  Then if there were an issue with keys, you could go back and
     
     >
     
      see exactly where they were (or weren't).  In theory, we could then just
     
     >
     
      email a few lines and easily reconstruct the maps in discussion.
     
     
 You could try, but it probably would not work.

 First, I am not sure if we can reliably get the random seed that is being used
(note some systems could potentially not be using random generation methods that
even have a seed or are computed, but rather use one of the more truly random
methods of getting values).

 But even if you could, the random generation on one system does not match that
of another, so the only real use might be to run it on the same system.   This
is even more likely if the two systems are not even using the same random
libraries (there is a bit of code in crossfire to try and use the best random
number generator available on the machine).

 But I do note that both my intel/linux/gcc machine and my
sparc/solaris/workshop 5.0 cc machine do generate the same results for the
following program:

#include <stdlib.h>
main()
{
    srand48(50000);
    printf("%d ", lrand48());
    printf("%d ", lrand48());
    printf("%d ", lrand48());
    printf("%d ", lrand48());
    printf("%d ", lrand48());
    printf("\n");
}

 results being:
614741494 586508200 804230098 1955543993 1872910808

    
    


More information about the crossfire mailing list