Re: (PR#10110) AI underestimates Temples

"Per I. Mathisen" <per-0/[email protected]>
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10110 >

On Tue, 14 Sep 2004, Jason Short wrote:
> Mateusz Stefek wrote:
> > I got this feeling by watching a game where AI was building Granaries
> > and Aqueducts in cities ofsize 5, but it never builded a Temple.

A lot of fine tuning of this code is necessary. Thanks for providing
feedback - a lot of that is needed.

>  v += pcity->ppl_unhappy[0] * amount;
>
> This needs to take into account the production of a citizen. See
> best_worker_tile_value().

Yes, I am working (slowly, certainly not in time for release) on general
code to evaluate happy/content/growth effects. In the meantime, if you
have some code that works better, feel free to post it.

> It also needs to check if there are actually any elvises: it doesn't
> help to build a temple if one isn't needed, even if there are some
> unhappy people.

Good point.

> Of course this is hard since you're not allowed to check SP_ELVIS.

Why are we not allowed to check SP_ELVIS??

> So you either have to guess or do a full recalculation of the city, I
> think.

Full recalc is out.

> However neither of these is possible for "other" cities. But still
> there we need to guess at the average bonus, rather than just assuming
> it to be 1. Probably you can find an average_tile_value() function
> somewhere and use that, or maybe divide it by 2.

We can iterate through all cities first, calculate some want for
happy/content buildings, and store it in pcity->ai.contentwant or
something.

> > Granary:
> >	case EFT_GROWTH_FOOD:
> > 	  v += c * 4 + 25;
> > 	  break;
>
> 4 is arbitrary; this should be commented.
>
> +25 is meaningless and bad I think...

This is all arbitrary, and there is no comment that will make it
meaningful more than /* this seems to work */. I can see if I can come up
with some better code.

  - Per
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.