From e4190b82fe1c7da0c8bd5a93c8464c4d6dc8e787 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Mon, 11 Feb 2019 17:17:19 -0800 Subject: [PATCH] see changelog --- Upgrade.lua | 1 + changelog.txt | 7 +++++-- libs/ChunkProcessor.lua | 6 +++++- libs/Constants.lua | 2 ++ libs/PheromoneUtils.lua | 10 ++++------ settings.lua | 2 +- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Upgrade.lua b/Upgrade.lua index b0b8e41..e936892 100755 --- a/Upgrade.lua +++ b/Upgrade.lua @@ -227,6 +227,7 @@ function upgrade.attempt(natives) end natives.nextChunkSort = 0 + natives.nextChunkSortTick = 0 game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.37") global.version = constants.VERSION_72 diff --git a/changelog.txt b/changelog.txt index 5ae9449..d4685df 100755 --- a/changelog.txt +++ b/changelog.txt @@ -2,21 +2,24 @@ Version: 0.16.37 Date: 2. 10. 2019 Improvements: - - During onslaught ai state player building destroyed credits x10 to the biters + - During onslaught ai state player building destroyed by biters credits x10 to the biters - Increased dispersion projection of pheromone by 20% allowing for further pathing - Reworked squad attack scoring to better account for death pheromone - Squads that kamikaze may now occasionally disregard death pheromone - Maintain sorted chunk array for processing in a radial pattern from origin Tweaks: + - Increased resource pheromone min from 9000 to 15000 + - Increased resource pheromone max from 10000 to 20000 - Increased retreat pheromone min from 1000 to 10000 - Increased retreat pheromone max from 17000 to 170000 - Increased player pheromone multipler from 500 to 2500 - Increased bad squad movement penalty from 4000 to 10000 - Increased death pheromone generator from 125 to 750 + - Increased victory pheromone by x3 - Decreased death pheromone generator persistance from 0.995 to 0.9 - Decreased death pheromone persistance from 0.99 to 0.975 - Removed arbitrary player gen multipler in retreat scoring function - - Increased default setting of player score attack contribution from 7 to 18 + - Increased default setting of player score attack contribution from 7 to 16 Bugfixes: - Fixed pheromone dispersion when non-cardinal directions receiving pheromone when it shouldn't - Fixed ai states of migrating and seige when expansion is disabled on the map instead onslaught state happens 10% more in place diff --git a/libs/ChunkProcessor.lua b/libs/ChunkProcessor.lua index c7598e7..49986fb 100755 --- a/libs/ChunkProcessor.lua +++ b/libs/ChunkProcessor.lua @@ -17,6 +17,8 @@ local SPAWNER_EGG_TIMEOUT = constants.SPAWNER_EGG_TIMEOUT local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK +local MAX_TICKS_BEFORE_SORT_CHUNKS = constants.MAX_TICKS_BEFORE_SORT_CHUNKS + -- imported functions local retreatUnits = squadDefense.retreatUnits @@ -86,8 +88,10 @@ function chunkProcessor.processPendingChunks(natives, map, surface, pendingStack end end - if (#processQueue > natives.nextChunkSort) then + if (#processQueue > natives.nextChunkSort) or + (((tick - natives.nextChunkSortTick) > MAX_TICKS_BEFORE_SORT_CHUNKS) and ((natives.nextChunkSort - 75) ~= #processQueue)) then natives.nextChunkSort = #processQueue + 75 + natives.nextChunkSortTick = tick tSort(processQueue, sorter) end end diff --git a/libs/Constants.lua b/libs/Constants.lua index 4cfe9d7..1222e7a 100755 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -76,6 +76,8 @@ constants.EVOLUTION_INCREMENTS = 0.05 -- ai +constants.MAX_TICKS_BEFORE_SORT_CHUNKS = 60 * 60 * 30 -- 1 tick = 1/60 sec * 60 = 1 second + constants.RESOURCE_MINIMUM_FORMATION_DELTA = 15 constants.AI_POINT_GENERATOR_AMOUNT = 6 diff --git a/libs/PheromoneUtils.lua b/libs/PheromoneUtils.lua index c0a5ff4..34da758 100755 --- a/libs/PheromoneUtils.lua +++ b/libs/PheromoneUtils.lua @@ -49,24 +49,22 @@ function pheromoneUtils.scents(map, chunk) chunk[MOVEMENT_PHEROMONE] = chunk[MOVEMENT_PHEROMONE] - (getDeathGenerator(map, chunk)) if (resourceGenerator > 0) and (enemyCount == 0) then - chunk[RESOURCE_PHEROMONE] = chunk[RESOURCE_PHEROMONE] + (linearInterpolation(resourceGenerator, 9000, 10000)) + chunk[RESOURCE_PHEROMONE] = chunk[RESOURCE_PHEROMONE] + (linearInterpolation(resourceGenerator, 15000, 20000)) end end function pheromoneUtils.victoryScent(map, chunk, entityType) local value = BUILDING_PHEROMONES[entityType] if value then - -- chunk[MOVEMENT_PHEROMONE] = chunk[MOVEMENT_PHEROMONE] + (value * 1000) - -- FIX ME - addDeathGenerator(map, chunk, -(value * 3)) - chunk[MOVEMENT_PHEROMONE] = chunk[MOVEMENT_PHEROMONE] + value + local scaledVal = (value * 3) + addDeathGenerator(map, chunk, -scaledVal) + chunk[MOVEMENT_PHEROMONE] = chunk[MOVEMENT_PHEROMONE] + scaledVal end end function pheromoneUtils.deathScent(map, chunk) chunk[MOVEMENT_PHEROMONE] = chunk[MOVEMENT_PHEROMONE] - (DEATH_PHEROMONE_GENERATOR_AMOUNT * 2) addDeathGenerator(map, chunk, DEATH_PHEROMONE_GENERATOR_AMOUNT) - -- chunk[MOVEMENT_PHEROMONE] = chunk[MOVEMENT_PHEROMONE] - DEATH_PHEROMONE_GENERATOR_AMOUNT end function pheromoneUtils.playerScent(playerChunk) diff --git a/settings.lua b/settings.lua index d985a32..2526f38 100755 --- a/settings.lua +++ b/settings.lua @@ -51,7 +51,7 @@ data:extend({ name = "rampant-attackPlayerThreshold", setting_type = "runtime-global", minimum_value = 0, - default_value = 18, + default_value = 16, order = "b[modifier]-c[threshold]", per_user = false },