Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2002:
[Freeciv-Dev] Re: Civ 2 style happiness (PR#1436)
Home

[Freeciv-Dev] Re: Civ 2 style happiness (PR#1436)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Davide Pagnin <nightmare@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, rwetmore@xxxxxxxxxxxx, raahul_da_man@xxxxxxxxx
Subject: [Freeciv-Dev] Re: Civ 2 style happiness (PR#1436)
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Tue, 14 May 2002 00:45:58 -0400

At 06:02 PM 02/05/13 +0200, Davide Pagnin wrote:
>       Hi, all!
>I've seen the notes to the specialist patch written by Ross.
>I was the author of the patch, so I take a little bit of effort to
>understand the objection from Ross...
>
>On Sun, 12 May 2002 12:59:18 -0400 Ross W. Wetmore wrote:

>As a last word, Ross stated that at least 2 AI function may misbehave
>with this patch applied. I've tried to understand the problem but
>my knowledge on the core of the AI code is very little and so I will
>wait others that have proper knoledge to write the code on this problem.
>
>My 2 cents are that the event of have an elvis taken from pool of
>working
>citizen and having more happiness problems, in very unlikely although
>not impossible but can happen ONLY if you chose poorly which citizen
>take out of work. 
>(If I'm wrong, may you demonstrate me an example?)

The AI/server auto allocate code is pretty biased against trade, so in
this case it will likely pick the worst tiles to turn into specialists.

In particular, it will favour production rich tiles like forest when
it needs to go for ocean, or maybe even roaded desert.

It will also starve itself (actually it does this most of the time 
anyway) rather than choose high food tiles to offset the specialist
undimished appetites.

Part of the problem is that the AI will make the problem worse as it
tries to fix it since it doesn't understand the negative effect which
is enhanced by this patch.

These are not showstopper issues, so they shouldn't hold up this patch.
But they will do undesireable things on occasion until fixed.

In particular, the AI will likely stagnate a lot more, and real users
will need to do more manual resets after a foreign unit runs through 
their territory and the server does its emergency reallocations. Or
the growth pop will send you into riots if you don't leave an extra
large margin.

>Thanks in advance
>
>       Ciao, Davide--- city.c  Wed Feb 27 08:50:45 2002

>   tmp = content_citizens(city_owner(pcity));
>-  pcity->ppl_content[0] = MAX(0, MIN(workers, tmp));
>+  pcity->ppl_content[0] = MAX(0, MIN(pcity->size, tmp) - specialists);
>   if (game.angrycitizen == 0)
>     pcity->ppl_angry[0] = 0;
>   else
>-    pcity->ppl_angry[0] = MIN(MAX(0, -tmp), pcity->size);
>+    pcity->ppl_angry[0] = MIN(MAX(0, -tmp), pcity->size - specialists);

This looks good ... better than my suggestion I think, since if I read
this right it favours unhappy over angry whereas the equivalent to 
content would do the reverse. Both fix the bug when an angry is converted
(to a specialist plus -1 unhappy).

Cheers,
RossW
=====




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