negative reaction to civics?

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
In the Dune Wars mod, we are attempting to add some new civics which are similar to the terraforming civics in Planetfall. Please see this post for details. We have "heard" that in Planetfall, it is possible for AI civs to have a *negative* reaction to civics. *Positive* reactions are possible in vanilla for civics, and both positive and negative are possible for religions.

Does Planetfall have negative reactions for civics? If so what sorts of sdk/python changes were needed?
 
To clarify slightly; what we want is something similar to the Hybrid Economy vs Terraforming economy style, with Pro-water and Pro-spice civics.

So civs that adopt Pro-water get a diplomacy penalty to civs that adopt Pro-spice, and vice versa.

Also, are there any easy ways to make it more likely that a particular civ will choose a particular civic (like Deirdre choosing Hybrid or Miriam choosing Terraforming) other than preventing it from choosing the other?
 
Does Planetfall have negative reactions for civics? If so what sorts of sdk/python changes were needed?

Not in the way it works for having a different religion, but there is that tesion modifer for Terraformers vs. Hybrid followers Ahriman mentioned. Nothing similar is (yet?) in place for other columns and even in this columns the EB civic is out of that biploar model.


Ahriman said:
Also, are there any easy ways to make it more likely that a particular civ will choose a particular civic (like Deirdre choosing Hybrid or Miriam choosing Terraforming) other than preventing it from choosing the other?

There are two ways to do this (both leaderhead.xml):

1) Set <FavoriteCivic> to the desired civic. However, since Blake's AI modifications this has gotten toned down alot, so it isn't too reliable.

2) Probably more impact has setting a flavor like this for Yang, who likes Enclosed Biospheres a lot and switches to it in most games:

<Flavors>
<Flavor>
<FlavorType>FLAVOR_ENCLOSED</FlavorType>
<iFlavor>25</iFlavor>
</Flavor>

Edit: Crosspost...
 
Solution (changed source files from "darkciv") at this link.

Thanks - now I can easily include it in Planetfall as well. :D

For dynamic diplomacy penalties, a search for 'hybrid' and 'terraform' in the SDK should reveal all related stuff. This is the core:

Code:
int CvPlayerAI::AI_getHybridAttitude(PlayerTypes ePlayer) const
{
	int iAttitude = 0;
	for (int iI = 0; iI < GC.getNumCivicOptionInfos(); iI++)
	{
		if (GC.getCivicInfo(GET_PLAYER(ePlayer).getCivics((CivicOptionTypes)iI)).isTerraformer())
		{
			if (GC.getCivicInfo(getCivics((CivicOptionTypes)iI)).isHybrid())
			{
				iAttitude -= (GC.getGameINLINE().getFloweringCounter() / 10);
			}
		}
	}
	return iAttitude;
}

int CvPlayerAI::AI_getTerraformerAttitude(PlayerTypes ePlayer) const
{
	int iAttitude = 0;
	for (int iI = 0; iI < GC.getNumCivicOptionInfos(); iI++)
	{
		if (GC.getCivicInfo(GET_PLAYER(ePlayer).getCivics((CivicOptionTypes)iI)).isHybrid())
		{
			if (GC.getCivicInfo(getCivics((CivicOptionTypes)iI)).isTerraformer())
			{
				iAttitude -= (GC.getGameINLINE().getFloweringCounter() / 10);
			}
		}
	}
	return iAttitude;
}
 
Back
Top Bottom