Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9741) Problem inside setup_isledata() (not really impo
Home

[Freeciv-Dev] (PR#9741) Problem inside setup_isledata() (not really impo

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9741) Problem inside setup_isledata() (not really important)
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Fri, 20 Aug 2004 00:03:18 -0700
Reply-to: rt@xxxxxxxxxxx

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

I always felt that there was something wrong in island distribution in  
gen1/5. Big islands were favoured too much. So I looked into  
setup_isledata() and found that:

  /* place as many starting positions as possible with the current  
minumum
   * number of resources, if not enough are placed, decrease the  
minimum */
  while ((starters < game.nplayers) && (min > 0)) {
    int nextmin = 0;

    starters = 0;
    for (i = 1; i <= map.num_continents; i++) {
      int value = islands[i].goodies;

      starters += value / min;
      if (nextmin < (value / (value / min + 1))) {
        nextmin = value / (value / min + 1);
      }
    }

    freelog(LOG_VERBOSE,
            "%d starting positions allocated with\n"
            "at least %d resouces per starting position; \n",
            starters, min);

    assert(nextmin < min);
    /* This choice of next min guarantees that there will be at least
     * one more starter on one of the continents */
    min = nextmin;
  }


When we leave this loop min is always set to nextmin. I'm not sure if  
this is correct.

  if (min == 0) {
    freelog(LOG_VERBOSE,
            "If we continue some starting positions will have to have "
            "access to zero resources (as defined in get_tile_value).  
\n");
    freelog(LOG_FATAL,
            "Cannot create enough starting position and will abort.\n"
            "Please report this bug at " WEBSITE_URL);
    abort();
  } else {
    for (i = 1; i <= map.num_continents; i++) {
      islands[i].starters = islands[i].goodies / min;
    }
  }

1) min can be == 0 even if there's enough starting positions.
2) On the largest island there will be one extra starting position.

Example: Suppose we have three players and two islands. The first one  
with goodies = 2000 and the second with goodies = 1000. The first one  
will get 3 starting positions and the second only one.
--
mateusz



----------------------------------------------------------------------
Ateny 2004 w Internecie! >>> http://link.interia.pl/f182d





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9741) Problem inside setup_isledata() (not really important), Mateusz Stefek <=