Real Natural Disasters (released)

Infixo

Deity
Joined
Jan 9, 2016
Messages
4,012
Location
Warsaw
The mod is RELEASED.

New - first playable Version 2.0

  • Visualizations
  • Disaster prevention mechanisms
  • Disaster resources
  • Many tweaks and improvements
Download and read details here


The Real Natural Disasters mod (RND for short) adds to the game random events in the form of natural disasters. It's basic working version is ready - you can get it here or from Steam. However, it needs some polishing and tuning, and I also want to implement a few minor features, that's why I consider it still Work-in-Progress.

All comments, ideas and bug reports highly appreciated :)

Steam link

disasters.jpg

Implemented disasters: Earthquake, Flood, Meteor, Tornado, Tsunami, Volcano, Wildfire.

How does it work?
The mechanism works like this:
  1. When the game starts or is loaded from a save file, the map is evaluated for each disaster to find possible places for it to happen.
  2. Each turn the mod checks if any disaster has happened. It is randomized and depends on couple parameters.
  3. If the answer is yes - the disaster of a chosen type happens with a specific magnitude, also randomized using a Gutenberg-Richter-type algorithm.
  4. The disaster affects all tiles in its range causing various types of damage, depending on magnitude and what is on the tile.
  5. A detailed devastation report is shown to the player on his/her turn.
  6. There are 4 new Lenses implemented: 3 shows possible places where a disaster my happen (risk areas) and 1 shows the recent disaster. The Lenses only show areas that the player has revealed.

