AI and Happiness

Joined
Jun 2, 2005
Messages
801
Location
UTC−6
Hey all, Jewmpaloompa and I are currently working on a mod and we've been playing around with several different ideas. One of them is implementing religion in the game via a series of buildings, with each religion having a 'temple'-like building as the base. So then, for example, in the Buddhist series you can build a Pagoda improvement and then from there you can build The Mahabodhi Temple and other wonders as long as you have four, five, etc, Pagodas throughout your empire, representing the 'populatity' of the religion in question. Each of the temple-improvements cost 10, has 1 maintenance, and then gives two happiness. We decided to not have the buildings give culture because of cultural buildings being auto-destroyed when you take a new city, and we figured that the faith of the people in any given city wouldn't suddenly change, or they all wouldn't suddenly become agnostic or atheist, simply because someone new was in management.

However, there seems to a snafu in the setup. I've done countless playtest games, and the AI never seems to build the temple buildings. I've tried giving the temples different 'throw-away' traits such as 'doubles sacrifice' and 'stealth-attack barrier' to see if the AI will go for it, and still nothing. I've even tried having the temple buildings produce one culture per turn, but the AI doesn't seem to go for that either because they can build a Tomb improvement that only cost 1 but produces just as much culture per turn.

My question then is, have we just discovered the AI simply doesn't care about city happiness, or is there some other explanation for this behavior. Has anyone else noticed this trend or can they verify it from their modding experience?

Edit: I should also mention that we've made it so that every unit cost one population point. Could it be that the AI doesn't care about happiness when they know (if the AI can be considered that intelligent) that they can just throw away a citizen by building a unit, and they make up for the lack of a temple building with entertainer-type citizens, luxuries and the luxury slider? Food for thought.
 
Yes, it is. I should have also mentioned that in the first post :blush:
We made the temples replace so that you couldn't have more than one religion in each city.

I don't know if of you are like me, but it tend to helps me if I can see a picture of something in the editor, whenever I talk about modding civ3 I usually have to think about the page in the editor to get a feel for it.
Spoiler :
 
Your problem is interesting and I would also like to know the conclusion, since I was thinking of doing the exact same thing in my mod, temples for different religions and allow civs to choose which ones, and have a small or world wonder after you have n temples of the same type that doubles the temples' effectiveness.

Why the explode or meltdown flag?
 
Given the, um, "quirks" of the AI, I'd propose a simple test: Remove the "Replaces Bldgs" flag and then see if the AI builds temples (given that the flag was specifically designed for power plants, Heaven only knows what the coding is like.)

Best,

Oz
 
Given the, um, "quirks" of the AI, I'd propose a simple test: Remove the "Replaces Bldgs" flag and then see if the AI builds temples (given that the flag was specifically designed for power plants, Heaven only knows what the coding is like.)

Its a no go, the AI still wouldn't build them.

It looks like the only the AI will only build improvements with the 'replace all' characteristic flagged if said improvement gives at least one (25%) production. At least that's what all my testing is showing :sad:

Spoiler :


 
I agree! Can you test with different temples to see which the AI chooses?

Well, as I've already stated, each of the temples is the exact same. There's no difference between the Pagoda and the Church for example, or between either of them and a Mosque. They all are flagged with 'replace all', cost 10, give two happiness to their city, have one maintenance and now give +25% production.

What it seems to come down to is which temple the civ in question gets to first, ie, which one of the techs that contains a temple they research first. So in my games so far I see a lot of Buddhist nations early on but rarely any Christian ones.
 
Ok, it would be interesting to know if some of your civs change to the Church if it provides more happyness than the pagoda for instances. And would militarist civs use a type of temple associated with the militarist flag for instances? We must find out if we can make different civs pick different temples.
 
Ok, it would be interesting to know if some of your civs change to the Church if it provides more happyness than the pagoda for instances. And would militarist civs use a type of temple associated with the militarist flag for instances? We must find out if we can make different civs pick different temples.

I haven't seen any of the civs change their temple building so far. HOWEVER, I have seen civs sell their temple, and then build a different one further down the line. Ie, civ X builds a Pagoda in its capital because it needs the two happiness right away, then sells it off after its population problem goes away or it hooks up a luxury, etc, but then builds a Mosque or a Church later.

Ozymandias said:
Why do you have, "Can Explode Or Meltdown" checked?

Almost all the buildings in our mod have 'can explode or meltdown' checked, because it makes city unhappiness more dynamic and more of a problem to actually keep an eye on. The buildings don't 'explode' per say like a nuke reactor does, but instead burn down.
 
Almost all the buildings in our mod have 'can explode or meltdown' checked, because it makes city unhappiness more dynamic and more of a problem to actually keep an eye on. The buildings don't 'explode' per say like a nuke reactor does, but instead burn down.

Try unchecking it. In my experience, the "AI" was designed to fit a very narrow set of parameters - it isn't very good at all at "thinking" outside the box.

Best,

Oz
 
Try unchecking it. In my experience, the "AI" was designed to fit a very narrow set of parameters - it isn't very good at all at "thinking" outside the box.

I like "thinking outside the box" as this is the only chance to improve Civ 3 without any support by Firaxis.
 
Try unchecking it. In my experience, the "AI" was designed to fit a very narrow set of parameters - it isn't very good at all at "thinking" outside the box.

Before adding the one production value the AI didn't build any of the temple improvement regardless if it had the 'explode or meltdown' flag or not.
 
Before adding the one production value the AI didn't build any of the temple improvement regardless if it had the 'explode or meltdown' flag or not.

That's so strange as the AI likes Happiness improvements.

One last Q: in the editor, how do you have the Governor set for build/no-build preferences?

Best,

Oz
 
Instead of shields have the temples produce one culture each; see if that helps.

Of course, whenever a city is taken, the temple will be destroyed, but (from how you describe your mod) there is a certain logic to this.

Best,

Oz
 
That's so strange as the AI likes Happiness improvements.

Instead of shields have the temples produce one culture each; see if that helps.

Of course, whenever a city is taken, the temple will be destroyed, but (from how you describe your mod) there is a certain logic to this.

To simplify, I will tell you the tests I have ran and the results that I got;

Temple produces 1 culture, no production, flagged with 'replace all' > AI doesn't build
Temple produces 1 culture, no production, not flagged with 'replace all' > AI builds rarely
Temple produces no culture, no production, not flagged with 'replace all' > AI doesn't build
Temple produces no culture, no production, flagged with 'replace all' > AI doesn't build
Temple produces no culture, 1 production, flagged with 'replace all' > AI builds
Temple produces no culture, 1 production, not flagged with 'replace all' > AI builds

I should also mention that almost every building in the mod has the 'explode or meltdown' flag checked, and yet the AI still builds those improvements, so obviously that isn't what stops the AI from building the temples.

As it stands now the stats for the temples are such;
Spoiler :


One last Q: in the editor, how do you have the Governor set for build/no-build preferences?

Each of the civs have different build preferences, are you wanting me to list them all? I can tell you now that Egypt, whom I regularly see build the temple improvements, is flagged for often building workers, growth and culture - none of which, at least to my understanding, would lead the AI to go for the temples in particular... unless of course the AI uses the logic that more happiness means more citizens that can work tiles for food, leading to more citizens in that city.
 
Top Bottom