Tag requests

There are a number of problems with this:

1) Naming - this method does NOT change the AI attituide, it just gets what the chnage due to buildings is, so yoyu definately shouldn't name it that way (sopmething like getBuildingAttitudeChange() would be more appropriate)

2) As written it calculates the same value in every city, whcuih is the value of all possible buildings since it doesn't check whetehr the city HAS each building before including its contribution. You need an 'if (getNumActiveBuilding(eLoopBuilding) > 0)' test in there inside the loop.

3) I know its only pseudocode so you'd pick this up when you tried to actually compile it, but don't loop over building classes, just loop over buildings directly (i.e. - eLoopBuilding should be you for loop variable)

4) To use it you'll proabbly need to add a loop over cities that calls it and adds up the contribution from each city, to CvPlayerAI::AI_getCivicAttitudeChange(PlayerTypes ePlayer) which currently works out the attitude change due to civics

BTW - it turns out that attitude handling is actually very unusual - almost all building effects are handled in processBuilding() (and almost all civic effects in doCivic()), but attitude calculations are doen totally differently, which is why the pattern for this one is a bit unusual.

So much for it being easy and self-contained. :mischief: I think that I will put this one to rest for a while, until I have more skills with the SDK stuff, and do simpler things for the time being.
 
JosEPh_II brought up an idea with the property system. Other properties like :science:, :health: or :hammers: that can be + or - at different techs. However properties like Crime, Pollution and Flammability we do not have these tags (that I know of).

Could you make tags that give +/- a property at a specific tech? Thanks in advance! :goodjob:

As I said in the balance thread, I'll try after V26 is released.
 
JosEPh_II brought up an idea with the property system. Other properties like :science:, :health: or :hammers: that can be + or - at different techs. However properties like Crime, Pollution and Flammability we do not have these tags (that I know of).

Could you make tags that give +/- a property at a specific tech? Thanks in advance! :goodjob:
You can already do that for properties like crime and pollution.
There is an Active expression tag for property manipulators.
That condition is not rendered into help texts though so it might confuse people but this is possible:

Code:
<PropertyManipulators>
  <PropertySource>
    <PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
    <PropertyType>PROPERTY_CRIME</PropertyType>
    <iAmountPerTurn>-20</iAmountPerTurn>
    <Active>
      <Has>
        <GOMType>GOM_TECH</GOMType>
        <ID>TECH_MYSTICISM</ID>
      </Has>
    </Active>
  </PropertySource>
</PropertyManipulators>
 
You can already do that for properties like crime and pollution.
There is an Active expression tag for property manipulators.
That condition is not rendered into help texts though so it might confuse people but this is possible:

I think he meant adding a property to a building with a tech (sort of like TechCommerceModifiers on buildings, but with properties). Unless you want to do it, I figure that adding a tag like that for properties will be similar enough to the TechCommerceModifiers in structure that I could probably do it.
 
I think he meant adding a property to a building with a tech (sort of like TechCommerceModifiers on buildings, but with properties). Unless you want to do it, I figure that adding a tag like that for properties will be similar enough to the TechCommerceModifiers in structure that I could probably do it.
That is what the XML I posted does. It is a property source on a building that is only active once you have a certain tech, similar to how the TechCommerceModifiers only add commerce once you have the tech.
Of course that method doesn't work for flammability because it is a static property so for that one a separate tag might be useful but only if it is needed.
 
That is what the XML I posted does. It is a property source on a building that is only active once you have a certain tech, similar to how the TechCommerceModifiers only add commerce once you have the tech.
Of course that method doesn't work for flammability because it is a static property so for that one a separate tag might be useful but only if it is needed.

It needs evaluation AI adding for it though - pretty sure stuff that manifests through the expression system generically like this is overlooked by the AI currently isn't it?
 
It needs evaluation AI adding for it though - pretty sure stuff that manifests through the expression system generically like this is overlooked by the AI currently isn't it?
Yes, in this case the Active expression will be overlooked so the AI will assume that that property source is always active so it might value the building too high.
 
Good luck with that. This is NOT a simple task.

Hm, maybe I'll pass on that then. In a perfect world, the AI would only ever see the result of any expression evaluations, but I think after looking a bit that that would involve a LOT of coding. :rolleyes:
 
With
<Active>
<Has>
<GOMType>GOM_TECH</GOMType>
<ID>TECH_MYSTICISM</ID>
</Has>
</Active>