Phase 1 - Map evaluation
Just a quick overview of where the event may happen:
  • Earthquake - hills and mountains that have at least one hill/mountain adjacent; some natural wonders are considered a mountain (everest, kilimanjaro, etc.)
  • Flood - all rivers and lakes
  • Meteor - land and coastal sea (excluded ocean so there won't be 'empty' hits)
  • Tornado - flatlands that have at least 2 other flatlands adjacent (so the tornado may actually move)
  • Tsunami - ocean areas 3-tiles away from land; tsunami always goes towards land
  • Volcano - all mountains
  • Wildfire - flammable tiles that have at least other flammable tile adjacent; flammable = forest, grass, some resources (e.g. tobacco, silk, wheat, etc.) As for now rainforest is not flammable.

Phase 2 - Did it happen?
Each disaster has a probability assigned on the tile level. So, e.g. the more mountains on the map - the more probable will be a volcano eruption, on Islands map expect more tsunamis, etc. The probabilities are calibrated in such a way that on the Continents map (a reference map) of the Standard size (8 players) for a Standard game pace (500 turns) there should be ~105 events for the entire game:
  • 25 earthquakes,
  • 15 floods,
  • 5 meteors,
  • 15 tornadoes,
  • 10 tsunamis,
  • 10 volcano eruptions,
  • 25 wildfires.
The above may change due to the map size - smaller maps will have less events (i.e. Tiny - 75), bigger more (i.e. Huge - 125). The probability of an event is also adjusted for Game Speed, so full length game will have the chosen number of events.

Phase 3 - Magnitude
Magnitude or the stregth of the event is also randomly chosen, but it follows the Gutenberg-Richter formula which was discovered for earthquakes. It says that the more powerful the event, the less probable it is. The correlation is logarithmic. The mod uses similar approach, so basically you can expect:
  • Cat 1 - 45% of events (minimal damage)
  • Cat 2 - 25% of events (moderate damage)
  • Cat 3 - 15% (extensive damage)
  • Cat 4 - 8% (extreme damage)
  • Cat 5 - 5% (catastrophic damage)
  • Cat X - ~1% (total damage)
Basically, the magnitude is a number in range 0..100. Each disaster type has a different range of magnitudes possible. It allows to simulate various effects for different types of disasters.

Phase 4 - Affected area
Each disaster works in a different way.
  • Earthquake - area around starting point (epicenter), 3-tiles radius
  • Flood - a second starting point is chosen adjacent to the initial one and from them the water flows 2-tiles into any flatlands tile (so, hills and mountains are not flooded)
  • Meteor - 2-tiles around epicenter (hit point)
  • Tornado - it moves in a straight line, up to 5 tiles from starting point; a hill or a mountain may change its direction; cannot go into water
  • Tsunami - a 2-directional wave is generated from epicenter that goes towards land; the wave goes for 5 tiles, so usually it reaches 2-3 tiles into the land. The wave is stopped by mountains and ice caps.
  • Volcano - 2-tile aroun d the volcano-mountain.
  • Wildfire - all flammable tiles into a specific direction (wind direction, actually) up to 4-tiles away from the starting point.
Magnitude is lowered with each tile away from epicenter. Usually by -10, in some cases -5 (e.g flood and wildfire).

Phase 5 - Devastation
Depending on the magnitude, the stronger the disaster, the more damage it does. Basically, magnitude is used to assess the final effect. Assuming that M is the magnitude for a given tile:
  • Units - can be killed with probability M/2, otherwise wounded for M hp. The unit may die due to wounds.
  • Improvements - destroyed with M/2 probability, otherwise pillaged. Yes - the farms, mines, etc. are actually removed from the map if destroyed.
  • City - losses some percentage of population, between M/4 to M/2. For average (50) disasters a city of 10 population loses 3 pop.
  • Districts - only Encampment and City Center - lose M*2 or M*3 hitpoints, depending on whether there are walls or not.
  • Buildings - destroyed with M/2 probability, pillaged with M probability, there's a chance that they will survive untouched
A detailed report is presented for the platyer - see attached pictures.

Phase 6 - Lenses and Report
For each disaster type a map of potential starting points is shown (risk areas). They have different colors.
The recent disaster is shown using specific disaster type colour with white line around it and starting point is marked with ZOC sign. When you select Recent Disaster Lens, a popup info with the report will be opened as well, so you can access it any time you want.

Credits
This mod uses astog's More Lenses so it can be used with CQUI.

Version 1.1
- Startup Options that allow to select number of disasters, their strength and range.
- Disasters frequency is automaticaly adjusted also for Game Speed.
- Volcano Range is 2 due to ashes (not only magma).
- Improvements may sometimes survive (same as Buildings in Cities).
- Player's civ name is highlighted in Green in the report, so it's easy to find.

Version 1.2 - Improvements
- You can now turn down the volume of sound warnings using the volume slider for Special Effects in Audio Options.
- In the report, if the civ has not been met, its name will not be shown.
- 'Free' turn (no disaster, only info screen) will happen at 1st turn, no matter what the starting Era is.
- "No disasters" option added for modpacks that would include RND but someone wanted to play without RND
- Fixed some warnings when using CQUI, now the logs should be clear.
 

Attachments

  • Real Natural Disasters (v1.0).zip
    1.3 MB · Views: 322
  • flood.jpg
    flood.jpg
    379.1 KB · Views: 1,096
  • earthquake.jpg
    earthquake.jpg
    366.2 KB · Views: 1,080
  • tsunami.jpg
    tsunami.jpg
    340.5 KB · Views: 1,151
  • tornado.jpg
    tornado.jpg
    330.4 KB · Views: 983
  • wildfire.jpg
    wildfire.jpg
    268.2 KB · Views: 933
  • Real Natural Disasters (v1.1).zip
    1.3 MB · Views: 291
  • Real Natural Disasters (v1.2).zip
    1.3 MB · Views: 376
Last edited:
Some more ideas:
1. Natural disasters should be able to completely wipe out small cities (<4-5 pop).
2. Meteor hitting into ocean should be able cause mass tsunamis on it`s shores.
3. Volcanic eruptions should be able to cover larger areas (pyroclastic flows, ash rains).
4. Disaster + missle silo = small chance of nuclear/thermonuclear explosion if civilization owns nuclear warheads.
5. High magnitude disasters can pillage wonders.
6. Buildings and wonders for protection from disasters.
 
Just found your fine mod on Steam. Great experience.

Would it be possible to choose frequency of desasters by dropdown menu on startup? Check City Name Generator for setup view.
My first testing showed up random desaster every 2-4 turns, which may cause total destruction of civ in early ancient era.

Just some inspiration while testing:
+ one additional mod might offer suffering civilization or even neighbours some possible reactions to choose from
- leave city ruins and found new city (city is dead + gain new settler)
- build up defence (flood - dam, earthquake - better building footing [longer time for building houses], meteor - higher invest in science to prevent, aso.)
- neighbour can help (+1 diplo) / sack (+ goods or slaves)
 
J
My first testing showed up random desaster every 2-4 turns, which may cause total destruction of civ in early ancient era.
Also ran test game. On turn 5, my capital city suffered direct hit by meteor. Instant game over.
 
Guys, thanks for new ideas and comments. Really appreciate it, especially how the game plays.

City destruction.
I have thought about it and decided that for the intital version the city can only be damaged. I can do destruction, it's possible, but just wanna hear which option is more prudent from the gameplay perspective.

Frequency.
Trust me - it is really random. You may have couple events one be one, or one every 4 turns, or as I had yesterday - waited 22 turns for the first event. All in all what matters is average. Also, map type influences it. There is some useful info in Lua.log. It should say how many tiles are risk tiles for each event. If you could post it from time to time I could tell you if probabilities are ok.
Anyway, implementing some kind of starting option for this is on my list of 'minor things to do'.

Missile silo.
Good idea. I thought about nuclear meltdown from power plants (I assume they are nuclear, in Civ5 they were explicitly nuclear) as some kind of Civilization-type-disaster. Also plane crashes. Missile silos - I really like it.

Chain events.
Like meteor causing tsunami. Well, also thought about it. There not many of such situations (e.g. Can have wildfire from volcano also), so as for now rather not going to do it explicitly. It is however in some kind of indirect form - meteors won't hit ocean BUT tsunamis are always coming from ocean. You can assume that some of them are actually caused by meteors.
 
Cont'd

Defense against disasters
Yes, had it in mind too. Dam ok. Nice idea for earthquakes - must figure out how to implement bigger production costs, though. I have though of:
- Implement early warning system: Less damage, I.e. Magnitude -10 - could be used for volcano, earthquake, tornado, tsunami
- Building - fire brigade: prevents wildfire in city’s working range - can see on the map!
- Building Shelter: Less pop loss for various events
- Building Breakwaters in Harbor - prevents Tsunami in 3-tile radius
- Building Dam - for flood prevention
Last one is really good:
- Building Insurance comp - for each pillaged improvement or destroyed, or building, etc. you will get money! But building will be expensive, the more objects you build (I.e. Insurance costs more)

Wonders
Didn't figure out yet if they can be pillaged or destroyed, so as for now they are 'untouchable'. I don't think Wonder can be pillaged during normal gameplay, can't it?

Diplomacy
Great idea, however no clue at first how to do it. There are not many diplo functions exposed for modding unfortunately. Mostly make peace, war and envoys management. So this might wait for better times or we'll come up with some kind of workaround. Also - if there's an active action needed, we must always think if AI could use it or how to make it use it.
 
Cont'd
Wonders
Didn't figure out yet if they can be pillaged or destroyed, so as for now they are 'untouchable'. I don't think Wonder can be pillaged during normal gameplay, can't it?
It`s possible to pillage wonder by hitting it with nuclear explosion. And if you pillage 7 or more enemy wonders with single nuke, you get achievment named "7 Wonders of Apocalypse".
 
Looks very good already, do you plan to use visual effects?

From my look at the assets in the firetuner, this may be possible (with limitations) using lua scripts.

Like fire and smoke in forest, dust during earthquake, water fx for flood/tsunami, etc...
 
t`s possible to pillage wonder by hitting it with nuclear explosion. And if you pillage 7 or more enemy wonders with single nuke, you get achievment named "7 Wonders of Apocalypse
Wow, didn't know that. And later you can normally Repair it, like normal building?
 
Looks very good already, do you plan to use visual effect
It certainly would be awesome, but I'm not skilled in deep graphical modding (I can do an icon :)) I would need somebody's help here.
You mentioned assets in FireTuner. There's a tab Asset Preview, I think, but I haven't worked out what it does. So, are you saying that we can apply visual effect on the map using FT?
 
It certainly would be awesome, but I'm not skilled in deep graphical modding (I can do an icon :)) I would need somebody's help here.
You mentioned assets in FireTuner. There's a tab Asset Preview, I think, but I haven't worked out what it does. So, as you saying that we can apply visual effect on the map using FT?
Yes, and by extend using only lua scripting to play an existing effect where/when needed, nothing to mod related to the art files.

When playing with the nuclear explosion fx on the tuner, I though it would be perfect for a M. A. D. mod for example.

So that's something I wanted to test more deeply, and your mod would be the perfect base for that.

If you want I can provide some help.
 
3. Volcanic eruptions should be able to cover larger areas (pyroclastic flows, ash rains).
Good point, I forgot about ashes. 1-tile is just for flowing magma, which IRL doesn't go far (that's why 1-tile only). I also was thinking about applying some post-effect, since volcanic ashes are a good fertilizer, the affected tiles could be modified with +1 food yield.
Edit. But for balance, the ones that were covered with magma probably would have to be rendered totally useless, e.g. Resource removed, food yields removed, etc. Would leave only production and gold yields, probably.
 
Last edited:
So that's something I wanted to test more deeply, and your mod would be the perfect base for that.
If you want I can provide some help.
Sure, yes :) if you can figure out how to run a VFX from Lua, that would allow for incredible things in our mods!
As for now, could you pls tell how to run this explosion from FT?
 
Some more ideas:
1. Chain events: Earthquake->Volcano eruption, Earthquake->Tsunami, Meteor->Earthquake, Flood ->Epidemic etc.
2. Civilization/Technogenic disasters: Epidemics, Dam breakages, Nuclear Meltdowns, Major Pollutions etc.
3. Reduced disaster frequency in early ages, as there are no way for protection at this time.
4. Global disasters (late-game), like Global Warming, Nuclear/Volcanic Winter, Supervolcano Explosion etc.
 
Guys, thanks for new ideas and comments. Really appreciate it, especially how the game plays.

Frequency.
Trust me - it is really random. You may have couple events one be one, or one every 4 turns, or as I had yesterday - waited 22 turns for the first event. All in all what matters is average. Also, map type influences it. There is some useful info in Lua.log. It should say how many tiles are risk tiles for each event. If you could post it from time to time I could tell you if probabilities are ok.
Anyway, implementing some kind of starting option for this is on my list of 'minor things to do'.

Probably the frequency is written down on startup and never revised. In my game I literarily had event every 4 turns, no frequency change recognized in my game. Would be more interesting to see high frequency in early eras and less in later ones, because tech will catch up desasters by early warning systems and else.

Well...if you like to go religious path, religion founder may be able to 'direct' desasters toward enemy by having prophet praying for a (desaster-) 'wonder' or something similar.
 
Great!
Hope it would evolve and serve as a base for map changing events in the future (you know, DLL future :scan:).
But for now I have just simple idea: what about increasing disaster frequency every time nuclear device is used/blown up?
 
Sure, yes :) if you can figure out how to run a VFX from Lua, that would allow for incredible things in our mods!
As for now, could you pls tell how to run this explosion from FT?

Just check "Assets Placement Enabled" in the firetuner, select an effect (an asset starting with FX) then click on a plot.

the tuner is a bit capricious, sometime I need to close and reopen it to make this work.
Spoiler :
Clipboard-5.jpg


Result of the above placement in game:
Spoiler :
Clipboard-4.jpg


To test an asset on a plot from a lua script, I use:
Code:
function PlaceAssetAt(AssetType, x, y)
    local wX, wY =  UI.GridToWorld( x, y)
    local ID = AssetPreview.Create(AssetType, wX, wY, 10)
    if ID then print("ID " .. tostring(ID) .." = ".. tostring(AssetType) .." at ".. tostring(x) .. "," .. tostring(y)) end
end
Where wX, wY is at the center of the plot at (x,y)

Then I can call PlaceAssetAt("FX_Atomic_Bomb_Explosion", pPlot:GetX(), pPlot:GetY()) for a nice explosion (only visual, no gameplay effect) on pPlot.

To place multiple assets to simulate a fire event, I'd use a similar function, but with some (small) variations on wX, wY

You can have a look at TunerAssetPreviewPanel.lua for the code, the available functions are:
AssetPreview.Create
AssetPreview.Destroy
AssetPreview.DestroyAll
AssetPreview.DestroyAt
AssetPreview.GetAssetCount
AssetPreview.GetAssetName
AssetPreview.GetInstanceCount
AssetPreview.GetInstanceInfoByID
AssetPreview.GetInstanceInfoByIndex
AssetPreview.SetInstanceOrientation
AssetPreview.SetInstancePosition
AssetPreview.SetInstanceScale

For real use in a mod, you need to set some tables and timers to remove them, using AssetPreview.Destroy(ID) or AssetPreview.DestroyAt(pPlot).
 
Posted Version 1.1 (here)
- Startup Options that allow to select number of disasters, their strength and range.
- Disasters frequency is automaticaly adjusted also for Game Speed.
- Volcano Range is 2 due to ashes (not only magma).
- Improvements may sometimes survive (same as Buildings in Cities).
- Player's civ name is highlighted in Green in the report, so it's easy to find.
 
Top Bottom