Stellaris

Stellaris

99 ratings
Dynamic Crisis Strength
4
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
158.178 KB
7 Sep @ 1:27pm
27 Oct @ 6:36am
5 Change Notes ( view )

Subscribe to download
Dynamic Crisis Strength

Description
TLDR: This mod adjusts the endgame crisis level when it spawns, based on the strength of the top 5 empires in the galaxy.

Latest Features
- Now affects mid game crisis

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

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

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

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.
45 Comments
Zalpha 21 hours ago 
Thanks. I will use the mod.
Zalpha 21 hours ago 
No I mean the space pirates that are void dwellers. That is what I meant by Marauders. My bad, I typo'd it and then corrected it incorrectly.
Zalpha 21 hours ago 
No I mean the space pirates that are void dwellers. That is what I meant by Murderers .
Kano  [author] 23 hours ago 
@Zalhpa Fallen Empires are not affected by this mod and don't count for the difficulty calculation.

I assume by Murderers you mean genocidal empires like Fanatical Purifiers? Those would count for the difficulty calculation, but they also have to fight against a crisis, so it seems fair to me.

In case you mean Marauders, those are only affected by the mod if they awaken into the midgame crisis (Great Kahn). In any case, you can always open the settings menu and adjust the difficulty if it's too much, works even after a crisis has spawned.
Zalpha 2 Nov @ 1:36am 
Hi, I am thinking of using this mod but I am worried about Murderers and Fallen Empires, as usually those two are the top factions (I play with max of them enabled) so would it be best if I do not use this mod?
Kano  [author] 27 Oct @ 6:44am 
@Neterixx There was a bug with Cetana, it's fixed in the new version. The mod should now properly detect Cetana during initialization, when you first add it to a save.

In your case, since you already added the mod to the save and initialization has already passed, you can simply open the settings menu and increase the difficulty modifier or static offset by one, then decrease it again. This will trigger a refresh and the mod will now notice the missing variables on the active cetana crisis and fix itself.
Vietnam 27 Oct @ 5:01am 
Very fun when you set the crisis strength to 2x, no matter how strong you will be the crisis will always be stronger, you could literary have endgame ACOT technology and a weaponized quasar from Gigastructures but the crisis will always be stronger than you. The only way to survive is to go to Ultima Vigilis or that isolated pre-FTL system next to Chosen Cluster and lock your population away on an overpopulated ringworld in intergalactic space.
NeteriXX 24 Oct @ 10:32am 
I loaded this mod into my save with Cetana already there and every value is set to zero. In the new save its also the case, does it work only when crisis spawns?
Hasan 22 Oct @ 6:11am 
thx for the fast response.
Hasan 22 Oct @ 6:11am 
nvm, the calculation still works and the request that I wanted was there. Just needed to test it out first.