What should the happiness system achieve? [POLL]

What should the happiness system achieve?

  • Slow down early expansion

    Votes: 47 53.4%
  • Limit/slow down expansion of the empire in general

    Votes: 48 54.5%
  • Reduce/Limit growth of cities

    Votes: 29 33.0%
  • Reduce/Limit the ability to work specialists

    Votes: 23 26.1%
  • Reduce/Limit the ability to be at war (war weariness)

    Votes: 56 63.6%
  • Limit the ability to conquer cities (in short time)

    Votes: 48 54.5%
  • Force effectiveness of citizens (needs)

    Votes: 23 26.1%
  • Force the construction of buildings/infrastructure

    Votes: 47 53.4%
  • Punish losing a war (pillage tiles/trade route)

    Votes: 33 37.5%
  • Give penalties, if negative happiness

    Votes: 50 56.8%
  • Give benefits, if positive happiness

    Votes: 43 48.9%
  • Should be more global (less city individual treatment)

    Votes: 13 14.8%
  • Should be more local (more impact of local situation)

    Votes: 36 40.9%
  • Should harm cause of religious diversity

    Votes: 20 22.7%
  • Should harm cause of ideological pressure

    Votes: 35 39.8%
  • Others (please write a comment)

    Votes: 4 4.5%
  • (added: Harm if yield generation/focus is outbalanced)

    Votes: 10 11.4%
  • (added: shouldnt spawn barbarians)

    Votes: 9 10.2%

  • Total voters
    88
I'm not sure of the details. It seems to take a while before you start getting unhappiness (and losing supply) from losses, as if the mechanic had a buffer. War Weariness seems to ramp relatively fast after a certain point, though, especially if the civ doesn't have war weariness reduction policies.

For detailed info on that, we're better ask someone that worked on that code. I'm interested as well.
 
I'm not sure of the details. It seems to take a while before you start getting unhappiness (and losing supply) from losses, as if the mechanic had a buffer. War Weariness seems to ramp relatively fast after a certain point, though, especially if the civ doesn't have war weariness reduction policies.

For detailed info on that, we're better ask someone that worked on that code. I'm interested as well.

