Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: Angry citizen [PATCH UPDATED] (PR#656)
Home

[Freeciv-Dev] Re: Angry citizen [PATCH UPDATED] (PR#656)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Davide Pagnin <nightmare@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Angry citizen [PATCH UPDATED] (PR#656)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 22 Sep 2001 13:32:57 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Sep 22, 2001 at 02:42:50AM +0200, Davide Pagnin wrote:
>       Hi all!
> 
> This is a new version, of a patch that target the last issues for the
> complete activation of angry citizen as a server option. It is done
> against the CVS source of 20 september.
> 
> I've tested a little more the code, and it seems to run smoothly (20 AI
> on a 160 x 80 map).
> I've also checked the xaw, mui and win32 gui, and added to their
> respective citydlg.c the code needed to display angry citizens.
> 
> Please leave your comment/opinion on the patch! If some of you think
> that the code is unsafe for applying, give this hint to Hawk, he's only
> waiting for comment of others, to commit this patch.
> 
>       Ciao, Davide
> 
> To Hawk: We at freeciv.it are waiting for the complete angry citizen
> patch to be part of CVS to publish an interesting page in english on
> happiness matters and settings. so if you take a look to this patch and
> found the coding safe, please apply it as soon as is possible.

> diff -urN -Xfreeciv/diff_ignore freeciv-dev/ai/advdomestic.c 
> freeciv/ai/advdomestic.c
> --- freeciv-dev/ai/advdomestic.c      Sun Sep 16 07:53:45 2001
> +++ freeciv/ai/advdomestic.c  Fri Sep 21 23:29:05 2001
> @@ -69,6 +69,7 @@
>  
>    i = pcity->ppl_unhappy[3] - pcity->ppl_unhappy[2];
>    sad += i; /* if units are making us unhappy, count that too. */
> +  sad += pcity->ppl_angry[0] * 2;
>    freelog(LOG_DEBUG, "In %s, unh[0] = %d, unh[4] = %d, sad = %d",
>         pcity->name, pcity->ppl_unhappy[0], pcity->ppl_unhappy[4], sad);

I don't know what building_value does. What is max and val?

> +        pcity->food_surplus > 0 && !(pcity->ppl_unhappy[4] + 
> pcity->ppl_angry[4]) && 

Maybe: pcity->ppl_unhappy[4]==0 && pcity->ppl_angry[4]==0

> +        wants_to_be_bigger(pcity) && ai_fuzzy(pplayer,1)) {

> -    pcity->is_building_unit    = 0;
> +    pcity->is_building_unit   = 0;

Noise.

> +  return (pcity->ppl_happy[4]>=(pcity->size+1)/2 && 
> pcity->ppl_unhappy[4]+pcity->ppl_angry[4]==0);

Maybe: pcity->ppl_unhappy[4]== && pcity->ppl_angry[4]==0

> -      values[B_COURTHOUSE]=pcity->ppl_unhappy[4]*200+pcity->ppl_elvis*400;
> +      
> values[B_COURTHOUSE]=(pcity->ppl_angry[4]*2+pcity->ppl_unhappy[4])*200+pcity->ppl_elvis*400;

Maybe the 200 can be factored out.

> -     values[B_TEMPLE]=pcity->ppl_unhappy[4]*200+pcity->ppl_elvis*600;
> +     
> values[B_TEMPLE]=(pcity->ppl_angry[4]*2+pcity->ppl_unhappy[4]*200)+pcity->ppl_elvis*600;

Error.

> -    values[B_COLOSSEUM]=pcity->ppl_unhappy[4]*200+pcity->ppl_elvis*300;
> +    
> values[B_COLOSSEUM]=(pcity->ppl_angry[4]*2+pcity->ppl_unhappy[4]*200)+pcity->ppl_elvis*300;

Error.

> -    values[B_CATHEDRAL]=pcity->ppl_unhappy[4]*201+pcity->ppl_elvis*300;
> +    
> values[B_CATHEDRAL]=(pcity->ppl_angry[4]*2+pcity->ppl_unhappy[4]*201)+pcity->ppl_elvis*300;

Error.

> -    if (pcity->ppl_happy[4]>=pcity->ppl_unhappy[4]) {
> +    if (pcity->ppl_happy[4]>=pcity->ppl_unhappy[4]+2*pcity->ppl_angry[4]) {

In which way is this related to city_happy()?

Sorry to the long delay.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Life is too short for reboots."


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