How to make the AI settle on a certain "Feature" ?

Refar

Deity
Joined
Apr 10, 2005
Messages
4,608
Like the title says - i want to add a "feature" to the map, which would be valuable if settled on it, rather than working it. Once settled it would give the city certain advantages (probably python coded).

"Feature" is just a working title - it can be terrain, pre-existing improvements, ressources - whatever works best.

But how to make the AI concider it correctly while evaluating the settling spot ? (Since the AI will not be aware of the Python coded bonus it will get...)

Ideally settling on it would have some increased weight for the AI, but be not 100% forced, so the AI could sometimes decide not to - if the spot is bad otherwise....
 
This may not be exactly what you want, but on resources (bonuses) XML, there is a flag iAIObjective, which takes either a 0 or 1 value. I think this causes the AI to be interested in owning these plots. So it does not cause a settlement "on" that spot, but it causes a settlement "near" that spot. I am using this in Fury Road, to get the AI interested in controlling the ruined features such as depot, airbase, silo. Without this flag, the AI pretty much ignored them; with this flag set, the AI definitely tries to control them and build on them.

You can search for this flag to find some discussions such as here, here, maybe here.
 
Can the feature be made to only happen on a certain terrain type or new terrain type that the AI prefers to settle upon?
 
This may not be exactly what you want
Actually it's what you want. You just do not know it yet ;-P

Can the feature be made to only happen on a certain terrain type or new terrain type that the AI prefers to settle upon?
Everything would be fine - i used feature rather as a generic term - if terrain works better it can be terrain, or bonus...

To clarify - say we have a pre war ruin with a - miracoulously still undestroyed - nuclear power plant on it. Settling on that power plant would convert it into a building within the city (a power plant :mischief:).

However since the bonus would be applied from python at the moment the city is created, the AI will be completely unaware of it.
 
Did I spoil my own surprise by stumbling across this thread? :-)

There are two parts: the first part is getting the AI interested in building "something" on this spot. You could make it a ruined power plant parallel to ruined depot, etc, then define an improvement of rebuilt power plant. As long as the AI builds "something" on the spot, it may not matter too much, what is built.

The second part is what to do with the power plant once it's rebuilt. In XML, there isn't much you can really do with a power plant. In fact the only difference power makes is a production bonus to certain buildings. I had been planning to add oil based and biofuel (pig sh**t) based power plants to Fury Road. But, I want to use it for different things rather than just a production bonus, and there aren't any hooks for that.

So, you could make it a ruined plant and get the AI to build an improvement; but what would you do with it after that?
 
Back
Top Bottom