C2C - Flammability

Hydromancerx

C2C Modder
Joined
Feb 27, 2008
Messages
16,281
Location
California, USA
Bringing an old topic of mine that I have been wanting for a long time ...

I was wondering if a new "factor" could be added to simulate the cities "flammability"? It could work like this; highly flammable building such as an Oil Power Plant, Oil Refinery, Chemical Plant, etc would have a large amount of "flammability" while a fires station, fire brigade, artesian well, etc would lower the cities flammability. If it got too high then it would increase the risk of a fire. If a fire occurs then building will be destroyed. In other words you could control how frequent those random fire disaster events occurred. So could this work? And what do you think?

Here are some building I think should either increase or decrease flammability. By how much, we can decide later.

Increase Flammability
Alchemist Lab
Armourer
Chemical Plant
Coal Plant
Coal Refinery
Factory
Fertilizer Plant
Filling Factory
Fire Pit
Forge
Foundry
Glasssmith
Industrial Park
Iron Forge
Iron Foundry
Ironworks
Laboratory
Lighthouse
Manufacturing Plant
Mech Assembly Plant
Oil Power Plant
Oil Refinery
Oil Well
Steel Mill
Silver Processing Plant
Sulfur Distillery
The Great Lighthouse
Waste to Energy Plant

Decrease Flammability
Aqueduct
Artesian Well
Fire Brigade
Fire Dock
Fire Station
Town Well
Cistern
Hand Water Pump
Wind Water Pump
Reservoir
Water Pumping Station
Desalinization Plant
Fire Hydrants
Fire Hanger

I am sure there could be more of each as well as techs that could effect things as well. Fire Suppression tech comes to mind as an example.

------------

So now I am going to try to put a % to how flamable these buildings are.

Increase Flammability
Alchemist Lab = +15%
Armourer = +10%
Chemical Plant = +25%
Coal Plant = +30%
Coal Refinery = +20%
Factory = +20%
Fertilizer Plant = +25%
Filling Factory = +25%
Fire Pit = +5%
Forge = +5%
Foundry = +10%
Glasssmith = +5%
Industrial Park = +25%
Iron Forge = +10%
Iron Foundry = +10%
Ironworks = +30%
Laboratory = +25%
Lighthouse = +5%
Manufacturing Plant = +20%
Mech Assembly Plant = +20%
Oil Power Plant = +30%
Oil Refinery = +30%
Oil Well = +30%
Steel Mill = +25%
Silver Processing Plant = +20%
Sulfur Distillery = +30%
The Great Lighthouse = +10%
Waste to Energy Plant = +20%

Decrease Flammability
Aqueduct = -5%
Artesian Well = -5%
Fire Brigade = -15%
Fire Dock = -20%
Fire Station = -25%
Town Well = -5%
Cistern = -5%
Hand Water Pump = -5%
Wind Water Pump = -5%
Reservoir = -25%
Water Pumping Station = -10%
Desalinization Plant = -10%
Fire Hydrants = -25%
Fire Hanger = -25%

Tell me if you think these % are too high or too low

I also had an idea for some National Ordinances to help with this. ....

Smoke Detector Ordinance (Req Firefighting, Electronics) [National Project]

Special Abilities
  • +1 Health in All Cities
  • -15% Flammability in All Cities

Fire Code Ordinance (Req Firefighting, Civil Engineering) [National Project]

Special Abilities
  • +5% Maintenance in All Cities
  • +1 Health in All Cities
  • -30% Flammability in All Cities

While we have many more buildings than RoM/AND I think the idea is the same. Flammable buildings increase the odds for a Fire Event and Anti-Fire buildings reduce the %. The question is can this be done? Perhaps a talented event coder like ori could help. Anyone?
 
one could probably assign a flammability score to each building - then run a candotrigger python script to look at all buildings in the city to see if it exceeds a certain score - and if yes trigger.
Then just use a python script to pick one or more buildings to destroy in the actual event.

Essentially you would have a base chance for the event to trigger at all - and if it could trigger it would check whether there is enough fuel to do so.

Edit: one could also do multiple events with increasing likelihood at increasing flammability thresholds, with iWeight governing the chance of the event and iflammable being the score, lets say flammability starts at 100 and the scores you state are just added/subtracted:
iWeight - iflammable
5 - 100 <-- very unlikely
25 -200 <-- unlikely
125 - 300 <-- about average chance for an event
625 - 400 <-- high chance for an event
3125 - 500 <-- very high chance for an event

one could even go finer than that - just clone the triggers...
 
Hmmm, I wonder if Koshling or AIAndy could help out with the "flammability score". I could easily add them to buildings if there was a new type of tag I could add to buildings that had say a numerical score.

EDIT:
On a side note could a similar system be set up for crime? Thus causing/reducing the chances of crime related events?
 
Sure, can do.

Do you intend to have further such scores in the future?
Instead of the fast way now to simply add those tags I could also implement a more generic system that allows to add any number of named properties to a building or unit which are then accumulated and tracked on different levels (city, player, team, ...).
 
That would be awesome! Being able to apply new values linked to events would be great! The potential for such a system would only be limited to how many events ori would want to link them to.

