City Properties

Discussion in 'Strategy and tips' started by pi4t, Jun 3, 2013.

  1. pi4t

    pi4t Warlord

    Joined:
    Aug 2, 2009
    Messages:
    277
    Gender:
    Male
    I think I read how this works (or worked) some time ago, but can't remember or find any thread explaining it. Could someone briefly explain how the city properties (crime, etc...) work? It seems to move towards a value every turn, asymptoting towards it so the change becomes less as it gets closer. I have no idea what value that is, though, except that it unsurprisingly seems to get lower when things which reduce the property in question are added to the city, and vice versa.
     
  2. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,428
    It is actually not hard coded but governed by XML, this XML in the case of crime:
    Spoiler :
    Code:
    		     <PropertyManipulators>
            		<PropertySource>
            			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
              			<PropertyType>PROPERTY_CRIME</PropertyType>
              			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
              			<iPercent>4</iPercent>
            		</PropertySource>
            		<PropertyPropagator>
             			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
              			<PropertyType>PROPERTY_CRIME</PropertyType>
              			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
              			<TargetObjectType>GAMEOBJECT_CITY</TargetObjectType>
              			<TargetRelationType>RELATION_TRADE</TargetRelationType>
              			<iPercent>5</iPercent>
            		</PropertyPropagator>
            		<PropertyPropagator>
              			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
              			<PropertyType>PROPERTY_CRIME</PropertyType>
              			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
              			<TargetObjectType>GAMEOBJECT_PLOT</TargetObjectType>
              			<TargetRelationType>RELATION_NEAR</TargetRelationType>
              			<iTargetDistance>1</iTargetDistance>
              			<iPercent>5</iPercent>
            		</PropertyPropagator>
            		<PropertyPropagator>
              			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
              			<PropertyType>PROPERTY_CRIME</PropertyType>
              			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
              			<TargetObjectType>GAMEOBJECT_CITY</TargetObjectType>
              			<TargetRelationType>RELATION_SAME_PLOT</TargetRelationType>
              			<iPercent>20</iPercent>
            		</PropertyPropagator>
            		<PropertyPropagator>
              			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
              			<PropertyType>PROPERTY_CRIME</PropertyType>
              			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
              			<TargetObjectType>GAMEOBJECT_PLOT</TargetObjectType>
              			<TargetRelationType>RELATION_NEAR</TargetRelationType>
              			<iTargetDistance>1</iTargetDistance>
              			<iPercent>4</iPercent>
              			<Active>
              			  <Is>TAG_OWNED</Is>
              			</Active>
            		</PropertyPropagator>
            		<PropertySource>
              			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
              			<PropertyType>PROPERTY_CRIME</PropertyType>
              			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
              			<iPercent>4</iPercent>
            		</PropertySource>
    	  		</PropertyManipulators>

    In addition to that there are a number of sources and drains defined (from population based on difficulty, on buildings and units) but this is what governs the asymptotic behavior. It defines that there is diffusion and decay of crime. Diffusion makes it move to neighboring plots or trade cities if they have lower crime (or vice versa if they have higher).
    Decay means that 4% of crime (or negative crime) is removed each turn. That means if there are neither sources or drains then it will go towards 0 after some time. But there are constant sources each turn from population and buildings which means that the equilibrium is not 0 but usually some higher value. To be exact you are at the equilibrium if 4% of your crime value is equal to the crime "income" per turn (as then the decay equals the new addition). That means the asymptotic value is 25 times your turn net crime sources in each city.

    Some more information about the property system can be found here (not complete though):
    http://forums.civfanatics.com/showpost.php?p=11295300&postcount=21

    The system itself is quite generic so you are not restricted to a steady state equilibrium as it is used for most of the current properties.
     
  3. LumenAngel

    LumenAngel King

    Joined:
    Apr 15, 2012
    Messages:
    669
    Location:
    Center of the World (France)
    Does that mean a modmod can add a property?
    I was toying a little to add some surnaturel things (I will post it when it'll be over or if I really need help), and having a Vampirism properties cross my mind...
     
  4. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Yes. The only real requirement is that whatever the property does (good or bad, usually through either auto-build buildings or through events) should get worse (or better - doesn't matter so long as consistent) as the property moves through its effective range roughly in proportion to the property value. This constraint is necessary for the AI to be able to evaluate the effects of the property somewhat correctly.
     
  5. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,428
    Yes, the only aspect that is not modular is the icon for the property which needs to be present in the game font TGA (but of course it is no problem to have it there and only use it in a modmod).
     

Share This Page