Extending the generic property system

I just will post some links on North America stuff that I feel is important, but the articles were just a quick search. I would look more if anyone really is interested.

A quick overview here.
http://employees.oneonta.edu/walkerr/Archaeology/A Culture History of North America.ppt

Overall timeline

The website associated.
http://www.museum.state.il.us/ismdepts/anthro/proj_point/points_timeline.html

Some projectiles in time periods.
http://www.uwlax.edu/mvac/PointGuide/PointGuide.htm

Another website with some info

http://inquiryunlimited.org/timelines/histNatAm.html

Anyway there is some baby step techs that could be placed to give more details. I do not know if anyone would want the different stone users as units.

I quick small article that I thought might sum up human inventions. I do not agree completely with it necessarily. The details are kinda summed up simple without more details. Anyway might give an overview of human milestones in technology. Its the top ten human inventions.

http://listverse.com/2007/10/07/top-10-ancient-inventions/

Hmmm interesting. I will have to consider a throwing spear that comes before the Atl-Atl. I could see it coming at Spear Making and then upgrading to the Atl-Atl. So something like ...

Rock Thrower (STR 1) -> Slinger (STR 2) -> Atl-Atl (STR 4) -> Archer (STR 5) -> Longbowman (STR 8)

Clubman (STR 2) -> Stone Throwing Spearman (STR 3) -> Atl-Atl (STR 4) -> Javelineer (STR 5) -> Early Skrimisher (STR 6)

Clubman (STR 2) -> Stone Spearman (STR 3) -> Atl-Atl (STR 4) -> Spearman (STR 5) -> Pikeman (STR 6)

Techs
None = Rock Thrower
Scavenging = Clubman
Tool Making & Weaving = Slinger
Spear Making = Stone Spearman, Stone Throwing Spearman
Axe Making = Stone Axeman
Hunting & Spear Fishing = Atl-Atl
Archery = Archer
Copper Making = Spearman, Javelineer
Bronze Making = Axeman
Siege Warfare = Pikeman, Early Skrimisher
Feudalism = Longbowman

Note that the Spearman and Javelineer lineages upgrade at the same time while the Axeman and Archer lineages are staggered between.
 
I am a total idiot. Thought I was in a different thread. I will move that crap out of here. sorry.
 
No idea what TPing is. Public nudity as bad comes more from the Puritan movement so is very modern.

TPing = Toilet Papering

And yes all of these are from Sim city which comes in the Modern Era. Thus we would have to not only place these at appropriate techs but make up some new "crimes" from earlier eras.
 
Lets try to get crime done before the freeze.

For sources I'd say use a source that adds 1 per population in addition to the crime that crime buildings add.

Have you decided which buildings you want to autobuild depending on crime in a city yet (which then apply the negative effects), Hydro?

The change of all the current crime and law buildings to being property sources needs to be somewhat one step as the way it is now is incompatible to a drain/source property.
Maybe we should use SVN branching here so the main branch is not disturbed while the crime property is transferred to the new system step by step.

So how do you make buildings to be auto built if you have high enough crime? Also will they always build if you reach enough crime or is it random?
 
So how do you make buildings to be auto built if you have high enough crime? Also will they always build if you reach enough crime or is it random?
They will always be built and currently the requirements of the building are not checked but I will add that check (changes in the building requirements will not take effect until the next time the property changes but that should be fine as properties change all the time).

To add that, open the property info XML.
Then add this to the property:
Code:
      <PropertyBuildings>
        <PropertyBuilding>
          <BuildingType>BUILDING_CAR_THEFT</BuildingType>
          <iMinValue>500</iMinValue>
          <iMaxValue>100000</iMaxValue>
        </PropertyBuilding>
      </PropertyBuildings>
 
Why is there a max value? What happens if it goes over the max value?
It is a range. If the property value gets outside that range, the building is removed.
You need that if you want to have some buildings only at low crime or at negative crime.
Or another use would be to have multiple versions of a building that are used at different crime levels.
 
Ah ok. That makes sense. Thanks for explaining.

With such a system to "force" buildings upon cities is very powerful. I suspect we will need lots of testing to get the range right. But should give some great balance to all the abundant :), :health: and :gold: around. Be it crime to counter the :) or disease to counter the :health:.
 
