1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Angry citizens don't consume food when producing workers or settlers

Discussion in 'Civ4 - General Discussions' started by karadoc, Nov 29, 2014.

  1. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    I recently learned that angry citizens :)mad:) don't consume any :food: when food is production (i.e., if the city is building a worker or a settler).

    As I'm sure most people know, usually each citizen consumes 2 :food: per turn. If the city is producing more :food: per turn than is being consumed, then surplus :food: is either added to the city's food store, or if the city is currently building a settler or a worker then the surplus :food: is converted to :hammers:.

    When a city is not building a settler or worker, :mad: citizens consume 2 :food: per turn, like every other citizen. But when the a city is building a settler or a worker, :mad: citizens don't consume :food:. They effectively get 2 free :food: per turn, for no apparent reason.

    I didn't know this until recently, and I don't know why it should be like. It seems strange and unintuitive to me; and so I'm considering changing it in K-Mod, so that :mad: citizens don't get free food. However, before making that change, thought I'd just ask a couple of things here first:

    • Did anyone know about this rule?
    • Does anyone exploit this rule to their advantage? (eg. deliberately build workers when they have angry citizens).
    • Should it be changed, or kept the same?

    I don't feel particularly strongly about it, but like I said, the current situation seems strange and unintuitive to me. I can't think of a good reason for it to be the way that it is.
     
  2. Timsup2nothin

    Timsup2nothin Veteran of 1000 psycic wars

    Joined:
    Apr 2, 2013
    Messages:
    37,639
    Location:
    Where the winds of limbo roar
    Well, if you opt not to change it here's a vague justification...

    Part of what is making them angry is that the city is too crowded. Food being redirected into worker/settler is at least for the moment keeping the crowding from getting any worse, so hypothetically they are 'less angry'...at least sufficiently to be productive enough to feed themselves.

    That said, it seems like just an error to me and I'd probably change it.
     
  3. Hornakhtyotef

    Hornakhtyotef Chieftain

    Joined:
    Jul 9, 2014
    Messages:
    49
    Karadoc, do you mean this tidbit of code?
    Spoiler :

    Code:
    int CvCity::getProductionDifference(int iProductionNeeded, int iProduction, int iProductionModifier, bool bFoodProduction, bool bOverflow) const
    {
    	if (isDisorder())
    	{
    		return 0;
    	}
    
    	int iFoodProduction = ((bFoodProduction) ? std::max(0, (getYieldRate(YIELD_FOOD) - foodConsumption(true))) : 0);
    
    	int iOverflow = ((bOverflow) ? (getOverflowProduction() + getFeatureProduction()) : 0);
    
    	return (((getBaseYieldRate(YIELD_PRODUCTION) + iOverflow) * getBaseYieldRateModifier(YIELD_PRODUCTION, iProductionModifier)) / 100 + iFoodProduction);
    From the last section:

    Code:
    	int iFoodProduction = ((bFoodProduction) ? std::max(0, (getYieldRate(YIELD_FOOD) - [B]foodConsumption(true)[/B])) : 0);


    Other called function:

    Spoiler :
    Code:
    int CvCity::foodConsumption(bool bNoAngry, int iExtra) const
    {
    	return ((((getPopulation() + iExtra) - ((bNoAngry) ? angryPopulation(iExtra) : 0)) * GC.getFOOD_CONSUMPTION_PER_POPULATION()) - healthRate(bNoAngry, iExtra));
    }


    Basically, the local variable bNoAngry is forced to be a "true" boolean. Perhaps, it was a copy-past mistake (?).
    That happens occasionally. I've even seen at some places wrong types of data input in some variables...one about AI attitudes...
    Still, I guess "false" was intended and some developper was tipsy that day or simply exhausted.

    I don't think this is widespread knowledge, but I might be wrong seeing there is already one reply about the subject.

    Indeed, it makes no much sense to stop feeding them upon reason they're lazy good-for-nothing only when food for settlers is gathered.
     
  4. ThorHammerz

    ThorHammerz zzz

    Joined:
    Jul 31, 2014
    Messages:
    836
    My spin on the justification is this:

    Angry Citizens (''Its too crowded!! We cannot forgive your cruel oppression!!'') obviously do not enjoy living in the city, as immigration/emigration is clearly prohibited between even nearby cities.

    When the city wants to make a settler/worker, the angry citizens are temporarily motivated to give the lucky families their full support to GTFO of the hell-hole they are living in, to the point where they donate their own personal food supplies to a cause they know to be worthy (i.e. not a military unit that's only going to contribute to a war).
     
  5. Timsup2nothin

    Timsup2nothin Veteran of 1000 psycic wars

    Joined:
    Apr 2, 2013
    Messages:
    37,639
    Location:
    Where the winds of limbo roar
    In a nutshell, it gives them hope.
     
  6. Mec AntiKythera

    Mec AntiKythera King

    Joined:
    Sep 24, 2010
    Messages:
    980
    I did know about this (was discussed in a game write-up I read some time ago) and do take advantage of it exactly as you described. If a city has unhappy citizens and I can't or don't want to whip, I will build a Worker or Settler.
     
  7. Windsor

    Windsor Flawless

    Joined:
    Feb 14, 2008
    Messages:
    1,353
    Location:
    Norway
    This was well known for me, and I've read several posts about it. So I think a decent number of players are aware of it. I do take advantage of this feature.

    Thematically I've seen it the way ThorHammerz explains. The only reason to change it is clarity in the mechanics. Balance wise whipping workers and settlers are already favorable since you get a crappy 1:food:=1:hammers: conversion when building workers/settlers. Changing this mechanic would buff whipping even further.
     
  8. civfanchambers

    civfanchambers Prince

    Joined:
    Dec 18, 2013
    Messages:
    456
    Location:
    Houston Texas
    Another example of the depth and complexity of this wonderful game. This info is news to me, and I look forward to exploiting it.
     
  9. Seraiel

    Seraiel Deity

    Joined:
    Sep 6, 2011
    Messages:
    7,954
    Gender:
    Male
    I knew about it, I exploit it often and there was some explanation of the CIV Devs why this should be so, so it's no mistake.
     
  10. traius

    traius His own worst enemy

    Joined:
    May 27, 2012
    Messages:
    938
    I definitely knew about this. Whether or not it makes sense is a different issue, but I did know about it.
     
  11. Robo-Star

    Robo-Star Prince

    Joined:
    Jan 12, 2008
    Messages:
    464
    Agree with Timsup2nothin: it seems like just an error to me and I'd probably change it.

    Are workers then emigrants? Plus you'd think they could get some support behind building, say, the Globe Theater, too.
    - ;)
     
  12. Timsup2nothin

    Timsup2nothin Veteran of 1000 psycic wars

    Joined:
    Apr 2, 2013
    Messages:
    37,639
    Location:
    Where the winds of limbo roar
    Workers are the most savagely mistreated citizens in the history of mankind. Get out there and build our roads, our farms, our suburbs. Dig our mines and build our forts. Forever. In return we offer periodic changes of clothes.
     
  13. Jastrow

    Jastrow Deity

    Joined:
    Feb 7, 2006
    Messages:
    2,685
    Location:
    Germany
    Yep. I use it regularly. I thought it was common knowledge.
     
  14. civtilidy

    civtilidy Warlord

    Joined:
    Mar 11, 2014
    Messages:
    200
    Location:
    Sweden
    Thanks for this knowledge. Always happy to refine my play.
     
  15. ThorHammerz

    ThorHammerz zzz

    Joined:
    Jul 31, 2014
    Messages:
    836
    Once every couple hundred/thousand years :lol:.
     
  16. plasmacannon

    plasmacannon Emperor

    Joined:
    May 5, 2010
    Messages:
    1,654
    Gender:
    Male
    Location:
    Orlando, Florida
    This is news to me also karadoc.
    It just wasn't something I noticed and therefore looked up.
    It's amazing that we keep finding new things after so many years. :)
     
  17. GKey

    GKey Emperor

    Joined:
    Aug 16, 2009
    Messages:
    1,277
    Location:
    USA
    It's well known. I think Gpstage wrote about this, he was saying it is intentional fix from Firaxis.

    You guys might want visit Strategy & Tips more often, will find many more surprises like this one.

    Galleons chain anyone?, or how to build culture and building at the same city at the same turn? , and some more.
     
  18. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    It wouldn't surprise me if it was intentional - just because it's a somewhat unlikely typo for someone to make. But you say it's a "fix"... a fix for what?


    In any case, I'm going to leave it alone in K-Mod for the time being. I don't really like it because it's unintuitive and obscure; but Windsor is right that the main balance effect of changing this would be an effective buff to slavery... and slavery doesn't really need a boost.

    It's just one of those cases where if I was writing the game from scratch, I wouldn't put in something like this. But given that it's here already, and some people are use to it, I think I'll leave it alone for now - at least until I form a stronger opinion.

    Thanks for the thoughts, everyone.

    I've just uploaded a new version of K-Mod. Everyone should try it if you haven't already. :)
     
  19. rbj2001

    rbj2001 Warlord

    Joined:
    May 26, 2006
    Messages:
    188
    Gosh darn it, and I've just un-installed Civ (for about the 10th time) in the attempt to get some actual stuff done... :lol:
     
  20. Mec AntiKythera

    Mec AntiKythera King

    Joined:
    Sep 24, 2010
    Messages:
    980
    I keep meaning to do that, but I've been too busy playing Civ.
     

Share This Page