Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9799) PATCH: adjust_map rewritten
Home

[Freeciv-Dev] (PR#9799) PATCH: adjust_map rewritten

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#9799) PATCH: adjust_map rewritten
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Thu, 2 Sep 2004 03:45:08 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [mburda - Thu Sep 02 06:23:51 2004]:
> 
> Le jeu 02/09/2004 à 01:31, Jason Short a écrit :
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=9799 >
> > 
> > With this small change
> > 
> >    int hmap_swamp_level = ((hmap_max_level - hmap_shore_level)
> >                       * map.swampsize) / 100 + hmap_shore_level;
> > 
> > some swamps come back.  3 of them.  However based on 30% land you'd 
> > think there would be
> > 
> >    4000 * 30% * 5% = 60
> > 
> > swamps.  So something's still not right.  But since we want to get rid 
> > of map.swamps later anyway this may not be a big deal.
> > 
> > jason
> > 
> this is ok for me. (but not solve the problem!)
> 
See void make_swamps(void):

 for (swamps = 0; swamps < map.swampsize; ) { /// ????
    forever++;
    if (forever > 1000) {
      return;
    }
    rand_map_pos(&x, &y);
    if (not_placed(x, y)
        && hmap(x, y) < hmap_swamp_level) {
      map_set_terrain(x, y, T_SWAMP);
      cardinal_adjc_iterate(x, y, x1, y1) {
        if (myrand(10) > 5 && !is_ocean(map_get_terrain(x1, y1)) 
            && map_get_terrain(x1, y1) != T_SWAMP ) { 
          map_set_terrain(x1, y1, T_SWAMP);
          swamps++;
        }
      } cardinal_adjc_iterate_end;
      swamps++;
    }
  }

That's why increasing swamp_level doesn't change the behavior much.
Because there will be about map.swampsize swamps placed, not
MAX_MAP_INDEX*ladmass%*swamp_size%
--
mateusz


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