OK, I'm working on updating Alcatraz and Las Vegas Strip for the new properties system. Just so I'm clear, I need a Good for Alcatraz's -20 crime in all cities, correct?
 
OK, I'm working on updating Alcatraz and Las Vegas Strip for the new properties system. Just so I'm clear, I need a Good for Alcatraz's -20 crime in all cities, correct?

You will need to make a new building that is given for free by Alcatraz. This building will use the new code that gives negative crime per turn. Thus you would have ..

Code:
<PropertyManipulators>
  <PropertySource>
    <PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
    <PropertyType>PROPERTY_CRIME</PropertyType>
    <iAmountPerTurn>-20</iAmountPerTurn>
  </PropertySource>
</PropertyManipulators>

Note that for my other negative crime buildings I have the text for the name as "Safety (Youth Curfew)". So you will want to name it "Safety (Alcatraz)" so they are in the same text format. The tags on the other hand you can name whatever you want.

Understand?
 
@AIAndy

When adding the <PropertyBuildings> code to my building files it gives me this error. I updated my SVN and even went and replaced all my building schemas with even newer versions. Why is it not working?

Did I do the code wrong? Here is an example ...
Spoiler :
Code:
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_CRIME_TPING</BuildingClass>
			<Type>BUILDING_CRIME_TPING</Type>
			<SpecialBuildingType>NONE</SpecialBuildingType>
			<Description>TXT_KEY_BUILDING_CRIME_TPING</Description>
			<Civilopedia>TXT_KEY_BUILDING_CRIME_TPING_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_CRIME_TPING_STRATEGY</Strategy>
			<Advisor>ADVISOR_ECONOMY</Advisor>
			<ArtDefineTag>ART_DEF_BUILDING_CRIME_TPING</ArtDefineTag>
			<MovieDefineTag>NONE</MovieDefineTag>
			<HolyCity>NONE</HolyCity>
			<ReligionType>NONE</ReligionType>
			<StateReligion>NONE</StateReligion>
			<bStateReligion>0</bStateReligion>
			<PrereqReligion>NONE</PrereqReligion>
			<PrereqCorporation>NONE</PrereqCorporation>
			<FoundsCorporation>NONE</FoundsCorporation>
			<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
			<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
			<VictoryPrereq>NONE</VictoryPrereq>
			<FreeStartEra>NONE</FreeStartEra>
			<MaxStartEra>NONE</MaxStartEra>
			<ObsoleteTech>NONE</ObsoleteTech>
			<PrereqTech>TECH_MODERN_SANITATION</PrereqTech>
			<Bonus>NONE</Bonus>
			<PrereqBonuses/>
			<HappinessTraits/>
			<NoBonus>NONE</NoBonus>
			<PowerBonus>NONE</PowerBonus>
			<FreeBonus>NONE</FreeBonus>
			<iNumFreeBonuses>0</iNumFreeBonuses>
			<FreeBuilding>NONE</FreeBuilding>
			<FreePromotion>NONE</FreePromotion>
			<CivicOption>NONE</CivicOption>
			<GreatPeopleUnitClass>NONE</GreatPeopleUnitClass>
			<iGreatPeopleRateChange>0</iGreatPeopleRateChange>
			<iHurryAngerModifier>0</iHurryAngerModifier>
			<bBorderObstacle>0</bBorderObstacle>
			<bTeamShare>0</bTeamShare>
			<bWater>0</bWater>
			<bRiver>0</bRiver>
			<bPower>0</bPower>
			<bDirtyPower>0</bDirtyPower>
			<bAreaCleanPower>0</bAreaCleanPower>
			<DiploVoteType>NONE</DiploVoteType>
			<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
			<bCapital>0</bCapital>
			<bGovernmentCenter>0</bGovernmentCenter>
			<bGoldenAge>0</bGoldenAge>
			<bAllowsNukes>0</bAllowsNukes>
			<bMapCentering>0</bMapCentering>
			<bNoUnhappiness>0</bNoUnhappiness>
			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
			<bNeverCapture>0</bNeverCapture>
			<bNukeImmune>1</bNukeImmune>
			<bPrereqReligion>0</bPrereqReligion>
			<bCenterInCity>0</bCenterInCity>
			<iAIWeight>10</iAIWeight>
			<iCost>-1</iCost>
			<iHurryCostModifier>0</iHurryCostModifier>
			<iAdvancedStartCost>100</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>-1</iAdvancedStartCostIncrease>
			<iMinAreaSize>-1</iMinAreaSize>
			<iConquestProb>0</iConquestProb>
			<iCitiesPrereq>0</iCitiesPrereq>
			<iTeamsPrereq>0</iTeamsPrereq>
			<iLevelPrereq>0</iLevelPrereq>
			<iMinLatitude>0</iMinLatitude>
			<iMaxLatitude>90</iMaxLatitude>
			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
			<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
			<iAnarchyModifier>0</iAnarchyModifier>
			<iGoldenAgeModifier>0</iGoldenAgeModifier>
			<iGlobalHurryModifier>0</iGlobalHurryModifier>
			<iExperience>0</iExperience>
			<iGlobalExperience>0</iGlobalExperience>
			<iFoodKept>0</iFoodKept>
			<iAirlift>0</iAirlift>
			<iAirModifier>0</iAirModifier>
			<iAirUnitCapacity>0</iAirUnitCapacity>
			<iNukeModifier>0</iNukeModifier>
			<iNukeExplosionRand>0</iNukeExplosionRand>
			<iFreeSpecialist>0</iFreeSpecialist>
			<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
			<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
			<iMaintenanceModifier>0</iMaintenanceModifier>
			<iWarWearinessModifier>0</iWarWearinessModifier>
			<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
			<iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
			<iHealRateChange>0</iHealRateChange>
			<iHealth>0</iHealth>
			<iAreaHealth>0</iAreaHealth>
			<iGlobalHealth>0</iGlobalHealth>
			<iHappiness>-1</iHappiness>
			<iAreaHappiness>0</iAreaHappiness>
			<iGlobalHappiness>0</iGlobalHappiness>
			<iStateReligionHappiness>0</iStateReligionHappiness>
			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
			<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
			<iSpaceProductionModifier>0</iSpaceProductionModifier>
			<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
			<iTradeRoutes>0</iTradeRoutes>
			<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
			<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
			<iTradeRouteModifier>0</iTradeRouteModifier>
			<iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
			<iGlobalPopulationChange>0</iGlobalPopulationChange>
			<iFreeTechs>0</iFreeTechs>
			<iDefense>0</iDefense>
			<iBombardDefense>0</iBombardDefense>
			<iAllCityDefense>0</iAllCityDefense>
			<iEspionageDefense>0</iEspionageDefense>
			<iAsset>0</iAsset>
			<iPower>1</iPower>
			<fVisibilityPriority>1.0</fVisibilityPriority>
			<SeaPlotYieldChanges/>
			<RiverPlotYieldChanges/>
			<GlobalSeaPlotYieldChanges/>
			<CommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
			</CommerceChanges>
			<ObsoleteSafeCommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
			</ObsoleteSafeCommerceChanges>
			<CommerceChangeDoubleTimes/>
			<CommerceModifiers/>
			<GlobalCommerceModifiers/>
			<SpecialistExtraCommerces/>
			<StateReligionCommerces/>
			<CommerceHappinesses/>
			<ReligionChanges/>
			<SpecialistCounts/>
			<FreeSpecialistCounts/>
			<CommerceFlexibles/>
			<CommerceChangeOriginalOwners/>
			<ConstructSound/>
			<BonusProductionModifiers>
			</BonusProductionModifiers>
			<DomainFreeExperiences/>
			<DomainProductionModifiers/>
			<BuildingHappinessChanges/>
			<PrereqBuildingClasses/>
			<SpecialistYieldChanges/>
			<ImprovementFreeSpecialists/>
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
		      	<PropertyBuildings>
			 <PropertyBuilding>
			     <BuildingType>BUILDING_CRIME_TPING</BuildingType>
			     <iMinValue>10</iMinValue>
			     <iMaxValue>100000</iMaxValue>
 			  </PropertyBuilding>
 			</PropertyBuildings>
			<iRevolutionIndexModifier>0</iRevolutionIndexModifier>
		</BuildingInfo>
 
