Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2002:
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore
Home

[freeciv-ai] Re: (PR#2477) Improved Auto-Explore

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: cameron@xxxxxxxxxx
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: (PR#2477) Improved Auto-Explore
From: "Gregory Berkolaiko via RT" <rt@xxxxxxxxxxxxxx>
Date: Sat, 7 Dec 2002 09:10:33 -0800
Reply-to: rt@xxxxxxxxxxxxxx

It's a very good patch but there are some issues with it.

I won't comment on minor points, they can be fixed later.

I think that calculation of a tile's goodness should be separated into a 
separate function, which calls liekly_ocean and applies all the weights.  
Then this function can not only be called from Part2 but also from 
Part3.

Also, it surfaced recently that uncovering tiles that are reachable from 
your cities makes a tremendous difference on the AIs performace.  It is 
also helpful to humans.  So this should also be factored into the 
calculation IMO.

G.

P.S.  When attaching a patch, can you make sure it is attached as a 
plain-text?  Makes it easier to read...

On Tue, 3 Dec 2002, Guest via RT wrote:

> 
> [rfalke - Tue Dec  3 14:44:15 2002]:
> 
> 
> > > +      map_get_terrain(x, y - 1) == T_OCEAN) ||
> > > +     (y + 1 < map.ysize && map_get_known(x, y + 1, pplayer) &&
> > > +      map_get_terrain(x, y + 1) == T_OCEAN)) {
> > > +    /* we can tell by the border if there's land there. */
> > 
> > Please use adjc_iterate and DIR_IS_CARDINAL.
> 
> OK, done.
> 
> > > +    if(map_get_terrain(x,y) == T_OCEAN) {
> > > +      return 0x80;
> > > +    } else {
> > > +      return 0;
> > > +    }
> > > +  }
> > 
> > It looks like you referring in this construct here to the kludge we
> > use in the client to draw correctly the ocean squares.
> 
> Right. That information is available to the human player, so the
> auto-explore should be permitted to use it too.
> 
> > > +          sum -= 4;
> > > +        }
> > > +      }
> > > +    }
> > > +  } square_iterate_end;
> > 
> > How did you calibrated these values? 64 + 4*4+4*2 = 88 and 64 -
> > (4*4+4*2) = 40. Shouldn't these values be nearer 0 and 128?
> 
> Since cardinally adjacent tiles already give a guaranteed value, this
> was wrong. Now I add or subtract 10% confidence for each diagonal tile
> that is or isn't ocean.
> 
> > Can you scale them to 100 and call them percent?
> 
> Done. Together this means that if all diagonals are ocean, we return 90,
> and if all are land, we return 10. Unknown gives 50.
> 
> > > +    /* relative value of staying near known ocean and land */
> > > +    int klandscore = 2;
> > > +    int koceanscore = 25;
> > 
> > What is k?
> 
> It was 'known', but I renamed it to that, so it's clearer now. Basically
> we assign a certain benefit to exploring tiles we expect to be
> ocean/land, and another benefit to staying close to tiles we know to be
> ocean/land.
> 
> > Please make a set of values and then assign in if
> > (sailing){...}else{...} the final values. This temp usage is just
> > ugly.
> 
> Yeah, that was ugly. OK, now I have constants for the benefit of being
> the same or different type of land (ocean or land), and assign these
> benefits to land and water by looking at what unit type we are.
> 




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