On Power (electrical)

I looked at the tutorial and I made a code up like this:

Code:
		<PropertyInfo>
			<Type>PROPERTY_ELECTRICITY</Type>
			<Description>TXT_KEY_PROPERTY_ELECTRICITY</Description>
			<Strategy>TXT_KEY_PROPERTY_ELECTRICITY_STRATEGY</Strategy>
			<ValueDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_DISPLAY</ValueDisplayText>
			<ChangeDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_CHANGE</ChangeDisplayText>
			<ChangeAllCitiesDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_CHANGE_ALL_CITIES</ChangeAllCitiesDisplayText>
			<PrereqMinDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_PREREQ_MIN</PrereqMinDisplayText>
			<PrereqMaxDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_PREREQ_MAX</PrereqMaxDisplayText>
			<bSourceDrain>1</bSourceDrain>
			<iAIWeight>100</iAIWeight>
			<AIScaleType>AISCALE_CITY</AIScaleType>
			<iOperationalRangeMin>0</iOperationalRangeMin>
			<iOperationalRangeMax>1000</iOperationalRangeMax>
			<FontButtonIndex>0</FontButtonIndex>
		     <PropertyManipulators>
        		<PropertySource>
        			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<iPercent>4</iPercent>
        		</PropertySource>
        		<PropertyPropagator>
         			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_CITY</TargetObjectType>
          			<TargetRelationType>RELATION_TRADE</TargetRelationType>
          			<iPercent>5</iPercent>
        		</PropertyPropagator>
        		<PropertyPropagator>
          			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_PLOT</TargetObjectType>
          			<TargetRelationType>RELATION_NEAR</TargetRelationType>
          			<iTargetDistance>10</iTargetDistance>
          			<iPercent>0</iPercent>
        		</PropertyPropagator>
        		<PropertyPropagator>
          			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_CITY</TargetObjectType>
          			<TargetRelationType>RELATION_NEAR</TargetRelationType>
          			<iTargetDistance>10</iTargetDistance>
          			<iPercent>90</iPercent>
        		</PropertyPropagator>
        		<PropertyPropagator>
          			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_PLOT</TargetObjectType>
          			<TargetRelationType>RELATION_NEAR</TargetRelationType>
          			<iTargetDistance>10</iTargetDistance>
          			<iPercent>90</iPercent>
          			<Active>
          			  <Is>TAG_OWNED</Is>
          			</Active>
        		</PropertyPropagator>
        		<PropertySource>
          			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
          			<iPercent>100</iPercent>
        		</PropertySource>
        		<PropertySource>
          			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<iPercent>90</iPercent>
        		</PropertySource>
	  		</PropertyManipulators>
		</PropertyInfo>

Power should be impossible to store on normal plots. Cities are able to store a little power. Is it possible that they store more with a certain building or a tech?

Then, we'd need places where it gathers (and decays). This would be cities and some improvements.
The Factory Line, Cottage Line, Vertical Farms (they also should produce some energy, maybe?), Modern Mines, Routes past electrical Railroads, Wells... Will complete the list.

Some improvements will produce energy: Windmills (past electricity), Solar Pannels, Offshore Windparks (to be added), Geothermal Factory... They will spread it to cities.

Looks good so far?
 
I'd forgotten to look in on this but you seem to have a good handle on it yes. We'll see how it plays once implemented and perhaps do some tweaks as we go. Yes, I would think a city should be able to develop more ability to store electricity as tech and buildings that affect this emerge.
 
Not sure but it would be akin to the code that makes pop add crime only this time it would subtract. Let them subtract all they want all along so long as electricity has a minimum of 0 on plots and cities. There MAY be a processing issue with that approach but perhaps an easily fixed one.
 
But it seems wrong to me that they use energy right after the discovery of Electricity. It took some time till electric tools and light entered the normal population, right?

And I don't know what code to use in order to have a minimum of 0 electricity (which is still wrong, I think. It should go negative as well, but without any worse effect than 0 has.)

The Crime stuff is dealt with in the GameInfo on Difficulty, right?
 
But it seems wrong to me that they use energy right after the discovery of Electricity. It took some time till electric tools and light entered the normal population, right?

