From 6c1c709a19d8dc3a695be2fe2cdceda5f2a013d2 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Fri, 30 Dec 2022 14:20:55 -0800 Subject: [PATCH] FACTO-204: added a mod setting to allow for evolution configuration for adaptation --- changelog.txt | 2 +- control.lua | 2 ++ libs/AIPlanning.lua | 2 +- locale/en/locale.cfg | 2 ++ settings.lua | 12 ++++++++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 74371f1..ace06c3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,10 +2,10 @@ Version: 3.2.0 Improvements: - Added console command /rampantRemoveNewEnemies which changes all new enemies to vanilla enemies for allowing the disabling of new enemies on an existing save + - Added minimum evolution of 20% before faction adaptation will happen with mod setting to configure Compatibility: - Added interface for adding and removing excluded surfaces Tweaks: - - Added minimum evolution of 20% before faction adaptation will happen - Increased the death thresholds to 17000 <50%, 34000 <70%, 60000 <90%, 100000 for adaptation - Changed spawner pollution check to use 75% of the chunk pollution diffuse value Bugfixes: diff --git a/control.lua b/control.lua index 25cf0c4..065b4fc 100644 --- a/control.lua +++ b/control.lua @@ -281,6 +281,8 @@ local function onModSettingsChange(event) universe["initialPeaceTime"] = settings.global["rampant--initialPeaceTime"].value * TICKS_A_MINUTE universe["printAwakenMessage"] = settings.global["rampant--printAwakenMessage"].value + universe["minimumAdaptationEvolution"] = settings.global["rampant--minimumAdaptationEvolution"].value + return true end diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index 3e4d383..6ec91a0 100644 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -189,7 +189,7 @@ local function processBase(universe, base, tick) if universe.NEW_ENEMIES then local deathThreshold = 0 local evolutionLevel = universe.evolutionLevel - if (evolutionLevel < 0.2) then + if (evolutionLevel < universe.minimumAdaptationEvolution) then base.deathEvents = 0 elseif (evolutionLevel < 0.5) then deathThreshold = 17000 diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 25a6e2c..c408338 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -78,6 +78,7 @@ spawner-proxy-3-rampant=Spawner Proxy [entity-description] [mod-setting-name] +rampant--minimumAdaptationEvolution=AI: Minimum Adaptation Evolution rampant--printBaseSettling=AI: Print when settlers start building rampant--printAwakenMessage=World: Print when initial peace ends rampant--initialPeaceTime=World: Starting peace duration @@ -203,6 +204,7 @@ rampant--enableFadeTime=Enable corpse fade time rampant--temperamentRateModifier=AI: Temperament Rate Modifier [mod-setting-description] +rampant--minimumAdaptationEvolution=The minimum evolution that must be reached before bases will be begin to mutate. Only has an effect when Rampant New Enemies are enabled. rampant--printBaseSettling=Print a message to the console when settlers begin building a nest rampant--printAwakenMessage=Print a message to the console when the initial peace time ends rampant--initialPeaceTime=The AI will remain in the peaceful state until the specified number of minutes have passed in game. This should give time for someone to get an initial base started. diff --git a/settings.lua b/settings.lua index 85280b3..2368f46 100644 --- a/settings.lua +++ b/settings.lua @@ -575,6 +575,18 @@ data:extend({ per_user = false }, + { + type = "double-setting", + name = "rampant--minimumAdaptationEvolution", + description = "rampant--minimumAdaptationEvolution", + setting_type = "runtime-global", + default_value = 0.2, + minimum_value = 0.0, + maximum_value = 1.0, + order = "m[total]-b[ai]1", + per_user = false + }, + { type = "bool-setting", name = "rampant--aiPointsPrintSpendingToChat",