The AI and happiness

So, can someone please confirm that the AI is playing on Chieftain rules? For some reason, I was convinced it was Prince levels.
 
Is there a mod that turns off this extra happiness?

This is one of the things done in Sneaks' What Would Gandhi Do mod, included in TBC. Unlike vanilla, in the balance mod the AI plays by the same rules as the human in terms of happiness. It's replaced with bonuses to make combat more challenging:

  • Better and more useful AI starting units (instead of just warriors).
  • Small experience bonuses for AI units (scales with difficulty and era).
The AI handles the changes very well.
 
Uh... if I'm understanding Spatzimaus correctly, all you need to do is play at Chieftan to nullify the AI's bonus. So ask yourself: "Is the AI competative with me when I play at Chieftan difficulty". :mischief:

Personally, I was also under the impression that the AI received no "bonuses" until King difficulty, thereby making Prince an "even" playing field. Sounds like I was mistaken.

I thought he was only referring to happiness. According to this thread, the AI does get other bonuses at higher difficulty levels: http://forums.civfanatics.com/showpost.php?p=9717979&postcount=7
 
I'm not Firaxs, but here is the code from the unmodified game files if you really need confirmation that the AI does, in fact, play at Chieftan difficulty:
Code:
	<PostDefines>
		<Row Name="AI_HANDICAP">
			<Key>HANDICAP_CHIEFTAIN</Key>
			<Table>HandicapInfos</Table>
		</Row>
	</PostDefines>
As for disagreeing with Spaz, I wouldn't bother, he's right. What seems to be confusing some of you is that you don't fully understand how the difficulty handicaps works. I'll try to explain it for you, I appologize if I fail mizerably :)

Each handicap level has two sets of values, one that applies to the player using that handicap and another that applies to the AI opponents but only if the player using that handicap is not an AI player. In the case of multiplayer games the AI appears to be affected by the modifiers for the highest level human player.

Some quick examples are:

<HappinessDefault>15</HappinessDefault>
This is your starting happiness (from Chieftan) or free happy faces, no more, no less.

<AITrainPercent>175</AITrainPercent>
This is the percentage modifier to the AI's training (building units) production cost. So if you play at Chieftan, where this value was taken from, the AI's units cost 175% the normal hammer cost. At Prince this is 100 at higher levels it is below 100 giving the AI a discount.

There are some other "cheats" in there for the AI, for example regardless of what level you are playing at the AI unit upgrade costs are cut in half. Basically, there is no such thing as an even game with the way the handicaps are setup. If you play at Chieftan to match the hapiness bonus the AI receives you add extra penalties to them so you're ahead, if you step up to prince you reduce the penalties to them but you reduce your own bonuses and they continue to get the Chieftan bonuses.
 
that just make me wonder if the AI is incredibly shoddy that they need chieftain cheats to operate. What's the name for the mod that disables it, I want to see how well they do.
 
that just make me wonder if the AI is incredibly shoddy that they need chieftain cheats to operate. What's the name for the mod that disables it, I want to see how well they do.

Have you played any other turn based strategy games? They are ALL like this. Every single one of them. The ones that attempt to have an un-handicapped AI are absolutely no challenge at all.
 
Of all my games I've only had 1 where the AI incurred the -33% combat due to unhappiness, and that was for 1 turn (as I captured on of his 20 puppeted cities) If I were in that position would easily have the rebels coming at me by then.
 
I'll try to explain it for you, I appologize if I fail mizerably :)

Thanks. What you explained is how I was seeing it, so it's good to get the clarification. Basically the handicap graph is independent of the "base" handicap the AI receives.

Sounds like the multiplayer AI works at a different base, based on the difficulty of the human players, which is interesting.

Cheers :goodjob:

p.s. I think I typed "base" too many time. All your base are belong to us... :mischief:
 
Have you played any other turn based strategy games? They are ALL like this. Every single one of them. The ones that attempt to have an un-handicapped AI are absolutely no challenge at all.