And I don't know what code to use in order to have a minimum of 0 electricity (which is still wrong, I think. It should go negative as well, but without any worse effect than 0 has.)

The Crime stuff is dealt with in the GameInfo on Difficulty, right?

You make a good point that population should consume electricity based on tech development so they should indeed start at 0 each until modifiers introduced by tech achievements. I think it would be done through the tech infos in a similar manner to how trait property modifiers are done. You can even do something like -1 electricity per 3 population to start and build from there - that sorta thing.

I'll see if I can't figure out the minimum coding for ya. But why should it be allowed to be negative? No electricity is no electricity... you can't have less than no electricity right?

Not sure on the 3rd question but I'll look into it later - you may have that answer before I do.
 
But it seems wrong to me that they use energy right after the discovery of Electricity. It took some time till electric tools and light entered the normal population, right?

Although it is a 'tech' arrived at by 'research', 'discoveries' (of technologies) in the game represent something more like '(civ-wide) implementations'...
 
You make a good point that population should consume electricity based on tech development so they should indeed start at 0 each until modifiers introduced by tech achievements. I think it would be done through the tech infos in a similar manner to how trait property modifiers are done. You can even do something like -1 electricity per 3 population to start and build from there - that sorta thing.

Ah, good idea! Hydro had a list, but it's a very simple list and would need tweaking. I don't think electrical power consumption has only doubled per pop between the discovery of electricity and nowadays :mischief:

I'll see if I can't figure out the minimum coding for ya. But why should it be allowed to be negative? No electricity is no electricity... you can't have less than no electricity right?

The explain to me: Negative Crime, Air Pollution, Disease, Water Pollution and Flameability :D Of course you can't have less then zero, but it helps you to see if you have -2 Power or -2000.

Not sure on the 3rd question but I'll look into it later - you may have that answer before I do.

Yes, found it. I also set up the text file:


Spoiler :

Code:
		<PropertyInfo>
			<Type>PROPERTY_ELECTRICITY</Type>
			<Description>TXT_KEY_PROPERTY_ELECTRICITY</Description>
			<Strategy>TXT_KEY_PROPERTY_ELECTRICITY_STRATEGY</Strategy>
			<ValueDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_DISPLAY</ValueDisplayText>
			<ChangeDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_CHANGE</ChangeDisplayText>
			<ChangeAllCitiesDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_CHANGE_ALL_CITIES</ChangeAllCitiesDisplayText>
			<PrereqMinDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_PREREQ_MIN</PrereqMinDisplayText>
			<PrereqMaxDisplayText>TXT_KEY_PROPERTY_ELECTRICITY_PREREQ_MAX</PrereqMaxDisplayText>
			<bSourceDrain>1</bSourceDrain>
			<iAIWeight>100</iAIWeight>
			<AIScaleType>AISCALE_CITY</AIScaleType>
			<iOperationalRangeMin>0</iOperationalRangeMin>
			<iOperationalRangeMax>1000</iOperationalRangeMax>
			<FontButtonIndex>0</FontButtonIndex>
		     <PropertyManipulators>
        		<PropertySource>
        			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<iPercent>4</iPercent>
        		</PropertySource>
        		<PropertyPropagator>
         			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_CITY</TargetObjectType>
          			<TargetRelationType>RELATION_TRADE</TargetRelationType>
          			<iPercent>5</iPercent>
        		</PropertyPropagator>
        		<PropertyPropagator>
          			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_PLOT</TargetObjectType>
          			<TargetRelationType>RELATION_NEAR</TargetRelationType>
          			<iTargetDistance>10</iTargetDistance>
          			<iPercent>0</iPercent>
        		</PropertyPropagator>
        		<PropertyPropagator>
          			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_CITY</TargetObjectType>
          			<TargetRelationType>RELATION_NEAR</TargetRelationType>
          			<iTargetDistance>10</iTargetDistance>
          			<iPercent>90</iPercent>
        		</PropertyPropagator>
        		<PropertyPropagator>
          			<PropertyPropagatorType>PROPERTYPROPAGATOR_DIFFUSE</PropertyPropagatorType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
          			<TargetObjectType>GAMEOBJECT_PLOT</TargetObjectType>
          			<TargetRelationType>RELATION_NEAR</TargetRelationType>
          			<iTargetDistance>10</iTargetDistance>
          			<iPercent>90</iPercent>
          			<Active>
          			  <Is>TAG_OWNED</Is>
          			</Active>
        		</PropertyPropagator>
        		<PropertySource>
          			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
          			<iPercent>100</iPercent>
        		</PropertySource>
        		<PropertySource>
          			<PropertySourceType>PROPERTYSOURCE_DECAY</PropertySourceType>
          			<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
          			<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
          			<iPercent>90</iPercent>
        		</PropertySource>
       			 <PropertySource>
        			<PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
        				<PropertyType>PROPERTY_ELECTRICITY</PropertyType>
        				<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
       			 		<RelationType>RELATION_ASSOCIATED</RelationType>
        				<iAmountPerTurn>
        				  <Div>
        	 			   	<Mult>
        	      					<AttributeType>ATTRIBUTE_POPULATION</AttributeType>
        	      					<Constant>3</Constant>
        	   				</Mult>
        	    				<Constant>1</Constant>
        	  			  </Div>
        				</iAmountPerTurn>
			        </PropertySource>
	  		</PropertyManipulators>
		</PropertyInfo>