Can this be used in other tags in the traitinfos.xml?
Can it be used on other tags such as:
Spoiler :
<iHealth>-3</iHealth>
<Active>
<Has>
<GOMType>GOM_TECH</GOMType>
<ID>TECH_MACHINERY</ID>
</Has>
</Active>


If so what other GOMtypes are there? Isn't there a thread on the expression system? Can't seem to find it.
 
Hm, maybe I'll pass on that then. In a perfect world, the AI would only ever see the result of any expression evaluations, but I think after looking a bit that that would involve a LOT of coding. :rolleyes:
One somewhat easy thing would be to evaluate the active expression at the moment when you evaluate what you want to build. Of course that means it won't consider what the building value might be in the future.

@Sgtslick: The Active tag is only implemented on property manipulators (there are some other expression tags though like TrainCondition). The expression tutorial can be found here (check the stickied Modder's Documentation thread): http://forums.civfanatics.com/showpost.php?p=11598257&postcount=27

The currently implemented GOMTypes are:
GOM_BUILDING,
GOM_PROMOTION,
GOM_TRAIT,
GOM_FEATURE,
GOM_OPTION,
GOM_TERRAIN,
GOM_GAMESPEED,
GOM_ROUTE,
GOM_BONUS,
GOM_UNITTYPE,
GOM_TECH,
GOM_CIVIC,
GOM_RELIGION,
GOM_CORPORATION,
GOM_IMPROVEMENT
 
One somewhat easy thing would be to evaluate the active expression at the moment when you evaluate what you want to build. Of course that means it won't consider what the building value might be in the future.

That's sort of what I meant by the AI only ever seeing the end-result of Expression evaluations. However, that will have to wait until after the Freeze (which I think we are now in).
 
REQUEST: In the civ4cilivilizationschema.xml the <-Aforeness----!> or whatever it is which adds Bonus happiness change, can this be
can this be extended to include some others such as:

Ripped from DYNAMIC TRAITS mod civilization schema.
These in particular would be good. .


***** *****
<ElementType name="SpecialistYieldChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="YieldChanges"/>
</ElementType>

<ElementType name="iDistanceMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iNumCitiesMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iCorporationMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iWorkerSpeedModifier" content="textOnly" dt:type="int"/>
<ElementType name="iTradeRoutes" content="textOnly" dt:type="int"/>
<ElementType name="iWarWearinessModifier" content="textOnly" dt:type="int"/>
<ElementType name="iAttitudeModifier" content="textOnly" dt:type="int"/>
<ElementType name="iImprovementUpgradeRateModifier" content="textOnly" dt:type="int"/>
***** *****

Spoiler :

<ElementType name="iCityDefenseBonus" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionGreatPeopleRateModifier" content="textOnly" dt:type="int"/>
<ElementType name="iDistanceMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iNumCitiesMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iCorporationMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iFreeExperience" content="textOnly" dt:type="int"/>
<ElementType name="iWorkerSpeedModifier" content="textOnly" dt:type="int"/>
<ElementType name="iImprovementUpgradeRateModifier" content="textOnly" dt:type="int"/>
<ElementType name="iMilitaryProductionModifier" content="textOnly" dt:type="int"/>
<ElementType name="iBaseFreeUnits" content="textOnly" dt:type="int"/>
<ElementType name="iBaseFreeMilitaryUnits" content="textOnly" dt:type="int"/>
<ElementType name="iFreeUnitsPopulationPercent" content="textOnly" dt:type="int"/>
<ElementType name="iFreeMilitaryUnitsPopulationPercent" content="textOnly" dt:type="int"/>
<ElementType name="iGoldPerUnit" content="textOnly" dt:type="int"/>
<ElementType name="iGoldPerMilitaryUnit" content="textOnly" dt:type="int"/>
<ElementType name="iHappyPerMilitaryUnit" content="textOnly" dt:type="int"/>
<ElementType name="bMilitaryFoodProduction" content="textOnly" dt:type="boolean"/>
<ElementType name="iLargestCityHappiness" content="textOnly" dt:type="int"/>
<ElementType name="iWarWearinessModifier" content="textOnly" dt:type="int"/>
<ElementType name="iFreeSpecialist" content="textOnly" dt:type="int"/>
<ElementType name="iTradeRoutes" content="textOnly" dt:type="int"/>
<ElementType name="iMaxConscript" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionHappiness" content="textOnly" dt:type="int"/>
<ElementType name="iNonStateReligionHappiness" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionUnitProductionModifier" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionBuildingProductionModifier" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionFreeExperience" content="textOnly" dt:type="int"/>
<ElementType name="iExpInBorderModifier" content="textOnly" dt:type="int"/>
<ElementType name="SpecialistType" content="textOnly"/>
<ElementType name="YieldModifiers" content="eltOnly">
<element type="iYield" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="CapitalYieldModifiers" content="eltOnly">
<element type="iYield" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="CapitalCommerceModifiers" content="eltOnly">
<element type="iCommerce" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="SpecialistExtraCommerces" content="eltOnly">
<element type="iCommerce" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="YieldChanges" content="eltOnly">
<element type="iYield" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="SpecialistCommerceChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="CommerceChanges"/>
</ElementType>
<ElementType name="SpecialistCommerceChanges" content="eltOnly">
<element type="SpecialistCommerceChange" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="SpecialistYieldChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="YieldChanges"/>
</ElementType>
<ElementType name="SpecialistYieldChanges" content="eltOnly">
<element type="SpecialistYieldChange" minOccurs="0" maxOccurs="*"/>
</ElementType>


* oh and a question - when I put

PropertySourceType>PROPERTYSOURCE_ATTRIBUTE_CONSTANT</PropertySourceType>
<PropertyType>PROPERTY_CRIME</PropertyType>
<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
<RelationType>RELATION_ASSOCIATED</RelationType>
<AttributeType>ATTRIBUTE_POPULATION</AttributeType>
<iAmountPerTurn>3</iAmountPerTurn>
<Active>
<Greater>
<PropertyType>PROPERTY_CRIME</PropertyType>
<Mult>
<AttributeType>ATTRIBUTE_POPULATION</AttributeType>
<Constant>10</Constant>
</Mult>
</Greater>
</Active>
in the traitinfo.xml it doesn't show up in the Civilopedia.
 
Let me get this straight, you were asking for all the tags listed there?

It could be done but it would take a lot of time. I'm immersed in a project already so if I was going to address it, it'd be quite a while before I could get to it. I may want those eventually anyhow though.

The second issue on the property source showing in the pedia is something I'd leave for AIAndy to address for now.
 
What about just these?
Spoiler :
<ElementType name="SpecialistYieldChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="YieldChanges"/>
</ElementType>

<ElementType name="iDistanceMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iNumCitiesMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iCorporationMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iWorkerSpeedModifier" content="textOnly" dt:type="int"/>
<ElementType name="iTradeRoutes" content="textOnly" dt:type="int"/>
<ElementType name="iWarWearinessModifier" content="textOnly" dt:type="int"/>
<ElementType name="iAttitudeModifier" content="textOnly" dt:type="int"/>
<ElementType name="iImprovementUpgradeRateModifier" content="textOnly" dt:type="int"/>


So its not as easy as it being done in one lazy afternoon? Also the dynamic trait dll or schema etc could be used as a reference, would this help?
 
Of course it would help to some extent. And no, that lazy afternoon would be more like a month or so, or more aggravated by the fact that these kinds of modifiers aren't really being employed from the Civilization selection angle which could take added setup to establish.

I manage to workup about 4-6 tags a week if nothing goes wrong or needs to be debugged or learned about how to implement along the way, working on it probably 50% of the time I'm not at work or sleeping.

But yeah, it'd be a bit faster with the reference dll. The problem here isn't setting up just the ability for storing and translating the info in those tags, its all the setup to make them do what they are supposed to do in the first place. Then the AI to give even a modicum of recognition for the ai players to use or at least avoid the pitfalls of these new effects... that really can get overwhelming and makes a programmer want to pick his battles.

However, I've been pondering your request and wondering what exactly you had in mind for it? You're asking for modifiers to go into place for the civilization selection themselves, where those selections are really intended to have little to no real impact right now. The eventual plan there may conflict a lot with what you have in mind, or may harmonize with it quite a bit. Either way, its obvious you're not planning something minor and with little impact. So I'm wondering what you want those modifiers for? If a new thread is appropriate for that discussion, by all means, lets talk ;)
 
I was thinking about your request, SgtSlick, and I began wondering if what would be easier to accomplish would be to create some alternative 'traits' that aren't intended to be tagged to leaders but rather to civilizations themselves. A few tags could probably create this effect and would cut down on the dll workload quite a bit rather than creating a whole list of tags such as that for the civilizations. They could then be granted to leaders as a 'free trait' based on the civilization they lead.
 
Back
Top Bottom