Code:
/// What is our war weariness value?
int CvPlayerCulture::ComputeWarWeariness()
{
   if (m_pPlayer->isMinorCiv() || m_pPlayer->isBarbarian())
       return 0;
   
   int iCurrentWeary = m_iRawWarWeariness;
   if (iCurrentWeary == 0 && !m_pPlayer->IsAtWarAnyMajor())
       return 0;

   PlayerTypes eMostWarTurnsPlayer = NO_PLAYER;
   int iMostWarTurns = -1;
   int iLeastPeaceTurns = MAX_INT;
   int iLeastWarTurns = MAX_INT;

   int iHighestWarDamage = 0;
   // Look at each civ and get longest war and shortest peace
   for (int iLoopPlayer = 0; iLoopPlayer < MAX_MAJOR_CIVS; iLoopPlayer++)
   {
       CvPlayer &kPlayer = GET_PLAYER((PlayerTypes)iLoopPlayer);
       if (iLoopPlayer != m_pPlayer->GetID() && kPlayer.isAlive() && !kPlayer.isMinorCiv() && !kPlayer.isBarbarian() && kPlayer.getNumCities() > 0)
       {
           if(GET_TEAM(kPlayer.getTeam()).isAtWar(m_pPlayer->getTeam()))
           {
               if (!GET_TEAM(m_pPlayer->getTeam()).canChangeWarPeace(kPlayer.getTeam()))
                   continue;

               int iWarDamage = m_pPlayer->GetDiplomacyAI()->GetWarValueLost(kPlayer.GetID());
               iWarDamage += kPlayer.GetDiplomacyAI()->GetWarValueLost(m_pPlayer->GetID()) / 2;

               if (kPlayer.GetPlayerTraits()->GetEnemyWarWearinessModifier() != 0)
               {
                   iWarDamage *= (100 + kPlayer.GetPlayerTraits()->GetEnemyWarWearinessModifier());
                   iWarDamage /= 100;
               }

               int iWarTurns = m_pPlayer->GetDiplomacyAI()->GetPlayerNumTurnsAtWar(kPlayer.GetID()) - GD_INT_GET(WAR_MAJOR_MINIMUM_TURNS);
               if (iWarTurns <= 0)
                   continue;

               if(iWarTurns > iMostWarTurns)
               {
                   iMostWarTurns = iWarTurns;
                   eMostWarTurnsPlayer = kPlayer.GetID();
               }

               //Let's also get our most recent wars.
               iLeastWarTurns = min(iLeastWarTurns, iWarTurns);
               
               //Warscore matters.
               iHighestWarDamage = max(iHighestWarDamage, iWarDamage);
           }
           else
           {
               int iPeaceTurns = m_pPlayer->GetDiplomacyAI()->GetPlayerNumTurnsAtPeace(kPlayer.GetID());
               iLeastPeaceTurns = min(iLeastPeaceTurns, iPeaceTurns);
           }
       }
   }

   //by default, war weariness is slowly falling over time
   int iFallingWarWeariness = 0;
   int iRisingWarWeariness = 0;
   int iOldWarWeariness = m_iRawWarWeariness;

   if (iLeastPeaceTurns>1)
   {
       //apparently we made peace recently ... reduce the value step by step
       int iReduction = max(1, GC.getGame().getSmallFakeRandNum( max(3, iLeastPeaceTurns/2), iHighestWarDamage));
       iFallingWarWeariness = max(iOldWarWeariness-iReduction, 0);
   }
   else
   {
       //signed peace last turn - halve value for immediate relief
       //if we eliminate another player, this won't apply!
       iFallingWarWeariness = iOldWarWeariness/2;
   }

   //but if we have a war going, it will generate rising unhappiness   
   if(iMostWarTurns > 0)
   {
       int iInfluenceModifier = max(3, (GET_PLAYER(eMostWarTurnsPlayer).GetCulture()->GetInfluenceLevel(m_pPlayer->GetID()) - GetInfluenceLevel(eMostWarTurnsPlayer) * 2));

       //War damage should influence this.
       int iWarValue = (iHighestWarDamage * iInfluenceModifier) / 100;

       int iTechProgress = (GET_TEAM(m_pPlayer->getTeam()).GetTeamTechs()->GetNumTechsKnown() * 100) / GC.getNumTechInfos();
       iWarValue *= (100 + iTechProgress*2);
       iWarValue /= 100;
       
       iRisingWarWeariness = (iMostWarTurns * iWarValue) / 100;

       //simple exponential smoothing
       float fAlpha = 0.3f;
       iRisingWarWeariness = int(0.5f + (iRisingWarWeariness * fAlpha) + (iOldWarWeariness * (1 - fAlpha)));

       //at least one per turn
       if (iRisingWarWeariness == iOldWarWeariness)
           iRisingWarWeariness++;

       //but never more than x% of pop...
       iRisingWarWeariness = min(iRisingWarWeariness, m_pPlayer->getTotalPopulation() / 4);
   }

   //whichever is worse counts
   m_iRawWarWeariness = max(iFallingWarWeariness,iRisingWarWeariness);

   int iMod = m_pPlayer->GetWarWearinessModifier() + m_pPlayer->GetPlayerTraits()->GetWarWearinessModifier();
   if (iMod > 100)
       iMod = 100;

   m_iRawWarWeariness *= (100 - iMod);
   m_iRawWarWeariness /= 100;

   if (GC.getLogging() && GC.getAILogging() && m_iRawWarWeariness > 0)
   {
       CvString strTemp;

       CvString strFileName = "WarWearinessLog.csv";
       FILogFile* pLog;
       pLog = LOGFILEMGR.GetLog(strFileName, FILogFile::kDontTimeStamp);

       CvString strPlayerName;
       strPlayerName = m_pPlayer->getCivilizationShortDescription();
       strTemp += strPlayerName;
       strTemp += ", ";

       CvString strTurn;

       strTurn.Format("%d, ", GC.getGame().getGameTurn()); // turn
       strTemp += strTurn;

       CvString strData;
       strData.Format(" --- War Weariness: %d. Longest War: %d. Shortest peace: %d. Rising: %d. Falling: %d. Current Supply Cap: %d",
           m_iRawWarWeariness, iMostWarTurns, iLeastPeaceTurns, iRisingWarWeariness, iFallingWarWeariness, m_pPlayer->GetNumUnitsSupplied());
       strTemp += strData;

       pLog->Msg(strTemp);
   }

   return m_iRawWarWeariness;
}
 
