Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2004:
[freeciv-ai] Re: (PR#10110) AI underestimates Temples
Home

[freeciv-ai] Re: (PR#10110) AI underestimates Temples

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mstefek@xxxxxxxxx
Subject: [freeciv-ai] Re: (PR#10110) AI underestimates Temples
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Sep 2004 14:59:57 -0700
Reply-to: rt@xxxxxxxxxxx

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

Mateusz Stefek wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10110 >
> 
> I got this feeling by watching a game where AI was building Granaries
> and Aqueducts in cities of size 5, but it never builded a Temple.
> Looking at the AI code I'm conviced that something is wrong:
> Temple:
>         case EFT_MAKE_CONTENT:
>           if (!government_has_flag(gov, G_NO_UNHAPPY_CITIZENS)) {
>             v += pcity->ppl_unhappy[0] * amount;
>             v += amount * c;
>           }

   v += pcity->ppl_unhappy[0] * amount;

This needs to take into account the production of a citizen.  See 
best_worker_tile_value().  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.  Of course this is hard since you're 
not allowed to check SP_ELVIS.  So you either have to guess or do a full 
recalculation of the city, I think.

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.

> Granary:
>         case EFT_GROWTH_FOOD:
>           v += c * 4 + 25;
>           break;

4 is arbitrary; this should be commented.

+25 is meaningless and bad I think...

jason




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