The <PropertyBuildings> code belongs into CIV4PropertyInfos.xml.

So like this?
Spoiler :

Code:
<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- ReModified by StrategyOnly -->
<!-- -->
<Civ4PropertyInfos xmlns="x-schema:Hydro_CIV4GameInfoSchema.xml">
	<PropertyInfos>
		<PropertyInfo>
			<Type>PROPERTY_CRIME</Type>
		      	  <PropertyBuildings>
			 	<PropertyBuilding>
			     	<BuildingType>BUILDING_CRIME_TPING</BuildingType>
			     	<iMinValue>10</iMinValue>
			     	<iMaxValue>100000</iMaxValue>
 			  </PropertyBuilding>
			 <PropertyBuilding>
			     <BuildingType>BUILDING_CRIME_GRAFFITI</BuildingType>
			     <iMinValue>20</iMinValue>
			     <iMaxValue>100000</iMaxValue>
 			  </PropertyBuilding>
		</PropertyInfo>
	</PropertyInfos>
</Civ4PropertyInfos>
 
So like this?
Spoiler :

Code:
<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- ReModified by StrategyOnly -->
<!-- -->
<Civ4PropertyInfos xmlns="x-schema:Hydro_CIV4GameInfoSchema.xml">
	<PropertyInfos>
		<PropertyInfo>
			<Type>PROPERTY_CRIME</Type>
		      	  <PropertyBuildings>
			 	<PropertyBuilding>
			     	<BuildingType>BUILDING_CRIME_TPING</BuildingType>
			     	<iMinValue>10</iMinValue>
			     	<iMaxValue>100000</iMaxValue>
 			  </PropertyBuilding>
			 <PropertyBuilding>
			     <BuildingType>BUILDING_CRIME_GRAFFITI</BuildingType>
			     <iMinValue>20</iMinValue>
			     <iMaxValue>100000</iMaxValue>
 			  </PropertyBuilding>
 			</PropertyBuildings>
		</PropertyInfo>
	</PropertyInfos>