----------------------------------------
In XML/TEXT/PROPERTY
----------------------------------------

	<TEXT>
		<Tag>TXT_KEY_PROPERTY_ELECTRICITY</Tag>
		<English>Electricity</English>
		<French>Electricity</French>
		<German>Electricity</German>
		<Italian>Electricity</Italian>
		<Spanish>Electricity</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_PROPERTY_ELECTRICITY_STRATEGY</Tag>
		<English>[H1]Electricity[\H1][PARAGRAPH:2]Most of the more advanced Buildings, along with your people need electricity to work properly. Electricity can be produced by powerplants in the city or improvements.</English>
		<French>[H1]Electricity[\H1][PARAGRAPH:2]Most of the more advanced Buildings, along with your people need electricity to work properly. Electricity can be produced by powerplants in the city or improvements.</French>
		<German>[H1]Electricity[\H1][PARAGRAPH:2]Most of the more advanced Buildings, along with your people need electricity to work properly. Electricity can be produced by powerplants in the city or improvements.</German>
		<Italian>[H1]Electricity[\H1][PARAGRAPH:2]Most of the more advanced Buildings, along with your people need electricity to work properly. Electricity can be produced by powerplants in the city or improvements.</Italian>
		<Spanish>[H1]Electricity[\H1][PARAGRAPH:2]Most of the more advanced Buildings, along with your people need electricity to work properly. Electricity can be produced by powerplants in the city or improvements.</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_PROPERTY_ELECTRICITY_DISPLAY</Tag>
		<English>Electricity: %D1</English>
		<French>Electricity: %D1</French>
		<German>Electricity: %D1</German>
		<Italian>Electricity: %D1</Italian>
		<Spanish>Electricity: %D1</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_PROPERTY_ELECTRICITY_CHANGE</Tag>
		<English>[ICON_BULLET]Changes Electricity by %D1</English>
		<French>[ICON_BULLET]Change Electricity de %D1</French>
		<German>[ICON_BULLET]Changes Electricity by %D1</German>
		<Italian>[ICON_BULLET]Changes Electricity by %D1</Italian>
		<Spanish>[ICON_BULLET]Cambia la tasa de Electricity en %D1</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_PROPERTY_ELECTRICITY_CHANGE_ALL_CITIES</Tag>
		<English>[ICON_BULLET]Changes Electricity in all cities by %D1</English>
		<French>[ICON_BULLET]Change le Electricity dans toutes les villes de %D1</French>
		<German>[ICON_BULLET]Changes Electricity in all cities by %D1</German>
		<Italian>[ICON_BULLET]Changes Electricity in all cities by %D1</Italian>
		<Spanish>[ICON_BULLET]Cambia la tasa de Electricity en %D1 en todas las ciudades</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_PROPERTY_ELECTRICITY_PREREQ_MIN</Tag>
		<English>[COLOR_WARNING_TEXT]Needs a Electricity of at least %D1[COLOR_REVERT]</English>
		<French>[COLOR_WARNING_TEXT]Requiert un Electricity d'au moins %D1[COLOR_REVERT]</French>
		<German>[COLOR_WARNING_TEXT]Needs a Electricity of at least %D1[COLOR_REVERT]</German>
		<Italian>[COLOR_WARNING_TEXT]Needs a Electricity of at least %D1[COLOR_REVERT]</Italian>
		<Spanish>[COLOR_WARNING_TEXT]Requiere una tasa de Electricity de al menos %D1[COLOR_REVERT]</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_PROPERTY_ELECTRICITY_PREREQ_MAX</Tag>
		<English>[COLOR_WARNING_TEXT]Needs a Electricity of at most %D1[COLOR_REVERT]</English>
		<French>[COLOR_WARNING_TEXT]Requiert un Electricity au maximum de %D1[COLOR_REVERT]</French>
		<German>[COLOR_WARNING_TEXT]Needs a Electricity of at most %D1[COLOR_REVERT]</German>
		<Italian>[COLOR_WARNING_TEXT]Needs a Electricity of at most %D1[COLOR_REVERT]</Italian>
		<Spanish>[COLOR_WARNING_TEXT]Requiere una tasa de Electricity de como máximo %D1[COLOR_REVERT]</Spanish>
	</TEXT>
 
