Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2002:
[freeciv-ai] Re: A better AI Eval buildings 1.1
Home

[freeciv-ai] Re: A better AI Eval buildings 1.1

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: A better AI Eval buildings 1.1
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Sun, 12 May 2002 13:18:44 -0400

At 02:47 AM 02/05/09 -0700, Raahul Kumar wrote:
>
>--- "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx> wrote:
>> 
>> I'll give it a shot, but it might not happen before the weekend.
>> 
>> Cheers,
>> RossW
>> =====
>
>Try this patch instead. It gets rid of the annoying warnings. I think
there's a
>new style issue raised in this patch. It's better to have similar types
>clustered together i.e
>
>int a, int b, char c
>
>than 
>
>int a, char c, int b

Yes, this helps with memory packing and reduces obscure side-effects
from such.

>This patch certainly compiles,(no warnings) and I didn't notice any different
>savegames in my first run. I'll leave you to run some more savegames and get
>back to me. If you see any compile errors, please fix and post a patch. If
you
>don't have the time to fix it the same day you notice it, send me the
>warnings.

It applied to and ran fine with May 11 CVS.

The initial savegames were the same, but about 3000-2500BC started to
diverge, so there is some. It was incredibly subtle and may result from
this sort of roundoff fix.

<   prod = pcity->shield_prod * 100 / city_shield_bonus(pcity) *
SHIELD_WEIGHTING;
---
>   prod =
>     (pcity->shield_prod * SHIELD_WEIGHTING * 100) /
city_shield_bonus(pcity); 

or this enhancement.

<   i = (pcity->size * 2) + settler_eats(pcity);
<   i -= pcity->food_prod; /* amazingly left out for a week! -- Syela */
<   if (i > 0 && pcity->ppl_scientist == 0 && pcity->ppl_taxman == 0)
hunger = i + 1;
<   else hunger = 1;
   
---
>   hunger = 1;
>   j = (pcity->size * 2) + settler_eats(pcity) - pcity->food_prod;
>   if (j >= 0 && pcity->ppl_scientist <= 0 && pcity->ppl_taxman <= 0)
>     hunger += j+1;
   

But I don't think this is any real problem.

>Aloha,
>RK.

Cheers,
RossW
=====




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