public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: mskala@ansuz.sooke.bc.ca
To: Lincoln Peters <sampln@sbcglobal.net>
Cc: Xconq list <xconq7@sources.redhat.com>
Subject: Re: Map-related deja-vu
Date: Fri, 01 Oct 2004 00:26:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.21.0409302009550.8792-100000@diamond.ansuz.sooke.bc.ca> (raw)
In-Reply-To: <1096588332.4050.15389.camel@localhost>

On Thu, 30 Sep 2004, Lincoln Peters wrote:
> Since the world-size is set to 240x120 (circumference 1440), I would
> think that the chance of getting the exact same map twice would be
> astronomically low.  Has anyone else experienced this kind of behavior? 

As far as I can tell, XConq's random number generator, if not seeded from
the command line with the -R option, automatically seeds itself with the
system time modulo 100000.  By the Birthday Paradox, you should expect to
see a collision (i.e. two games starting with the same seed) if you play
316 games.  (= sqrt(100000))  I think it's plausible that in heavy testing
you might start that many games.  The world-size isn't relevant because
the generator only gets seeded once - so you aren't choosing maps from the
space of all possible maps (which space gets bigger with bigger
maps).  There are 100000 maps that can ever be generated, and you get one
of those more or less at random.

Is this a problem?  If so, we could easily put in a better seeding rule
and/or a better random number generator.
-- 
Matthew Skala
mskala@ansuz.sooke.bc.ca                    Embrace and defend.
http://ansuz.sooke.bc.ca/

  reply	other threads:[~2004-10-01  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01  0:19 Lincoln Peters
2004-10-01  0:26 ` mskala [this message]
2004-10-01  0:49   ` Eric McDonald
2004-10-01  5:45     ` Lincoln Peters
2004-10-01 18:19       ` Eric McDonald
2004-10-01 18:47 ` Stan Shebs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0409302009550.8792-100000@diamond.ansuz.sooke.bc.ca \
    --to=mskala@ansuz.sooke.bc.ca \
    --cc=sampln@sbcglobal.net \
    --cc=xconq7@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).