</Civ4PropertyInfos>
Correct. I assume higher values for iMinValue are needed though.
 
Thanks for your help AIAndy and ofcouse all the amazing code!

So I added 20 types of Crimes to the SVN. They are ordered to each other but they may not be balanced to the game yet. I have a bunch more I want to do but I want these tested out first. Here is the list of 20.

- Crime (Arson)
- Crime (Bank Robbery)
- Crime (Burglary)
- Crime (Car Theft)
- Crime (Counterfeiting)
- Crime (Drugs)
- Crime (Drunk Driving)
- Crime (Fighting)
- Crime (Flashing)
- Crime (Forgery)
- Crime (Gangs)
- Crime (Graffiti)
- Crime (Mugging)
- Crime (Murder)
- Crime (Pickpocketing)
- Crime (Poaching)
- Crime (Organized Crime)
- Crime (Rape)
- Crime (Soliciting)
- Crime (Toilet Papering)
 
@AIAndy

So in some initial testing I have a city with 140 Crime. Crime (Forgery) has a minimum of 75 and shows up. But Crime (Counterfeiting) has a minimum of 100 and is not showing up at all. Why is one showing up and the other is not.

Note that Crime (Forgery) is last on the list. So I am wondering if the code has to be written a different way. However when loading I got now errors so I assume the code is correct.
 
@AIAndy

So in some initial testing I have a city with 140 Crime. Crime (Forgery) has a minimum of 75 and shows up. But Crime (Counterfeiting) has a minimum of 100 and is not showing up at all. Why is one showing up and the other is not.

Note that Crime (Forgery) is last on the list. So I am wondering if the code has to be written a different way. However when loading I got now errors so I assume the code is correct.
Have you tried reordering to see if it is always the last one in the list that is not added?
 
The bug Koshling found should fix this issue.

I have also prepared the code that checks if the building may actually be placed in the city whenever the property changes. There is a chance that it causes performance issues as it uses an uncached variant of canConstruct.
 
Top Bottom