A bunch yes, the thought of beating the AI to settling location makes me giggle with glee.
 
Sounds like the multiplayer AI works at a different base, based on the difficulty of the human players, which is interesting.
Multiplayer works the same for the most part, the AI still playes at Chieftan. The only difference between single player and multiplayer games is that it appears (I can't confirm it) that the AI receives the additional bonus or penalty settings based on the highest level player. So if you have two people playing and some AI players and one is at Prince and the other is at King the AI will receive the extra bonus values from the King handicap settings (better agains barbs, more discounts for production, etc). The AI will still be getting +15 happiness and the other benefits of Chieftan though.
 
And no, spfun, fixing this does NOT cripple the AI. You see, it looks like the AI is built around the concept of "thresholds". As in, most empires will only go on a conquest spree if they have ~20 Happiness to spare, so it doesn't matter HOW that +20 happens. If you put the AI on the same Happiness scale as the player, and they still have enough ways to gain Happiness (like the player does), then they'll behave exactly the same as before; the main reason why the AI, all other things equal, would tend to fall behind the player is that the AI is built around a probabilistic Flavor system where all possible options are available at any given moment with no concept of prioritization, but that's actually fairly easy to tweak.

My mistake, i thought they would go on big razing sprees when they're behind on happiness & that would be crippling for the only challenging AI type the runaway! :)
 
Each handicap level has two sets of values, one that applies to the player using that handicap and another that applies to the AI opponents but only if the player using that handicap is not an AI player.

Right. If you're playing on, say, King, then there are certain modifiers that this imparts to the AI, but for other modifiers it'll use its own default level, which happens to be Chieftain. One of the latter happens to be the Happiness multiplier. It gets very confusing.

The biggest problem, in my experience, is simply that the game is built around specialization and the AI is just not any good at that. Consider: if a player is close to zero Happiness, what does he do? Prioritizes building a couple +Happiness buildings, right, BEFORE dropping below zero? The AI can't do that. It doesn't react well in that way, and will only go into emergency panic-building if it actually drops BELOW zero. If you've caused the AI to have no cash on hand through research agreements and such, it might never recover.
So the AI needs this little something extra just to ensure that it doesn't go negative all the time. Other than the newly-added Stone Works and the Circus, there's really nothing that adds Happiness outside of the three main happiness buildings (at least until you get certain policies), so it simply doesn't have the ability to react well.

In my own mod, the way I fixed this was to spread the love out a bit. The Garden, Mint, Monastery, Aqueduct, Sewer System, and Recycling Center (those last two being custom) all give, among their other bonuses, +1 Happiness. Also, the Temple was changed to +1 Happiness and +1 Culture and removed from the Culture chain, so that it can be built immediately in a new city. (To compensate for all of these, the base Unhappiness is even more severe in my mod: 4 + 1.2/pop.)
What happens is that the AI handles this remarkably well even on Prince, because it'll be building all of those other things anyway as it goes, and if it DOES need a little extra Happiness, it has much more affordable ways to get it. It's not the all-or-nothing situation that normally cripples the AI, so it doesn't get trapped below zero. (I modified many other buildings in a similar way, to where there are no pure +happiness or +culture buildings. The AI handles it all much better now.)

Short version: the vanilla AI needs the x0.6 because it's too stupid to handle Happiness as well as a player would, and would get into trouble without it. But change the underlying Happiness system to something that it CAN handle, and it doesn't need the boost any more.
 
One thing I've always thought would help... the AI should have a target :c5gold: supply for a cushion in emergencies. The target should scale with tech progress, happiness, economic situation, military threats, and so on.

As a nice side effect it would solve the exploit where we can drain the AI of all its gold, with armies on their borders, then declare war on the next turn. The AI does recognize the threat (asks us.. what the frack are we doing?) but doesn't use that for making decisions about trades. :)
 
Well that exploit is easily corrected by not allowing lump sums to be traded, but that's for another thread.

Overall I think this happiness issue is just an AI problem. AI's cheat, and it will always be that way until someone actually makes real AI.
 
I've noticed that in the replay graphs, my final "happiness" score always dwarfs the AI (on emperor). I think this is the design, that the AI has massive bonuses because they simply can't manage happiness with the same intelligence of a human. The human wins out over time with smart play. As others have said, programming AI to stand on it's own with humans hasn't really been done with a game of Civ's complexity.

But on the flip side it shouldn't he *that* hard to improve the AI's ability to manage happiness a little bit. For instance, they can start building happiness buildings when they are under 10, not just when they hit 0, or something like that.
 
Well that exploit is easily corrected by not allowing lump sums to be traded, but that's for another thread.

It's more than that. For example: if the AI has positive :c5happy:, then a few trade deals end and it drops from :c5happy: to :c5angry:, without a gold reserve it's in a real bind.

It also goes both ways. If the AI's target gold reserve is some particular value, it wouldn't save 10,000+ gold like the AI currently does. It should probably spend some of that reserve.

Also... it's probably better to solve a problem directly instead of hiding it. Just blocking a trade option would reduce strategic depth of the game in order to bandaid an underlying problem that still exists. :)
 
It's more than that. For example: if the AI has positive :c5happy:, then a few trade deals end and it drops from :c5happy: to :c5angry:, without a gold reserve it's in a real bind.

Correct. A human would know that his deals were getting close to expiring, or would know that they're not likely to be renewed thanks to deteriorating relations. He'd have a contingency plan for what to do if/when he comes up negative. AIs don't plan like that.

Just blocking a trade option would reduce strategic depth of the game in order to bandaid an underlying problem that still exists. :)

