Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: starting position allocation
Home

[Freeciv-Dev] Re: starting position allocation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kayeats@xxxxxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: starting position allocation
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Wed, 6 Nov 2002 13:56:05 +0000 (GMT)

Hi Karen,

I agree that the current implementation is probably flawed.  And it is so 
obscure that I cannot tell exactly how flawed it is.

Your patch makes it much clearer, by setting out a well-defined objective 
and going towards it.  There are some serious issues that need to be 
addressed though.

1. Adding goodness of an ocean tile to the each continent that can reach 
it is AFAICT broken.  Array conts is never initialized, but used.  
There are at least a couple of ways that you can fix it.  Also the idea of 
adding an ocean tile to the continent which is distance 2 away makes me 
think, why don't we add land tiles which are reachable from another 
continent to that continent?

2. There is a style guide:
        http://www.freeciv.org/lxr/source/doc/CodingStyle?v=cvs
and all patches should conform to it.

3. AFAICT your starting point allocation is good but not the optimal one.
Example: allocate three starters between three islands of goodness 8, 5 
and 3.  If I understand it correctly, your algorithm will tick 2 starters 
on the first island and then 1 each for the others with a minimum of 3 
goodness per starter.  This falls short of your aim to 
  /* now divide the number of desired starting positions among
     the continents so that the number of resources per starting position
     is as large as possible */
A better solution is to have two starters to the first and one to the 
second: this gives minimum of 4 goodness per starter.  Among other things, 
your solution might result (with a significant probability) in only one 
nation having whole of the biggest continent to itself (remember there are 
3 nations and you got 4 starters), which is highly unfair.

I know how to always find the best configuration, but it's a nice little 
problem and you might enjoy doing it yourself. ;)

Formulated in maths, it is
"Given k and a1, a2, a3, ...., an find the maximal d, s.t.
        [a1/d] + [a2/d] + [a3/d] + ... + [an/d] >= k,
where [x] is the integer part of x."

Not that this formulation helps any :)

On Sat, 12 Oct 2002, Karen Yeats wrote:

> Currently the starting position allocation is flawed in two ways, first
> quite large secondary continents are ignored as possible locations for
> starting positions even when there are enough players that using them
> would make sense, and second starting on mediocre terrain is forbidden
> even when this makes finding starting positions at all impossible, which
> is a problem for anyone who likes to play odd terrain-type maps.
> 
> This patch solves only the first (solving the second without messing up
> anything will take some delicate balancing and is a problem for another
> day).

Isn't the second problem just a matter of adjusting is_good_tile ?

G.



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: starting position allocation, Gregory Berkolaiko <=