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: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: Thanasis Kinias <tkinias@xxxxxxxxxxxxx>, "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Civ 2 style happiness (PR#1436)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Sat, 11 May 2002 19:46:42 -0700 (PDT)

--- "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx> wrote:
> 
> I'm not sure you can "take specialists" from any category. The code
> recomputes happiness based on luxury, improvements, wonders and units
> effects, I believe. Only workers produce the basic trade. And the
> various ppl_happy counts get filled in and adjusted by the computation.
> 
>   pcity->luxury_total += (pcity->ppl_elvis * 2);
>   pcity->science_total += (pcity->ppl_scientist * 3);
>   pcity->tax_total +=
>       (pcity->ppl_taxman * 3) + get_city_tithes_bonus(pcity);
> 
> Elvis boost luxury, scientists research and taxmen income from the
> trade.
> 
> So, elvis specialists will improve the happiness levels while the
> others don't. Your comments seem incorrect in this regard. Do you
> have an explicit example to explain what you want to change here?

Ross: It always helps to read the patch. Take Christian's example of
a size 11 city, 3 unhappy people. If you see what the effect would be
with the original code, 3 scientists would make the happiness problem
disappear.

static void citizen_happy_size(struct city *pcity)
 {
-  int workers, tmp;
+  int specialists, tmp; 
 
-  workers = pcity->size - city_specialists(pcity);

The above line introduces problems here! This makes it possible for
unhappy/angry people to be used as specialists. This is what I mean
when I say making scientists helps your happiness problems. If you have
one unhappy person in a city, making a scientist helps just as much
as making an elvis. You should not be able to turn a rioter unhappy
with the government into a content specialist churning out gold/lux.

+  specialists = city_specialists(pcity);
   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_unhappy[0] =
-      workers - pcity->ppl_content[0] - pcity->ppl_angry[0];
+  ((pcity->size - specialists) - pcity->ppl_content[0]) - pcity->ppl_angry[0];
   pcity->ppl_happy[0] = 0;     /* no one is born happy */
 }

Contrast and compare.

<snip>

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com


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