I believe only few of players really understand the need-mechanic./QUOTE]
i know for one that I don't! I mean I understand the overall idea but I don't understand the details and more importantly I'd like to know how the parameters in the files work so I can play around with them, e.g. what happens if I increase or decrease a certain parameter? Haven't been able to find a good post on this.

\Skodkim
 
"Reduce/Limit the ability to work specialist"

Apparently some people do care about it. Please explain to me why you want to be limited in your ability to use specialists while some of your cities should probably work more specialists than other cities because of not ideal terrain ? It always bothers me greatly when I'm forced to work a coastal tile or a farm if I don't want to fall below 50% happiness.
 
"Reduce/Limit the ability to work specialist"

Apparently some people do care about it. Please explain to me why you want to be limited in your ability to use specialists while some of your cities should probably work more specialists than other cities because of not ideal terrain ? It always bothers me greatly when I'm forced to work a coastal tile or a farm if I don't want to fall below 50% happiness.
It's to limit tall. At least, it was intended this way when urbanization unhappiness was raised to the current value.
 
It's to limit tall. At least, it was intended this way when urbanization unhappiness was raised to the current value.
Yes, that was the reason for its introduction, but in the current situation, it works the complete opposite way. On wide empires, you simply can't compensate the sheer amount of unhappiness, while it's relatively easy on a small, tall empire.
It gets even weirder, if you realize, that you often need specialists to reduce poverty, illiteracy and boredom, but urbanization is eating all the positive effect you get from it.
 
Yes, that was the reason for its introduction, but in the current situation, it works the complete opposite way. On wide empires, you simply can't compensate the sheer amount of unhappiness, while it's relatively easy on a small, tall empire.
It gets even weirder, if you realize, that you often need specialists to reduce poverty, illiteracy and boredom, but urbanization is eating all the positive effect you get from it.

To be fair, it does a good job at emphasizing that Tall is better equipped to work specialists.

The real conflict for Tall is less about happiness and more about actually growing and using that surplus happiness. You have happiness to spare for urbanization, but not necessarily enough food to work as many specialists as you want and still grow.

Wide, on the other hand, has a conflict on not growing faster than it can maintain happiness. Without urbanization, that would be easily answered by working specialists.

I'm ok with this design, as you always have an internal conflict to solve in the empire, and can choose between two distinct fashions.
 
I think all this stability talk is badly overcomplicating matters in terms of happiness, and the bulk of it is just doing the same thing as the existing system.

The yield system is a good idea. BUT the fact that it is the overwhelming bulk of how happiness in set up, is the issue. You already get punished if you don't have enough food/production/culture/science. You won't be able to grow, build, unlock policies or research technology.

That doesn't mean there should not be any yield unhappiness. It is needed so cities aren't just doing one thing, and can't be settled anywhere. But because it is everything, means that there is way too much, and it punishes those on the bottom.

That is why I think there should be other unhappiness sources.

Ideas

Housing
Each city has a certain amount of housing, increased by tech level and a few other sources.
Palace (so capitals can be bigger)
Towns (Of Great Tiles it is a tad weak)
A new tile improvement, outlying settlements which can be upgraded to suburbs in the later game. Can only be built on good tiles, not crappy snow, tundra or no freshwater desert tiles. The tile produces no extra yields (or something minor like 1 production), but provides a sum of housing BUT only if worked (same for the town, but it still provides extra yields). Maybe even add a mechanic where they have to be linked to the city by road.

This is the mechanic that limits overlarge cities. You can keep building up big cities, but it means converting tiles into being useless and spending a population on being fairly unproductive. Represents the housing and amenities that people need, and not being provided with, causes crowding and unhappiness.

Administration.
Each non-puppet city consumes one administration resource. This is like Paper, as a resource that doesn't appear directly on the map.

The capital produces Admin as a base and has an administrator specialist. Said specialist has low base yields, but produces administration.
Policies can add some. Progress and Authority could have them, but with different mechanics. My thinking is that Progress could have a somewhat more simple mechanic, while Authority could get it, from holding enemy capitals.
But the bulk would be an administration building, which is like a guild, with two specialists. Maybe unlocked at like writing.

So you can have a small empire, and not need to spend any people on being useless. But as you expand out, you need to spend some.

