1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

C2C - Flammability

Discussion in 'Civ4 - Caveman 2 Cosmos' started by Hydromancerx, Oct 5, 2011.

  1. Hydromancerx

    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 ...

    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?
     
  2. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,559
    Location:
    Baden-Württemberg, Germany
    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...
     
  3. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    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?
     
  4. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,409
    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, ...).
     
  5. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    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.
     
  6. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    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
     
  7. climat

    climat King

    Joined:
    Mar 29, 2009
    Messages:
    734
    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.
     
  8. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,409
    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.
     
  9. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    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?
     
  10. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,409
    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.
     
  11. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    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:
     
  12. EldrinFal

    EldrinFal King

    Joined:
    Mar 22, 2011
    Messages:
    926
    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.
     
  13. bill2505

    bill2505 King

    Joined:
    Sep 16, 2009
    Messages:
    645
    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
     
  14. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    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
     
  15. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,409
    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.
     
  16. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    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.
     
  17. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,330
    Gender:
    Male
    Location:
    Canberra, Australia
    If you are giving categories to buildings we can start looking at more complicated display mechanisms in the city screen.
     
  18. sharinel

    sharinel Chieftain

    Joined:
    Jun 23, 2007
    Messages:
    20
    *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*
     
  19. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    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...
     
  20. Necratoid

    Necratoid Warlord

    Joined:
    Apr 5, 2011
    Messages:
    233
    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.
     

Share This Page