If you can do that then heck yeah! :woohoo:

Some ideas ...

Garbage
Give a garbage value to buildings. Different buildings produce some it added up can cause side events if reaching different levels. Civics like the Garbage Civic could help reduce it as well as buildings. A much more dynamic system than we have now with just +/-:health:. Possibly even linking it to diplomacy where you could import/export it.

Electricity
Same deal as garbage with the import/export. Power Plants could produce it and buildings could consume it and events like power outages could occur if you consumed more than you made.

Jobs
Different buildings would provide jobs and a % of the population would consume it (since not all of the population are old enough to work). Possibly even having events link to this where if there are not enough jobs that economy will go into a recession. Likewise health and happiness could go down.

Homes
Residential Buildings would provide places for people to live. At different city sizes if they went over then people would start to get homeless. Thus adding to unhealthy and unhappy events.

Traffic
Increased population and trade could add to traffic which could add to air pollution traffic jam events, etc. Different transportation builds could help solve this problem within your city.

Pollution
Different buildings could have air and water pollution. If water pollution got over a threshold then not only could it increase the unhealthiness but remove your freshwater. Air pollution on the other hand could be more direct with sickness.

You get the idea. All my sim city dreams could come true with such a system.
 
Sure, can do.

Do you intend to have further such scores in the future?
Instead of the fast way now to simply add those tags I could also implement a more generic system that allows to add any number of named properties to a building or unit which are then accumulated and tracked on different levels (city, player, team, ...).

Go for it ;-) Flexibility rules. Make sure the XML defs for each opaque quantity give some way to add AI values. It AT LEAST needs an AiWeight and probably some sort of AI category (treat the weight as if it arises in the area of food,producion,culture,stability,...). Possibly some sort of AI weight scale factor too (scale by population, scale by food, scale by production, ...)

To be fully general you'll need (for each XML-definable quantity) in approximate priority order (only the first is 100% necessary but each increase the system's flexibility):

Amount from building
Amount from civic
Percent modifier on amount from building
Area amount from building
Trade area amount from building
Percent modifier on amount from civic
Percent modifier on amount from building in area
 
Although I like the ideas, I'm little bit concerned.
Won't those considerably increase micromanagement? Players will have to consider whole things, other than happiness and unhealthiness, for TONS of cities, not to mention AIs usually suck at management. Certain degree of complexity is for fun, but too much complexity is against it and rather a nuisance.
 
Go for it ;-) Flexibility rules. Make sure the XML defs for each opaque quantity give some way to add AI values. It AT LEAST needs an AiWeight and probably some sort of AI category (treat the weight as if it arises in the area of food,producion,culture,stability,...). Possibly some sort of AI weight scale factor too (scale by population, scale by food, scale by production, ...)

To be fully general you'll need (for each XML-definable quantity) in approximate priority order (only the first is 100% necessary but each increase the system's flexibility):

Amount from building
Amount from civic
Percent modifier on amount from building
Area amount from building
Trade area amount from building
Percent modifier on amount from civic
Percent modifier on amount from building in area
I think for starters I will restrict it to int values that stack additively, come from buildings and propagate upwards (building -> city -> player per area -> player).
Otherwise complexity might cause problems and extension is still possible later.
Goods can probably be used to apply a score to more than one city.

The scores are defined in a new info xml with AI weight, AI category, text to display it in mouseover and text to display it in pedia.
 
I think for starters I will restrict it to int values that stack additively, come from buildings and propagate upwards (building -> city -> player per area -> player).
Otherwise complexity might cause problems and extension is still possible later.
Goods can probably be used to apply a score to more than one city.

The scores are defined in a new info xml with AI weight, AI category, text to display it in mouseover and text to display it in pedia.

Are you going to make the necessary additions to use the AIWeight and AICategory (how to use the last is somewhat vague and probably evaluation-routine dependent) in the building evaluation routines or do you need me to do that?
 
Are you going to make the necessary additions to use the AIWeight and AICategory (how to use the last is somewhat vague and probably evaluation-routine dependent) in the building evaluation routines or do you need me to do that?
It is probably better if you do that part (after I am finished with the mechanic) as I have not investigated the AI part of the code yet.
 
Although I like the ideas, I'm little bit concerned.
Won't those considerably increase micromanagement? Players will have to consider whole things, other than happiness and unhealthiness, for TONS of cities, not to mention AIs usually suck at management. Certain degree of complexity is for fun, but too much complexity is against it and rather a nuisance.

Well come should be self correcting. For instance if the AI builds too many flammable buildings then it will have fire events. Eventually the fire will remove the flammable building causing all the fires. Same would go for the player. Then again if you have bad luck it could burn down the fire station. :lol:
 
Although I like the ideas, I'm little bit concerned.
Won't those considerably increase micromanagement? Players will have to consider whole things, other than happiness and unhealthiness, for TONS of cities, not to mention AIs usually suck at management. Certain degree of complexity is for fun, but too much complexity is against it and rather a nuisance.

I agree with climat's sentiments that we should be cautious of creating too much micromanagement for the player. In fact, I would suggest if you're going to make all these values, that they be triggered off/on by "Advanced Economy" or some other game configuration option. It's a lot of management that I think some people would not want to deal with.

