[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [pbmserv-dev] comment on undo



On Fri, 1 Jun 2001, Bob Lafleur wrote:
> > It would be nice if all pbmserv games were replayable.
> 
> I had tried to make Scramble replayable by storing the random number
> generator seed in the game file. Then, if the game was replayed, to use this
> stored seed to reseed the random generator. Theoretically, this should cause
> all the tiles to be sorted in the same order, and redistributed exactly as
> before. But I could never get it to work; I think because there is
> "strategically placed" seeding going on in the base classes that undoes my
> attempt to set the seed. If anyone can come up with a way to actually make
> this method work, I'd like to know about it!

One method:
Find a random number generation subroutine somewhere, and use it instead
of the built-in one.  You would probably have to save the initial seed,
current seed, and number if iterations in the the game file.

~ John Williams