View Full Version : negative reaction to civics?


davidlallen
Jul 07, 2009, 06:33 PM
In the Dune Wars mod (http://forums.civfanatics.com/forumdisplay.php?f=358), we are attempting to add some new civics which are similar to the terraforming civics in Planetfall. Please see this post (http://forums.civfanatics.com/showthread.php?t=327009) 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?

Ahriman
Jul 07, 2009, 09:11 PM
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?

davidlallen
Jul 08, 2009, 02:46 PM
Solution (changed source files from "darkciv") at this link (http://forums.civfanatics.com/showpost.php?p=8246243&postcount=4).

Pfeffersack
Jul 08, 2009, 02:47 PM
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.


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...

Maniac
Jul 09, 2009, 01:28 PM
Solution (changed source files from "darkciv") at this link (http://forums.civfanatics.com/showpost.php?p=8246243&postcount=4).

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:

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((Ci vicOptionTypes)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((Ci vicOptionTypes)iI)).isHybrid())
{
if (GC.getCivicInfo(getCivics((CivicOptionTypes)iI)). isTerraformer())
{
iAttitude -= (GC.getGameINLINE().getFloweringCounter() / 10);
}
}
}
return iAttitude;
}

davidlallen
Jul 18, 2009, 12:41 PM
We have this working now based on darkciv; more details at this post (http://forums.civfanatics.com/showpost.php?p=8276059&postcount=5).