Going from a simple system of Resource X present or not present, to quantities required across multiple fields is a big change. Flammability and pollution is not as bad as jobs or electricity (commented on that in another thread as well) since I think you could do a lot behind the scenes-- though you will need indicators on the interface. But also keep in mind that this will require even MORE balancing. You can't just toss numbers out there w/ buildings and expect it to work out. And now instead of merely Science, Culture, Gold, Production, Health, Espionage... there will be the addition of Jobs, Electricity, Homes, Traffic, etc. that will need to be considered when choosing a building.
 
That would be awesome! Being able to apply new values linked to events would be great! The potential for such a system would only be limited to how many events ori would want to link them to.

If you can do that then heck yeah! :woohoo:

Some ideas ...

Garbage
Give a garbage value to buildings. Different buildings produce some it added up can cause side events if reaching different levels. Civics like the Garbage Civic could help reduce it as well as buildings. A much more dynamic system than we have now with just +/-:health:. Possibly even linking it to diplomacy where you could import/export it.

Electricity
Same deal as garbage with the import/export. Power Plants could produce it and buildings could consume it and events like power outages could occur if you consumed more than you made.

Jobs
Different buildings would provide jobs and a % of the population would consume it (since not all of the population are old enough to work). Possibly even having events link to this where if there are not enough jobs that economy will go into a recession. Likewise health and happiness could go down.

Homes
Residential Buildings would provide places for people to live. At different city sizes if they went over then people would start to get homeless. Thus adding to unhealthy and unhappy events.

Traffic
Increased population and trade could add to traffic which could add to air pollution traffic jam events, etc. Different transportation builds could help solve this problem within your city.

Pollution
Different buildings could have air and water pollution. If water pollution got over a threshold then not only could it increase the unhealthiness but remove your freshwater. Air pollution on the other hand could be more direct with sickness.

You get the idea. All my sim city dreams could come true with such a system.

i love these options.these ideas are very good. of course it should optional.only the home suggestion is not very good. why? because even if you build all the houses your city will keep growing so all the new pop will be homeless
 
i love these options.these ideas are very good. of course it should optional.only the home suggestion is not very good. why? because even if you build all the houses your city will keep growing so all the new pop will be homeless

We mustn't go TOO wild on these. Especially ones (traffic comes to mind) that are pretty well modelled now (with health for example). Complexity has to add to gameplay in some unique way more than it distracts with added clutter
 
The new XML file is added to the SVN: CIV4PropertyInfos.xml. I also added a tag to the building schema but that is not yet read in.
Functional code is missing still, it is only read in.
 
The new XML file is added to the SVN: CIV4PropertyInfos.xml. I also added a tag to the building schema but that is not yet read in.
Functional code is missing still, it is only read in.

We need to have a mechanism to define the AI categories (necessarily in the DLL since it has to interpret them, but exposed so the XML can reference it). I suggest you use the UnitAIType as a model.
 
We need to have a mechanism to define the AI categories (necessarily in the DLL since it has to interpret them, but exposed so the XML can reference it). I suggest you use the UnitAIType as a model.

If you are giving categories to buildings we can start looking at more complicated display mechanisms in the city screen.
 
*Cue television advert starring boy staring soulfully out at you, with the heartrending music*

This is Ray. Ray has a problem. Ray suffers from builderitis. Ray hasn't seen a military unit in over 1000 years. Ray has over 500 million billion buildings to build in the prehistoric era alone just to keep his city from falling apart, and he only has 21 hammers. Please, a small donation of 5 hammers a month could stop Ray from sobbing uncontrollably when yet another set of buildings are introduced. You could make all the difference. Think of Ray. Think of the children.

*Advert fades out*
 
If you are giving categories to buildings we can start looking at more complicated display mechanisms in the city screen.

Different sort of categorization really, and this is not of buildings, it's of properties (new modifiers, like flamability). We can categorize buildings now easily enough (I could write a routine that could be exposed to Python to use for filtering easily enough), it's just that I haven't the Python UI skills to add UI elements for filtering. If someone wants to volunteer for that aspect I will add a category method to CyBuilding that can be used to drive it...
 
I request in advance that there be an on/off option for these new things in the Custom game options.

I think your going to be better with a fire control civic that makes/lets you build ordinance (not building buildings that require a civic to function) in your cities. Which means revoltions to change civics increase the risk of fires as your not paying people to not let that happen. Unless your running the ordinance bucket brigades and then volenteer fire fighters.

Also, I think you'd be best off making the ordinance per town build issue. Make a new national project thing only opens up the options. Then go for the civic at first.

If your adding in flamability, make sure its also a combat mechanic... C2C has arsonists as a long term unit after all... though using fire as a weapon should risk causing unit killing fires on plant filled tiles. Crispy Stacks of Doom. Also that means adding in wildfires/forest fires that are hard to put out until you get fire fighting units. unit starting with works and then to professionals are needs to stop this mess.... which means storms and such causing fires with lightning.

In short, that is a giant can-o-worms your opening.
 
Top Bottom