Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] Re: (PR#8906) save shuffled_players
Home

[Freeciv-Dev] Re: (PR#8906) save shuffled_players

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8906) save shuffled_players
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Sun, 6 Jun 2004 03:05:24 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8906 >

On Fri, 4 Jun 2004, Jason Short wrote:

> Actually it looks like the problem is with the random seed.  I'm not
> sure if the game is entirely reseeded or if there's just a different
> number of (probably AI) rand() calls when you load than there were
> originally.  I imagine it will be difficult or impossible to get things
> to be identical.

yes

> > Anyway, your patch is a step in right direction.  Is set_shuffled_players
> > used more than once? I think you should kill it.  Set the players as you
> > load them.
>
> This is possible but it means the shuffled players variables must be
> made global (currently they are static).  I preferred to just add a new
> function to the interface.  But I can do it the other way if you like.
> Is it worth it?

Ah, I see.  No, definitely not worth it.  Although you could make a
smaller function set_shuffled_player to set just one player and call it in
the loop, I think this is worth it.  And definitely write in the header of
the function that it is essentially an accessor to the static variables.

G.




[Prev in Thread] Current Thread [Next in Thread]