Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#725) Order of end/new-turn activities
Home

[Freeciv-Dev] Re: (PR#725) Order of end/new-turn activities

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#725) Order of end/new-turn activities
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 May 2004 00:57:18 -0700
Reply-to: rt@xxxxxxxxxxx

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

Raimar Falke wrote:

>>just make them more consistant.  The above may be one example
>>because we might want to update tech _before_ production (or maybe
>>not...).
> 
> Can we define what properties we want from the sequence? Should it:
>  - fair
>  - give an advantage immediately
>  - give a disadvantage immediately
> ? Which parts should always be predictable and which can have a more
> complex calculation?

- Fair (shuffled_players_iterate instead of players_iterate).  There 
should be no consistent bias.
- Consistent (don't mix production and research).
- The effects should be random only when we want them to be.  Mostly 
this randomness should come from shuffled players, I think.

The ordering in the previous example makes a difference in gameplay but 
this is not a technical issue.  So we should take Pille (or the design 
board's) advice on this.  There are many similar dependencies that could 
go either way: possibly too many even to find.  And sometimes there may 
be multiple dependencies between two atomic "activities".  The odds of 
this increase when we make the atomic groups larger.

For instance if we have two atomic activites:

   - Restore units
   - Do city shields & production

Restoring units may kill some of them (helicoptors, etc), changing the 
amount of shield surplus the city gets.  However building buildings may 
affect the restoration of units (barracks).  A player with a helicoptor 
building the united nations might end up losing the helicoptor if marco 
polo's is built first, but the loss of the helicoptor gives one extra 
shield allowing the completion of another helicoptor in another city.

These dependencies are complicated, but most of them don't matter all 
that much.

However sometimes the ordering does make a technical difference. 
Production should be upgraded before units and buildings are completed.


(I use the term "atomic" to mean atomic in the code, not atomic in 
principle.  The "restore units" step could be broken up into many 
different parts: recover HP, lose HP, dangerous-terrain loss, lose fuel, 
recover fuel.  But most likely it's all done atomically in one function 
call.)


Another minor issue is the ordering of city iteration.  This iteration 
isn't random but it is always the same.  As long as the players are 
ordered randomly this will make very little difference, but occasionally 
it will make some difference.  A wonder may be built in one of a 
player's cities instead of a different one - and it is consistently 
biased toward certain cities.

jason




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