Dynamic Crisis Strength
Stellaris: 4.2.*
Note that this mod doesn’t override vanilla game files and is likely to remain compatible even without updates.
TLDR: This mod adjusts the endgame crisis level when it spawns, based on the strength of the top 5 empires in the galaxy.
This Mod:
- can be added to an ongoing game.
- can be added during an ongoing crisis.
- can be used in multiplayer.
- can be removed at any time, changes are reverted automatically.
- does not work with modded crisis at this time.
- has settings accessible via edict.
- affects mid game crisis.
You know how you have to set the crisis level at the start of your playthrough, essentially predicting how well the next 200 years of gameplay will go? Then you actually play the game and when the crisis finally spawns, it’s either a pushover or absolutely dominating. This mod tries to address this problem of appropriate crisis strength by waiting for the crisis to spawn, then measuring the galaxies military strength in overall fleet power and setting the crisis level accordingly.
The mod triggers when any empire is created with one of the crisis types (swarm, extradimensional, ai_empire). It then calculates the fleet power of every playable empire by iterating over each of their owned fleets. The top 5 empires are identified based on their fleet power and a weighted average is calculated as follows with empire1 as the strongest: (empire1 * 1 + empire2 * 0.8 + empire3 * 0.6 + empire4 * 0.4 + empire5 * 0.2) / 3 . In addition, the top 5 player empires are identified and their weighted average is calculated in the same way. Then the average of both values is taken as the galaxy fleet power. It is possible for a player to be present in both the top 5 empires and top 5 players calculation. So with two players as the first and third strongest empire, the calculation would be: ((player1 * 1 + empire2 * 0.8 + player2* 0.6 + empire4 * 0.4 + empire5 * 0.2) / 3 + (player1 * 1 + player2 * 0.8) / 1.8 ) / 2 = galaxy fleet power.
The resulting galaxy fleet power is divided by 180.000 (this number was chosen arbitrarily and might change in future updates) to achieve the dynamic crisis strength, which is then applied to the newly spawned crisis empire as an empire modifier, buffing ship weapon damage, ship hull, ship armor and ship shields. So with a galaxy fleet power of 360.000 the applied dynamic crisis strength would be 360.000 / 180.000 = 1x , so a buff of 100% to ship weapon damage, hull, armor and shields. Mid game crisises have other divider values, at this time: great kahn (60.000), void worms (60.000), gray tempest (90.000). If the result is lower than 1, an additional formula is applied to allow the strength to go into negative values and actually debuff the crisis: ((result – 1) * 2) + 1 = crisis_strength.
Before the buff is applied, the orginial weapon damage is read out and saved as the vanilla crisis level. This vanilla crisis level is taken into account, ensuring that the final modifier on the crisis empire is equal to the desired crisis level. So continuing our previous example, assuming the vanilla crisis is set to 0.75x on captain difficulty, the crisis would have a 71.25% boost already, meaning the mod would apply a buff of 1 – 0.7125 = 0.2875. The applied buff cannot go below 0, meaning the vanilla crisis level set at game start acts as a minimum.
There is a settings event included, which can be triggered via an edict only available to player empires. The settings include a difficulty modifier with which you can make the calculated crisis strength easier or harder or you can override the calculated strength with you own custom value.
Let me know if you find any issues with the mod. Also let me know if the spawned crisis level was adequate, too strong or too weak.
Github [github.com]
Revisions:
Old revisions of this mod are available below. Click the link to download.