Also, the lump-sum trade option is only one of four ways for an AI to blow through massive amounts of cash at once:
1> Rush a unit or building.
2> Bribe a city-state (might give you an extra Luxury, or might not).
3> Enter a Research Agreement.
4> Lump-sum trade.

So simply blocking that trade option won't solve the problem; the AI needs to always try to keep enough of a surplus that he can rush-build a +Happiness building if necessary. If you remove one way of doing this, the AI will just be that much more likely to use one of the others. In my Balance mod, for instance, I doubled the costs of research agreements; while it's drastically reduced the number of agreements that occur, it only encouraged the AIs to rush-buy more units and bribe more city-states, which actually made the AI a bit more dangerous in many ways.

----------------
Now, the true underlying problem, IMO, is tunability. That is, if you do slide to -1 Happiness, you don't have a lot of options to deal with it; all you can do is try to acquire a new Luxury for +4, or rush-build an expensive building. Neither of these is something an AI can do much with if it's short on cash; encouraging the AI to store up a bit of an emergency fund might help, but it doesn't really solve the underlying issue.

In my Content mod, I added a new Specialist type, the Empath. Empaths add +2 food and +1 Happiness when slotted. (It sounds like a lot, but it's actually more like +1 food and +1 Happiness, with the extra +1 food coming late in the game alongside +1s given to all other specialist types through some National Wonders I've added.) The ability to easily add or subtract 1 Happiness from turn to turn has made a huge difference, so I've often thought that these could be changed to Entertainer specialists and introduced in earlier eras. I've found the AI does a far better job of staying above zero with these, even without the Chieftain-level handicap bonus.

If you don't like the specialist path, then I could easily see this as a good niche for a Religious city-state type; give a few extra Happiness to whoever allies with one, in lieu of the culture/food/units of the existing CS types, and you effectively add a new way for AIs to react to these Happiness setbacks. But it's not quite as adjustable.
 
I do like your specialist solution, and would probably implement it in a content-based mod. The scope of my work is focused on balancing vanilla though, so I leave more significant departures up to Firaxis themselves so I don't get the flack for it. :lol:

Another option is for happiness to have gradual effects... such as -10% growth rate for each 1:c5unhappy:. It doesn't solve the problem of huge drops (like +0 to -10) but does mean the thresholds are less dramatic.
 
Back
Top Bottom