The explain to me: Negative Crime, Air Pollution, Disease, Water Pollution and Flameability
Actually... I can.

Crime rate is not a measure of the amount of crime taking place but rather the willingness of the people to commit it. There is no limit to the amount of programmed resistance to the idea of committing a crime among the people. The further into the negative, the more opposed they are to crossing legal boundaries.

Negative Pollution: we can assume that nature already has pollutants in the terms we consider them to be now. Cleanup procedures CAN 'clean' even 'natural' pollutants. (In reality, this could mean we could cause just as much a problem cleaning up tooo much... just like overuse of anti-bacterial soap will cause a problem for the skin because it's eliminating all the helpful bacteria as well.)

Disease is the measure of any lack of carefulness, sanitation level, and factors that may be widely affecting the immune systems of the people. It is not a measure of the amount of disease present, it's a measure of the vulnerability to disease. It follows the same rationale into the negative as crime - no limit to the amount of protection that can be generated for the citizens against disease.

Flammability: You can simply think of flammability as the chance for a fire. You can be over the top protected against fire just as you can against disease.

However, Electricity... this is a measure of the amount of Electricity on the grid. You can't get less than no available power.
 
Flammability: You can simply think of flammability as the chance for a fire. You can be over the top protected against fire just as you can against disease.

A CHANCE can't be negative as well.
See the Electricity Property then as a demand for energy: You have 200 less MW then you'd need for example. I'd just want negative values for gameplay reasons: It will be more insightful if you can see how much more power you need.
 
A CHANCE can't be negative as well.
See the Electricity Property then as a demand for energy: You have 200 less MW then you'd need for example. I'd just want negative values for gameplay reasons: It will be more insightful if you can see how much more power you need.

Sure it can when its a contested value. Less than no chance is quite rational when you consider that other forces are to be evaluated. Take a plank of wood for example. You could imagine it having a 0 flammability when it has just been cut and is fresh.

Now, it can hardly be set on fire but it is capable. It's just not going to spontaneously burst into flames on its own. Exposed to another fire or very hot conditions or dried out, it becomes much more capable of finding cause to burn thus its flammability increases. But if one were to treat it with anti-flame chemicals you'd reduce it's factor to below 0. Still possible at that point for it to burn if exposed to another fire but it's much less likely at that point, thus a negative value. So when I say Flammability is a 'chance' it's more to be considered a likelihood that can be varied depending on a number of environmental factors.


If you look at the Electricity property as a demand (at least the - being demand) then you're saying that the demand grows even when it is not supplied. If you turn on a light switch and there is no power to offer it, the lightbulb won't seek to make up the difference once electricity is supplied. Allowing a negative value is like saying it would.

For gameplay, I get your point but it doesn't help the player at all. What it does is it means that insufficient power cannot grow to the point that a city will turn back on once the demand is saved up to reach the point that it is filled for a round. Limiting the property to 0 and not allowing it to go negative will mean you don't have to make up for deficiencies as if the power was somehow used even though there wasn't enough. Your method would allow a power debt to grow and that debt would be unfair to the player and to the laws of physics.

Demand is represented by all the negative energy factors and should be fairly visible. If you're getting a negative property adjustment each round, you're burning more electricity than you are generating. And you'd be able to see, even the way it is now, in the city screen how 'in the red' you're running on power. To fix it you simply would need to get that property back to the gain side rather than the loss side and as soon as you did you'd have enough power for the city to function rather than having to pay off all the needs that weren't met in the black out period.
 
Depends where you set the 0 for flameability. You could also say the normal frsh cut wood had a flameability of 10 and if you put it under water it will go to 1 or close to 0. Thus still no negative. But let's stop discussing on that.

You are right with the electricity dept, you can't use more than you have, but you can demand more then you have. If you want it to be minimum zero, find out how to do that and I'm ok with that. But most certainly, people WILL complain about it since they want to know how much power is too much and which is the right amound.
 
hmm... I would've thought iOperationalRangeMin on the property definition would've done it but apparently not because Crime has a 0 on that tag as it is.

It MAY require an extra tag so for now go about it without the minimum. And we'll have to discuss which of us programmers would be best to add a tag for iAbsoluteMin and iAbsoluteMax that won't allow the property to go beyond those values.
 
Is desgning new Properties just XML Code like we do buildings and Techs?
 
And we'll have to discuss which of us programmers would be best to add a tag for iAbsoluteMin and iAbsoluteMax that won't allow the property to go beyond those values.

Let's get n47 out of the kitchen. She's a smart one.
 
Is desgning new Properties just XML Code like we do buildings and Techs?

Pretty much but it's the most complex xml you can work on and you may find some more programming support becomes necessary as we're finding here.
 
Pretty much but it's the most complex xml you can work on and you may find some more programming support becomes necessary as we're finding here.

Guess I will be stay away, I'm not that advanced in XML except editing values. Creating XML code is a different thing.
 
This is what I have so far:

List of tags:

1) A "min value" for properties, in case of electricity: 0.
2) A modifier/change on techs so we can say: "with the discovery of electronics, every 3 pop consume 1 Electricity." "With computers, every 2 pop consume 1 electricity" and "with Tech X total energie consumed is increased / reduced by x %"
3) A "with power" tag like the "Factory" has. For example: "The Building gives 3 :science:, 2:gold: ; +3:science: with power" I'm not sure if we can use the tag on the factory or if we need another one. Works probably best similar to the
"TechCommerceChange" and the respective modifier and YieldChange/Modifier.
4) A "iPriority" tag. If the city has not enough Power to support all buildings, this tag is used to decide what buildings has the highest priority to get power. The highest priority Buildings would be Hospitals, Waterpumps and Airports while
Accelerators would have a very low priority. If to buildings have the same priority, the building that is build earlier would get the power access.
5) A "only works with power tag" (boolean). If it is "1" and the city has not enough power to maintain this building, the same thing happen that happens now when you lost access to power in your city. I don't know if this will actually REMOVE the
building that requires power and autobuild it when power is restored...
6) A tag that allows us to give a building: "+2:science:, -3 Power with tech X." Maybe also for resources.
7) A Civic modifier that allows "total energy consumed is increased / decreased by x% with civic X.
8) A tag for improvements so they will produce less or more yield depending if it has energy or not. (Or is this too complex?)
9) A tag that allows buildings to store the property. Right now, 90% of energy not used in a city will be wasted since you can't really store it. But you could build a giant battery complex that would allow you to store 200 Energy for example.
10) A way to transfer energy from your offshore powerplants to your cites.
11) A mechanism to keep the electricity property inside your own boarders but will also allow you to trade it to your friends.
 
Back
Top Bottom