This is the wide mechanic.

Security
Simply having a garrison, once the city hits a certain size. Like 5. So you don't need a garrison right away, but you will after a little while. It feels like some times as the player, you can not do much early game military unit building if you get lucky with neighbours and barbarian spawns.


Stuff like this, added onto Isolation, religion, war exhaustion and ideological pressure can make yield unhappiness less overbearing in dominating the happiness system. But doesn't mean ripping up the system, and starting all over again.
 
Last edited:
That sounds a whole lot like JFD's Cities in Development, Drakle. Not a bad system, but also very complicated. The thought of making the AI utilize it well scares me.

As for me, I don't know what to feel about the happiness system. On the contrary to everyone wanting to relax it, I find it's already far too forgiving - only after my initial settler sprawl early on is my happiness low, despite growing as hard as I can and working every good specialist. What is the purpose of the happiness system, the thread asks. I think first we have to ask ourselves: what is the purpose of the game?

If a game of Vox Populi is meant to be a competitive, somewhat symmetrical round of "who can win first", then the current happiness system is more or less fine in keeping strategies reasonable and reducing expansion/war potential. But if a game of Vox Populi is meant to be an immersive bout of civilization building and conflict, it falls flat. I would prefer more focus on the latter, since almost no-one plays the mod in multiplayer: I want to see rebellions, and city flipping, and empires crumbling under their own weight. That never happens now, unless the player is doing atrociously or an AI has been crippled by the player/other AIs to an extreme extent, which I find unfortunate.
 
I'm of the opinion that the only way the happiness system should really affect conquering is through war weariness. Any issues domestically (like having underdeveloped infrastructure) can help speed it up to prevent constant warring of course like going negative on GPT or not having enough production and science from unhappiness or other reasons to keep warring. You could possibly argue historically for the last 20 years in America as an example that even with an unhappy population nothing is really stopping your war effectiveness other than troops losing morale or your country not being able to supply the war effort. That and the Hundred Years War was also a thing and I'm going to assume the populations of said countries involved in it were actually supportive of the war effort pretty much constantly. To sum it up I don't think the happiness system should affect war more than just hurting war weariness as it should reflect the people on the front lines.

Which now that I think about it, it would be interesting if there was a civ that reflected this idea by actually gaining happiness from war weariness and some combat bonuses here and there.

Anyways I do want to add though if it were possible by the main modders maintaining the mod right now to expand happiness issues being a local city issue into something bigger that can lead to issues of citizens migrating from that city, and possibly even revolting and becoming part of the barbarian faction by becoming an autonomous zone. I know they can turn into city-states right now but there could be a place to convert them into a barbarian city of some kind. What happens currently in regards to barbarians is some units spawning outside of a city and thats basically one and done if your empire is unhappy enough, but it would be interesting if as a hard punish for neglecting a city too long it splits off as an unrecognized sovereign city by other civs that needs to be put under control.

I imagine the easiest way to implement something like that would be with the events system and using a lua to work with it? I don't have much knowledge on that but I'm speculating.

P.S. since I reread through everything. Sorry if it sounds like something too similar to whats been going on at home. Just didn't associate it with this idea until my reread so woops!
 
Good to see that after taking a break for a while, the happiness system still has broad philosophical discussions about it's purpose.

I'll say that overall I quite like the happiness system's place. I find food is a bit weak in most circumstances, especially if you want a lot of cities, and I can see why people find that frustrating.
 
I like a little simple change that Milae has done to the happiness system when he plays: Global happiness applies always, so you dont get capped by your population. Kinda defeats the purpose of buying luxuries etc if you get capped anyway.
 
I like a little simple change that Milae has done to the happiness system when he plays: Global happiness applies always, so you dont get capped by your population. Kinda defeats the purpose of buying luxuries etc if you get capped anyway.
How often does this happen except by a tradition capital?
 
Well maybe I didnt explain it well, but I mean if you have an occupied city for example, that will only give you unhappiness. If the rest of your cities has like 5-6 population you might not get more happy even if you buy/improve more luxuries, because the viable cities are already capped, and the occupied city cant provide happiness. I am not sure if that is even how it works, but I feel like the happiness-system sometimes feels wrong, and he (Milae) verbalised one of the ways for me.
 
Top Bottom