Re: Seeds in games



On Fri, 2004-09-10 at 17:54 +1200, Callum McKenzie wrote:
> Many of the games in gnome-games have a UI element to let you set the
> "seed" that the random number generator uses. I intend removing this
> feature in the interests of UI simplicity during this coming release
> cycle. 
Yay! I've always hated seeing that godawful number up there, and wished
it would either go away, or at least become unsigned, since seeing
"Spider (-28336550)" irks me more than "Spider (28336550)" for some
reason.

> The way I see it there are only a handful of uses for seeds in games:
> 
> 1) Replaying a specific game. Usually all you want is to restart a game.
> In most other cases you want to go back to a game after you have logged
> out and logged back in again. This later case should be handled by
> session management / saving state.
While I'm sure there are probably a handful of people who _do_ do
something like that, I'd just like to raise the issue that as it
currently stands, it's incredibly inconvenient, since to the best of my
knowledge, that number is normally only accessible in the window title,
so not someplace you can easily copy & paste. If you're explicitly
starting a game with a specific seed, you've got it in a form that
you're not going to accidently transpose two digits while copying it
down, but in the general case, it's pretty tedious.

Also, when you mention going back to a game after logging out, what do
you mean? Are you just planning on saving the seed & restarting that
same game, or actually storing the game state? I'm probably more lax
than some card players, but I would think that unless I had a full
restored state (and even then, you can't restore my memory of what was
coming up in the card queue, etc), I don't think I could even tell you
that this was the same deal of cards I had been playing with yesterday.

If restoring the whole state, what about play time? Does that weigh into
any game's scores? Are there any other sneaky things like that to
remember across sessions?

I just question whether it's worth the effort, since I would typically
start up a game of solitaire, get frustrated since I can't remember the
context for what I'm starting at, and start a new game anyway. I might
not be typical, though. Plus, I'm responding to this from a very
aisleriot-centric standpoint since that tends to be all I play these
days.

> 2) Challenging a friend (say via email) to get a better score. This is a 
> valid reason, but I suspect it is a very limited audience. Using high
> scores are just as good as a means of resolving who is better, although
> that looses some of the fun of a direct challenge .
> 
> 3) Reproducing bugs. While it is conceivable that it could be useful to
> report the seed for a game that ends in a particular bug (so it can be
> reproduced), no one ever does.
These two bring up a question in my mind: how reliable is the random
number generator? I know the games call g_random_int() or similar, but
is that guaranteed to always generate the same value from the same seed
across all different architectures, byte-orderings, pointer-sizes,
different revs of glib, etc? If not, it seems a little bit shakey to be
depending on it for two random people to have matching systems at any
given point in time (well, beyond the fact that there are however many
intel boxes running the same rev of a particular linux distro at a time)

If the random number generator IS reliable (or if gnome-games shipped
its own for this particular reason), I could see one interesting thing
coming out of it; I've heard tell that in the freecell game for windows,
they actually weeded out the games that are impossible to win. Certain
games have setups like that (I know I've started games of Scorpion
before only to look at a particular stack of three cards, realize it's
impossible to win, and his the new-game button), so if we had a reliable
random number generator, it would be possible to write some scripts to
play through certain card games looking for impossible setups and then
black list them. That, of course, would be odd with visible seeds,
though, since someone might say 'I want to play game 12345' and then it
goes 'Nope', or shifts to a different seed, or something.

> Can anyone think of any other reason for keeping the seed ? Any
> comments ?
So I guess I would be partially inclined to suggest keeping the seeds,
but hiding them from the user, since in aisleriot, at least, there's
room to do some neat things with it if the card deal can be reliably
predicted from the seed.

Other than that, though, I'd say the seeds are ugly and should go away,
since random large numbers sprinkled across my card games tends to scare
me.




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