Stellaris

Stellaris

61 ratings
Dynamic Crisis Strength
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
129.584 KB
7 Sep @ 1:27pm
12 Sep @ 10:06am
3 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.

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
- does not affect mid game crisis for now
- 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 * 2 + empire2 * 1 + empire3 * 0.5 + empire4 * 0.3 + empire5 * 0.2) / 4 . 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.
23 Comments
n3ur0s 16 Sep @ 11:59am 
In regard to the technical details of dividing the average galactic fleet power by an arbitrary value, I think it might make more sense to use a variable divisor based on another galactic weighted average; that way players can intentionally dictate the crisis to be either a pushover or dominator, perhaps even based on considerations other than raw fleet power.
Ornlu 15 Sep @ 10:20am 
Thanks for the answer! I will try it out!
Kano  [author] 15 Sep @ 2:58am 
The mod doesn't use any of the 4.0 features, so it should work fine in 3.14 as far as I can see. Just try it out, spawn a crisis with "effect event crisis.1000" and see if you can influence it's strength in the settings menu.

I am working on including mid game crisis, so great kahn, void worms, gray goo, maybe formless. It feels weird to buff the formless based on the entire galaxy strength when only one empire can defend against them. Dunno why they are counted as a mid game crisis in the first place.
zola 14 Sep @ 5:24pm 
I have the same question
Ornlu 14 Sep @ 1:50am 
Sorry if this is a stupid question, but would this mod work retroactively for 3.14?
warriorandtoaster 13 Sep @ 1:48am 
Is making it so the Khan gets affected by this a planned update?
Welp 12 Sep @ 1:32pm 
thank you for the info, i appreciate the indepth response on it!
Kano  [author] 12 Sep @ 10:32am 
| how does it work when the players strength vastly overwhelms the other 4 top empires?

Well the mod would still consider the top five empires and spawn a crisis to your weighted average fleet power. Since you are the strongest, your fleet power would be factored in much higher than that of the other empires and since you are the only strong force, you would pretty much have to fight of the crisis alone. I changed the weighted average in todays update to 2x, 1x, 0.5x, 0.3x, 0.2x from the old 1x, 0.8x, 0.6x, 0.4x, 0.2x, as the impact of the strongest empire seemed too low.

As an example: If you have you have 1 million fleet power and your allies are worthless, you would get:
(1 million * 2 + 0 * 1 + 0 * 0.5 + 0 * 0.3 + 0 * 0.2) / 4) / 180,000 = 2.8x crisis strength

Compared to all top five empires owning 200,000 fleet power (still 1 million total):
(200k * 2 + 200k * 1 + 200k * 0.5 + 200k * 0.3 + 200k * 0.2) / 4) / 180,000 = 1.1x crisis strength
Welp 12 Sep @ 2:27am 
how does it work when the players strength vastly overwhelms the other 4 top empires?
Kano  [author] 10 Sep @ 2:49pm 
The mod does not override any vanilla files, so there should be no issues with load order.

The 1000x vanilla crisis from ACOT might be problematic, as my mod cancels out any existing modifiers on the crisis. You can disable this functionality in the mod settings tho, then it would just be 1000x + the dynamic calculated buff.

Modded crises are not supported atm, they won't be affected at all.

If you set vanilla crisis to 25 (the normal setting at game setup), then the crisis will be at least level 25. It might be stronger if the mod calculates something above 25. You don't need to change anything in the mod settings for this.

If you select all crisis and 25x, the first one will be 25 or higher, the second 50 or higher, the third 100 or higher, etc.