From b87e4eece0c3e217105a788210fef48bdbb120ce Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 15:32:16 -0700 Subject: [PATCH 01/12] Added nocturnal mode --- control.lua | 13 +++++++++---- info.json | 2 +- libs/AIAttack.lua | 4 ++-- libs/AIBuilding.lua | 7 ++++++- libs/AIPlanning.lua | 11 ++++++++++- libs/Constants.lua | 2 ++ libs/MapProcessor.lua | 15 ++++++++++----- libs/NocturnalUtils.lua | 21 +++++++++++++++++++++ libs/UnitGroupUtils.lua | 1 + locale/en/locale.cfg | 3 ++- settings.lua | 11 ++++++++++- 11 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 libs/NocturnalUtils.lua diff --git a/control.lua b/control.lua index 223c819..566f607 100644 --- a/control.lua +++ b/control.lua @@ -107,6 +107,7 @@ local function onModSettingsChange(event) natives.attackThresholdRange = natives.attackThresholdMax - natives.attackThresholdMin natives.attackWaveMaxSize = settings.global["rampant-attackWaveMaxSize"].value natives.attackPlayerThreshold = settings.global["rampant-attackPlayerThreshold"].value + natives.aiNocturnalMode = settings.global["rampant-permanentNocturnal"].value end local function onConfigChanged() @@ -198,7 +199,12 @@ local function onConfigChanged() natives.safeEntities = {} natives.safeEntityName = {} - + + game.surfaces[1].print("Rampant - Version 0.15.5") + global.version = constants.VERSION_18 + end + if (global.version < constants.VERSION_19) then + onModSettingsChange(nil) -- clear old regionMap processing Queue @@ -218,8 +224,8 @@ local function onConfigChanged() y = chunk.y * 32 }}}) end - game.surfaces[1].print("Rampant - Version 0.15.5") - global.version = constants.VERSION_18 + game.surfaces[1].print("Rampant - Version 0.15.6") + global.version = constants.VERSION_19 end end @@ -355,7 +361,6 @@ local function onInit() onConfigChanged() end - -- hooks script.on_init(onInit) diff --git a/info.json b/info.json index 990c53c..523064c 100644 --- a/info.json +++ b/info.json @@ -1,7 +1,7 @@ { "name" : "Rampant", "factorio_version" : "0.15", - "version" : "0.15.5", + "version" : "0.15.6", "title" : "Rampant AI", "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", diff --git a/libs/AIAttack.lua b/libs/AIAttack.lua index d413a02..a52e456 100644 --- a/libs/AIAttack.lua +++ b/libs/AIAttack.lua @@ -9,7 +9,7 @@ local playerUtils = require("PlayerUtils") local neighborUtils = require("NeighborUtils") -- constants - + local PLAYER_PHEROMONE = constants.PLAYER_PHEROMONE local MOVEMENT_PHEROMONE = constants.MOVEMENT_PHEROMONE local BASE_PHEROMONE = constants.BASE_PHEROMONE @@ -126,7 +126,7 @@ function aiAttack.squadBeginAttack(natives, players, evolution_factor) squad.frenzyPosition.x = squad.group.position.x squad.frenzyPosition.y = squad.group.position.y end - + if (math.random() < 0.70) then if (math.random() < kamikazeThreshold) then squad.kamikaze = true diff --git a/libs/AIBuilding.lua b/libs/AIBuilding.lua index 8e2d585..fa19052 100644 --- a/libs/AIBuilding.lua +++ b/libs/AIBuilding.lua @@ -6,6 +6,7 @@ local constants = require("Constants") local mapUtils = require("MapUtils") local unitGroupUtils = require("UnitGroupUtils") local neighborUtils = require("NeighborUtils") +local nocturnalUtils = require("NocturnalUtils") package.path = "../?.lua;" .. package.path local config = require("config") @@ -22,6 +23,8 @@ local AI_MAX_SQUAD_COUNT = constants.AI_MAX_SQUAD_COUNT local AI_SQUAD_COST = constants.AI_SQUAD_COST local AI_VENGENCE_SQUAD_COST = constants.AI_VENGENCE_SQUAD_COST +local AI_STATE_NOCTURNAL = constants.AI_STATE_NOCTURNAL + local HALF_CHUNK_SIZE = constants.HALF_CHUNK_SIZE local CHUNK_SIZE = constants.CHUNK_SIZE local NORTH_SOUTH_PASSABLE = constants.NORTH_SOUTH_PASSABLE @@ -37,6 +40,8 @@ local scoreNeighbors = neighborUtils.scoreNeighbors local createSquad = unitGroupUtils.createSquad local attackWaveScaling = config.attackWaveScaling +local canAttackNocturnal = nocturnalUtils.canAttack + local mMax = math.max -- module code @@ -92,7 +97,7 @@ end -- local enemy = surface.find_nearest_enemy({ position = { x = chunk.pX + HALF_CHUNK_SIZE, -- y = chunk.pY + HALF_CHUNK_SIZE }, -- max_distance = 100}) - + -- if (enemy ~= nil) and enemy.valid and (enemy.type == "unit") then -- natives.points = natives.points - AI_SCOUT_COST -- global.natives.scouts[#global.natives.scouts+1] = enemy diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index 3db816d..6e1eeaa 100644 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -4,11 +4,13 @@ local aiPlanning = {} local constants = require("Constants") local mathUtils = require("MathUtils") +local nocturnalUtils = require("NocturnalUtils") -- constants local AI_STATE_PEACEFUL = constants.AI_STATE_PEACEFUL local AI_STATE_AGGRESSIVE = constants.AI_STATE_AGGRESSIVE +local AI_STATE_NOCTURNAL = constants.AI_STATE_NOCTURNAL local AI_MAX_POINTS = constants.AI_MAX_POINTS local AI_POINT_GENERATOR_AMOUNT = constants.AI_POINT_GENERATOR_AMOUNT @@ -22,6 +24,8 @@ local TICKS_A_MINUTE = constants.TICKS_A_MINUTE -- imported functions +local canAttackNocturnal = nocturnalUtils.canAttack + local randomTickEvent = mathUtils.randomTickEvent local mMax = math.max @@ -30,6 +34,9 @@ local mMax = math.max function aiPlanning.planning(natives, evolution_factor, tick, surface) local maxPoints = AI_MAX_POINTS * evolution_factor + if natives.aiNocturnalMode then + maxPoints = maxPoints * 0.85 + end if (natives.points < maxPoints) then natives.points = natives.points + math.floor((AI_POINT_GENERATOR_AMOUNT * math.random()) + ((AI_POINT_GENERATOR_AMOUNT * 0.7) * (evolution_factor ^ 2.5))) end @@ -43,13 +50,15 @@ function aiPlanning.planning(natives, evolution_factor, tick, surface) local roll = math.random() * mMax(1 - evolution_factor, 0.15) if (roll > natives.temperament) then natives.state = AI_STATE_PEACEFUL + elseif (natives.aiNocturnalMode) then + natives.state = AI_STATE_NOCTURNAL else natives.state = AI_STATE_AGGRESSIVE end natives.stateTick = randomTickEvent(tick, AI_MIN_STATE_DURATION, AI_MAX_STATE_DURATION) end - if (natives.state == AI_STATE_AGGRESSIVE) and (tick - natives.lastShakeMessage > TICKS_A_MINUTE * 5) and (natives.points > AI_MAX_POINTS) then + if ((natives.state == AI_STATE_AGGRESSIVE) or canAttackNocturnal(natives, surface)) and (tick - natives.lastShakeMessage > TICKS_A_MINUTE * 5) and (natives.points > AI_MAX_POINTS) then natives.lastShakeMessage = tick surface.print("Rampant: The ground begins to shake") end diff --git a/libs/Constants.lua b/libs/Constants.lua index 4f3f395..01cbad2 100644 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -13,6 +13,7 @@ constants.VERSION_15 = 15 constants.VERSION_16 = 16 constants.VERSION_17 = 17 constants.VERSION_18 = 18 +constants.VERSION_19 = 19 -- misc @@ -47,6 +48,7 @@ constants.AI_MAX_BITER_GROUP_SIZE = 450 constants.AI_STATE_PEACEFUL = 1 constants.AI_STATE_AGGRESSIVE = 2 +constants.AI_STATE_NOCTURNAL = 3 constants.AI_MIN_STATE_DURATION = 1 constants.AI_MAX_STATE_DURATION = 4 diff --git a/libs/MapProcessor.lua b/libs/MapProcessor.lua index a2132e9..b08f8a1 100644 --- a/libs/MapProcessor.lua +++ b/libs/MapProcessor.lua @@ -6,6 +6,7 @@ local pheromoneUtils = require("PheromoneUtils") local aiBuilding = require("AIBuilding") local constants = require("Constants") local mapUtils = require("MapUtils") +local nocturnalUtils = require("NocturnalUtils") -- constants @@ -20,6 +21,7 @@ local AI_UNIT_REFUND = constants.AI_UNIT_REFUND local CHUNK_SIZE = constants.CHUNK_SIZE local ENEMY_BASE_GENERATOR = constants.ENEMY_BASE_GENERATOR local AI_STATE_AGGRESSIVE = constants.AI_STATE_AGGRESSIVE +local AI_STATE_NOCTURNAL = constants.AI_STATE_NOCTURNAL local PROCESS_PLAYER_BOUND = constants.PROCESS_PLAYER_BOUND local CHUNK_TICK = constants.CHUNK_TICK @@ -44,6 +46,8 @@ local getChunkByPosition = mapUtils.getChunkByPosition local playerScent = pheromoneUtils.playerScent +local canAttackNocturnal = nocturnalUtils.canAttack + local mMin = math.min -- module code @@ -78,8 +82,8 @@ function mapProcessor.processMap(regionMap, surface, natives, evolution_factor) roll = math.random() regionMap.processRoll = roll end - - if (natives.state == AI_STATE_AGGRESSIVE) and (0.11 <= roll) and (roll <= 0.35) then + + if ((natives.state == AI_STATE_AGGRESSIVE) or canAttackNocturnal(natives, surface)) and (0.11 <= roll) and (roll <= 0.35) then squads = true end @@ -119,7 +123,7 @@ function mapProcessor.processPlayers(players, regionMap, surface, natives, evolu local vengenceThreshold = -(evolution_factor * RETREAT_MOVEMENT_PHEROMONE_LEVEL) local roll = math.random() - if (natives.state == AI_STATE_AGGRESSIVE) and (0.11 <= roll) and (roll <= 0.20) then + if ((natives.state == AI_STATE_AGGRESSIVE) or canAttackNocturnal(natives, surface)) and (0.11 <= roll) and (roll <= 0.20) then squads = true end @@ -142,7 +146,8 @@ function mapProcessor.processPlayers(players, regionMap, surface, natives, evolu if (playerChunk ~= nil) then local vengence = false - if (playerChunk[ENEMY_BASE_GENERATOR] ~= 0) or (playerChunk[MOVEMENT_PHEROMONE] < vengenceThreshold) then + if ((playerChunk[ENEMY_BASE_GENERATOR] ~= 0) or (playerChunk[MOVEMENT_PHEROMONE] < vengenceThreshold)) and + (natives.state == AI_STATE_AGGRESSIVE or canAttackNocturnal(natives, surface)) then vengence = true end for x=playerChunk.cX - PROCESS_PLAYER_BOUND, playerChunk.cX + PROCESS_PLAYER_BOUND do @@ -204,7 +209,7 @@ function mapProcessor.scanMap(regionMap, surface, natives, evolution_factor) if (unitCount > 550) then local weight = AI_UNIT_REFUND * evolution_factor local units = surface.find_enemy_units({chunk.pX, chunk.pY}, - CHUNK_SIZE * 3) + CHUNK_SIZE * 3) for i=1,#units do units[i].destroy() diff --git a/libs/NocturnalUtils.lua b/libs/NocturnalUtils.lua new file mode 100644 index 0000000..27b0b13 --- /dev/null +++ b/libs/NocturnalUtils.lua @@ -0,0 +1,21 @@ +local nocturnalUtils = {} + +-- imports + +local constants = require("Constants") + +-- constants + +local AI_STATE_NOCTURNAL = constants.AI_STATE_NOCTURNAL + +-- module code + +function nocturnalUtils.isDark(surface) + return surface.darkness > 0.55 +end + +function nocturnalUtils.canAttack(natives, surface) + return nocturnalUtils.isDark(surface) and natives.state == AI_STATE_NOCTURNAL +end + +return nocturnalUtils diff --git a/libs/UnitGroupUtils.lua b/libs/UnitGroupUtils.lua index 24b9199..0c90bd1 100644 --- a/libs/UnitGroupUtils.lua +++ b/libs/UnitGroupUtils.lua @@ -4,6 +4,7 @@ local unitGroupUtils = {} local mapUtils = require("MapUtils") local constants = require("Constants") +local nocturnalUtils = require("NocturnalUtils") -- constants diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index babaf8e..455419b 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -1,5 +1,4 @@ - [entity-name] tunnel-entrance=Tunnel Entrance @@ -36,6 +35,7 @@ rampant-safeBuildings-railChainSignals=Make rail chain signals safe from biters rampant-safeBuildings-railSignals=Make rail signals safe from biters rampant-safeBuildings-trainStops=Make train stops safe from biters rampant-attackPlayerThreshold=Player score contribution threshold +rampant-permanentNocturnal=Permanent Noctural Mode [mod-setting-description] rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters @@ -53,3 +53,4 @@ rampant-safeBuildings-railChainSignals=Make rail chain signals safe from biters rampant-safeBuildings-railSignals=Make rail signals safe from biters rampant-safeBuildings-trainStops=Make train stops safe from biters rampant-attackPlayerThreshold=The score that a chunk must reach for it to contribute to the attack threshold. Increasing reduces player pheromone cloud impact. +rampant-permanentNocturnal=Toggling this will cause Rampant attack waves to spawn at night and retreat in the morning. DOES NOT turn off vanilla attack groups yet. Works better with Day/Night extender mod. diff --git a/settings.lua b/settings.lua index f90a776..7bdd566 100644 --- a/settings.lua +++ b/settings.lua @@ -140,6 +140,15 @@ data:extend({ default_value = false, order = "e[modifier]-g[safe]", per_user = false - } + }, + { + type = "bool-setting", + name = "rampant-permanentNocturnal", + description = "rampant-permanentNocturnal", + setting_type = "runtime-global", + default_value = false, + order = "f[modifier]-a[ai]", + per_user = false + } }) From f4281e5f30b3fcdaf1efeff40c17a2f97f190e41 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 16:23:09 -0700 Subject: [PATCH 02/12] added readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6321dec..263eecb 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ Configure Options not in game menu: # Version History +0.15.6 - +- Feature: Nocturnal Mode - causes Rampant attacks waves to only spawn at night. Best use with daylight Extender mod. + 0.15.5 - - Tweak: Increased ai refund from 2 to 3 - Fix: Signals, Chain Signals, and Train stops now correctly rebuild when the corresponding make safe is toggled From 9b1428d626383200bc5388476a42ec1802b2714f Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 16:28:28 -0700 Subject: [PATCH 03/12] increased dark threshold, updated readme --- README.md | 3 ++- libs/NocturnalUtils.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 263eecb..607dddd 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Configure Options not in game menu: # Features +- Nocturnal Mode - a mod option to force biters to only attack at night. - Recycling Biters - When large groups of biters form on the game map and aren't assigned to a unit group or near a base will be periodically removed and refunded to the ai causing attack waves proportional to the number of units removed. - Breaching - When biters are destroying structures nearby unit groups will come to join them - Frenzy squads - When a unit group gets close to a player or start combat they switch to attacking everything in there path for a set radius or until there is nothing left @@ -49,7 +50,7 @@ Configure Options not in game menu: # Version History 0.15.6 - -- Feature: Nocturnal Mode - causes Rampant attacks waves to only spawn at night. Best use with daylight Extender mod. +- Feature: Nocturnal Mode - causes Rampant attacks waves to only spawn at night. Best use with daylight Extender mod. 0.15.5 - - Tweak: Increased ai refund from 2 to 3 diff --git a/libs/NocturnalUtils.lua b/libs/NocturnalUtils.lua index 27b0b13..052ba10 100644 --- a/libs/NocturnalUtils.lua +++ b/libs/NocturnalUtils.lua @@ -11,7 +11,7 @@ local AI_STATE_NOCTURNAL = constants.AI_STATE_NOCTURNAL -- module code function nocturnalUtils.isDark(surface) - return surface.darkness > 0.55 + return surface.darkness > 0.65 end function nocturnalUtils.canAttack(natives, surface) From c912a2de181c04e454824f00850a0004ab34a7e3 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 19:14:12 -0700 Subject: [PATCH 04/12] updated readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 607dddd..c8391d2 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Configure Options not in game menu: # Features -- Nocturnal Mode - a mod option to force biters to only attack at night. +- Nocturnal Mode - A mod option to force biters to only attack at night. Does not yet affect vanilla attacks. - Recycling Biters - When large groups of biters form on the game map and aren't assigned to a unit group or near a base will be periodically removed and refunded to the ai causing attack waves proportional to the number of units removed. - Breaching - When biters are destroying structures nearby unit groups will come to join them - Frenzy squads - When a unit group gets close to a player or start combat they switch to attacking everything in there path for a set radius or until there is nothing left @@ -50,7 +50,7 @@ Configure Options not in game menu: # Version History 0.15.6 - -- Feature: Nocturnal Mode - causes Rampant attacks waves to only spawn at night. Best use with daylight Extender mod. +- Feature: Nocturnal Mode - Causes Rampant attacks waves to only spawn at night. Best use with daylight Extender mod. 0.15.5 - - Tweak: Increased ai refund from 2 to 3 From c88e6cc81fd4148fb487b21defee5eca3461d846 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 20:23:25 -0700 Subject: [PATCH 05/12] added difficulty setting, interop, and spelling correction --- README.md | 28 +++++++++++++++++----------- control.lua | 1 + info.json | 4 ++-- libs/AIPlanning.lua | 2 +- libs/Interop.lua | 16 ++++++++++++++++ locale/en/locale.cfg | 6 ++++-- settings.lua | 14 +++++++++++++- 7 files changed, 54 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c8391d2..161e6c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Rampant Tactics -Factorio Mod - Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles. +Factorio Mod - Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles. Difficulty setting in mod options menu. # Forum Post @@ -21,22 +21,23 @@ Configure Options not in game menu: # Features +- Difficulty Scaling - A mod option to control how quickly the ai can perform actions like making attack waves. - Nocturnal Mode - A mod option to force biters to only attack at night. Does not yet affect vanilla attacks. - Recycling Biters - When large groups of biters form on the game map and aren't assigned to a unit group or near a base will be periodically removed and refunded to the ai causing attack waves proportional to the number of units removed. - Breaching - When biters are destroying structures nearby unit groups will come to join them - Frenzy squads - When a unit group gets close to a player or start combat they switch to attacking everything in there path for a set radius or until there is nothing left - Rabid squads - Is in a permanent frenzied state as soon as the group is formed -- Tactical Retreats - these will take place when a unit group is in a chunk that has reached a death threshold -- Unit Group Merging - if multiple unit groups retreat at the same time there is a chance the groups will merge -- Unit Group Forming - any chunks with spawners in it that is covered by a pollution or player clouds will form groups based on the evolution factor +- Tactical Retreats - These will take place when a unit group is in a chunk that has reached a death threshold +- Unit Group Merging - If multiple unit groups retreat at the same time there is a chance the groups will merge +- Unit Group Forming - Any chunks with spawners in it that is covered by a pollution or player clouds will form groups based on the evolution factor - Probing Behavior Against Defenses - unit groups will attempt to avoid chunks that are soaked in death -- Player Hunting - unit groups will track the player based on there emitted pheromone cloud -- Rallying Death Cry - when a unit is killed on a chunk that is past the retreat threshold, the unit will attempt to summon reinforcements to help them -- Counterattacks - when the player is in combat near nests they will send reinforcements to unit groups -- Reinforcements - nests will send assistance to nearby nests under attack by the player -- No Homing Projectiles - all projectiles are fired at locations and no longer track the player -- Pathfinding - unit groups will use potential fields to perform only single step pathfinding allowing for efficient and dynamic pathing -- Peace mode - if something sets peace mode, Rampant will respect it +- Player Hunting - Unit groups will track the player based on there emitted pheromone cloud +- Rallying Death Cry - When a unit is killed on a chunk that is past the retreat threshold, the unit will attempt to summon reinforcements to help them +- Counterattacks - When the player is in combat near nests they will send reinforcements to unit groups +- Reinforcements - Nests will send assistance to nearby nests under attack by the player +- No Homing Projectiles - All projectiles are fired at locations and no longer track the player +- Pathfinding - Unit groups will use potential fields to perform only single step pathfinding allowing for efficient and dynamic pathing +- Peace mode - If something sets peace mode, Rampant will respect it # Planned Features @@ -49,6 +50,11 @@ Configure Options not in game menu: # Version History +0.15.7 - +- Feature: Difficulty Scaling - A mod options to control how quickly the ai performs actions +- Fixed: Spelling on mod option +- Improvement: Exposed nocturnal toggle and difficulty scaling to interop + 0.15.6 - - Feature: Nocturnal Mode - Causes Rampant attacks waves to only spawn at night. Best use with daylight Extender mod. diff --git a/control.lua b/control.lua index 566f607..3a02b4f 100644 --- a/control.lua +++ b/control.lua @@ -108,6 +108,7 @@ local function onModSettingsChange(event) natives.attackWaveMaxSize = settings.global["rampant-attackWaveMaxSize"].value natives.attackPlayerThreshold = settings.global["rampant-attackPlayerThreshold"].value natives.aiNocturnalMode = settings.global["rampant-permanentNocturnal"].value + natives.aiPointsScaler = settings.global["rampant-aiPointsScaler"].value end local function onConfigChanged() diff --git a/info.json b/info.json index 523064c..e216315 100644 --- a/info.json +++ b/info.json @@ -1,10 +1,10 @@ { "name" : "Rampant", "factorio_version" : "0.15", - "version" : "0.15.6", + "version" : "0.15.7", "title" : "Rampant AI", "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", - "description" : "Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles.", + "description" : "Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles. Difficulty setting in mod options menu.", "dependencies" : ["base >= 0.13.17", "? bobenemies", "? Natural_Evolution_Enemies"] } diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index 6e1eeaa..7624a04 100644 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -38,7 +38,7 @@ function aiPlanning.planning(natives, evolution_factor, tick, surface) maxPoints = maxPoints * 0.85 end if (natives.points < maxPoints) then - natives.points = natives.points + math.floor((AI_POINT_GENERATOR_AMOUNT * math.random()) + ((AI_POINT_GENERATOR_AMOUNT * 0.7) * (evolution_factor ^ 2.5))) + natives.points = natives.points + math.floor((AI_POINT_GENERATOR_AMOUNT * math.random()) + ((AI_POINT_GENERATOR_AMOUNT * 0.7) * (evolution_factor ^ 2.5)) * natives.aiPointsScaler) end if (natives.temperamentTick == tick) then diff --git a/libs/Interop.lua b/libs/Interop.lua index 6de4177..f8286c5 100644 --- a/libs/Interop.lua +++ b/libs/Interop.lua @@ -8,6 +8,22 @@ function interop.getAIPoints() return global.natives.points end +function interop.setNocturnalMode(flag) + global.natives.aiNocturnalMode = flag +end + +function interop.getNocturnalMode() + return global.natives.aiNocturnalMode +end + +function interop.setPointsPerCycleScaling(scale) + global.natives.aiPointsScaler = scale +end + +function interop.getPointsPerCycleScaling() + return global.natives.aiPointsScaler +end + function interop.changeState(aiState) global.natives.state = aiState end diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 455419b..42253e6 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -35,7 +35,8 @@ rampant-safeBuildings-railChainSignals=Make rail chain signals safe from biters rampant-safeBuildings-railSignals=Make rail signals safe from biters rampant-safeBuildings-trainStops=Make train stops safe from biters rampant-attackPlayerThreshold=Player score contribution threshold -rampant-permanentNocturnal=Permanent Noctural Mode +rampant-permanentNocturnal=Permanent Nocturnal Mode +rampant-aiPointsScaler=Difficulty Scaling [mod-setting-description] rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters @@ -53,4 +54,5 @@ rampant-safeBuildings-railChainSignals=Make rail chain signals safe from biters rampant-safeBuildings-railSignals=Make rail signals safe from biters rampant-safeBuildings-trainStops=Make train stops safe from biters rampant-attackPlayerThreshold=The score that a chunk must reach for it to contribute to the attack threshold. Increasing reduces player pheromone cloud impact. -rampant-permanentNocturnal=Toggling this will cause Rampant attack waves to spawn at night and retreat in the morning. DOES NOT turn off vanilla attack groups yet. Works better with Day/Night extender mod. +rampant-permanentNocturnal=Toggling this will cause Rampant attack waves to spawn at night. DOES NOT turn off vanilla attack groups yet. Works better with Day/Night extender mod. +rampant-aiPointsScaler=This scales how many action points the ai gets per logic cycle to perform actions like making attack waves. Between 0.0 and 5.0. Setting to 0.5 would cause the ai to work at half speed. diff --git a/settings.lua b/settings.lua index 7bdd566..cf537c1 100644 --- a/settings.lua +++ b/settings.lua @@ -43,7 +43,7 @@ data:extend({ setting_type = "runtime-global", minimum_value = 0, default_value = 7, - order = "c[modifier]-b[threshold]", + order = "c[modifier]-c[threshold]", per_user = false }, @@ -150,5 +150,17 @@ data:extend({ default_value = false, order = "f[modifier]-a[ai]", per_user = false + }, + + { + type = "double-setting", + name = "rampant-aiPointsScaler", + description = "rampant-aiPointsScaler", + setting_type = "runtime-global", + default_value = 1.0, + minimum_value = 0.0, + maximum_value = 5.0, + order = "f[modifier]-b[ai]", + per_user = false } }) From b83a07d444d6f5575c1239b23bb9d0fd3c9620f1 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 21:26:46 -0700 Subject: [PATCH 06/12] updated locale --- locale/en/locale.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 42253e6..abec907 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -55,4 +55,4 @@ rampant-safeBuildings-railSignals=Make rail signals safe from biters rampant-safeBuildings-trainStops=Make train stops safe from biters rampant-attackPlayerThreshold=The score that a chunk must reach for it to contribute to the attack threshold. Increasing reduces player pheromone cloud impact. rampant-permanentNocturnal=Toggling this will cause Rampant attack waves to spawn at night. DOES NOT turn off vanilla attack groups yet. Works better with Day/Night extender mod. -rampant-aiPointsScaler=This scales how many action points the ai gets per logic cycle to perform actions like making attack waves. Between 0.0 and 5.0. Setting to 0.5 would cause the ai to work at half speed. +rampant-aiPointsScaler=Between 0.0 and 5.0. This scales how many action points the ai gets per logic cycle to perform actions like making attack waves. 0.3 - very easy, 0.75 - easy, 1.0 - medium, 1.25 - hard From 833e45753d4ae2c881ec7db1c1c44d39782c8bcd Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 21:40:03 -0700 Subject: [PATCH 07/12] updating descriptions --- README.md | 6 +++--- locale/en/locale.cfg | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 161e6c6..fab8f3e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Configure Options not in game menu: # Features - Difficulty Scaling - A mod option to control how quickly the ai can perform actions like making attack waves. -- Nocturnal Mode - A mod option to force biters to only attack at night. Does not yet affect vanilla attacks. +- Nocturnal Mode - A mod option to force biters to only attack at night. Does not yet affect vanilla attacks. Best use with daynight extender mod - Recycling Biters - When large groups of biters form on the game map and aren't assigned to a unit group or near a base will be periodically removed and refunded to the ai causing attack waves proportional to the number of units removed. - Breaching - When biters are destroying structures nearby unit groups will come to join them - Frenzy squads - When a unit group gets close to a player or start combat they switch to attacking everything in there path for a set radius or until there is nothing left @@ -53,10 +53,10 @@ Configure Options not in game menu: 0.15.7 - - Feature: Difficulty Scaling - A mod options to control how quickly the ai performs actions - Fixed: Spelling on mod option -- Improvement: Exposed nocturnal toggle and difficulty scaling to interop +- Improvement: Exposed nocturnal toggle and difficulty scaling to remote interop 0.15.6 - -- Feature: Nocturnal Mode - Causes Rampant attacks waves to only spawn at night. Best use with daylight Extender mod. +- Feature: Nocturnal Mode - Causes Rampant attacks waves to only spawn at night. Best use with daynight Extender mod. 0.15.5 - - Tweak: Increased ai refund from 2 to 3 diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index abec907..2ecca76 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -55,4 +55,4 @@ rampant-safeBuildings-railSignals=Make rail signals safe from biters rampant-safeBuildings-trainStops=Make train stops safe from biters rampant-attackPlayerThreshold=The score that a chunk must reach for it to contribute to the attack threshold. Increasing reduces player pheromone cloud impact. rampant-permanentNocturnal=Toggling this will cause Rampant attack waves to spawn at night. DOES NOT turn off vanilla attack groups yet. Works better with Day/Night extender mod. -rampant-aiPointsScaler=Between 0.0 and 5.0. This scales how many action points the ai gets per logic cycle to perform actions like making attack waves. 0.3 - very easy, 0.75 - easy, 1.0 - medium, 1.25 - hard +rampant-aiPointsScaler=Between 0.0 and 5.0. This scales how many action points the ai gets per logic cycle to perform actions like making attack waves. 0.3 - very easy, 0.75 - easy, 1.0 - medium, 1.25+ - hard From a9d170a50801163016395fd3aa750bb11c40f3f5 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 21:46:22 -0700 Subject: [PATCH 08/12] added info dependency --- info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.json b/info.json index e216315..4fc1d72 100644 --- a/info.json +++ b/info.json @@ -6,5 +6,5 @@ "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", "description" : "Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles. Difficulty setting in mod options menu.", - "dependencies" : ["base >= 0.13.17", "? bobenemies", "? Natural_Evolution_Enemies"] + "dependencies" : ["base >= 0.13.17", "? bobenemies", "? Natural_Evolution_Enemies", "? DayNightExtender"] } From 6d34fa0b10cc31e5d6266602efc09f7c287fa52c Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 13 May 2017 21:57:38 -0700 Subject: [PATCH 09/12] spacing changed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fab8f3e..6ae5cb8 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Configure Options not in game menu: - Improvement: Exposed nocturnal toggle and difficulty scaling to remote interop 0.15.6 - -- Feature: Nocturnal Mode - Causes Rampant attacks waves to only spawn at night. Best use with daynight Extender mod. +- Feature: Nocturnal Mode - Causes Rampant attacks waves to only spawn at night. Best use with daynight extender mod. 0.15.5 - - Tweak: Increased ai refund from 2 to 3 From eea06a6c74f4590828bc1875c6300b445494ce96 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sun, 14 May 2017 17:09:43 -0700 Subject: [PATCH 10/12] fixing ai points nil error, changed upgrade process --- Upgrade.lua | 125 ++++++++++++++++++++++++++++++++++++++++++++ control.lua | 104 ++---------------------------------- info.json | 2 +- libs/AIPlanning.lua | 4 ++ libs/Constants.lua | 1 + make.rkt | 6 ++- 6 files changed, 140 insertions(+), 102 deletions(-) create mode 100644 Upgrade.lua diff --git a/Upgrade.lua b/Upgrade.lua new file mode 100644 index 0000000..1fe21c2 --- /dev/null +++ b/Upgrade.lua @@ -0,0 +1,125 @@ +local upgrade = {} + +-- imports + +local constants = require("libs/Constants") +local mathUtils = require("libs/MathUtils") + +-- constants + +local INTERVAL_LOGIC = constants.INTERVAL_LOGIC +local INTERVAL_PROCESS = constants.INTERVAL_PROCESS + +local MAX_RALLY_CRIES = constants.MAX_RALLY_CRIES + +-- imported functions + +local roundToNearest = mathUtils.roundToNearest + +-- module code + +function upgrade.attempt(natives, regionMap) + local starting = global.version + if (global.version == nil) then + + -- removed in version 9 + -- regionMap.pQ = {{}} -- processing queue + -- regionMap.pI = 1 -- insertion location for chunk processing + -- regionMap.pP = 1 -- index for the chunk set to process + -- regionMap.pR = -1 -- current processing roll + natives.squads = {} + natives.scouts = {} + natives.tunnels = {} + natives.points = 0 + + global.version = constants.VERSION_5 + end + if (global.version < constants.VERSION_9) then + + -- remove version 5 references + regionMap.pQ = nil + regionMap.pI = nil + regionMap.pP = nil + regionMap.pR = nil + + global.version = constants.VERSION_9 + end + if (global.version < constants.VERSION_10) then + for _,squad in pairs(natives.squads) do + squad.frenzy = false + squad.frenzyPosition = {x=0,y=0} + squad.rabid = false + end + + global.version = constants.VERSION_10 + end + if (global.version < constants.VERSION_11) then + natives.state = constants.AI_STATE_AGGRESSIVE + natives.temperament = 0 + -- needs to be on inner logic tick loop interval + natives.stateTick = roundToNearest(game.tick + INTERVAL_LOGIC, INTERVAL_LOGIC) + natives.temperamentTick = roundToNearest(game.tick + INTERVAL_LOGIC, INTERVAL_LOGIC) + + global.version = constants.VERSION_11 + end + if (global.version < constants.VERSION_12) then + for _,squad in pairs(natives.squads) do + squad.status = constants.SQUAD_GUARDING + squad.kamikaze = false + end + + -- reset ai build points due to error in earning points + natives.points = 0 + + global.version = constants.VERSION_12 + end + if (global.version < constants.VERSION_13) then + -- switched over to tick event + regionMap.logicTick = roundToNearest(game.tick + INTERVAL_LOGIC, INTERVAL_LOGIC) + regionMap.processTick = roundToNearest(game.tick + INTERVAL_PROCESS, INTERVAL_PROCESS) + + -- used to rate limit the number of rally cries during a period of time + natives.rallyCries = MAX_RALLY_CRIES + + global.version = constants.VERSION_13 + end + if (global.version < constants.VERSION_14) then + game.map_settings.unit_group.member_disown_distance = 5 + game.map_settings.unit_group.max_member_speedup_when_behind = 1.1 + game.map_settings.unit_group.max_member_slowdown_when_ahead = 1.0 + game.map_settings.unit_group.max_group_slowdown_factor = 0.9 + + game.surfaces[1].print("Rampant - Version 0.14.11") + global.version = constants.VERSION_14 + end + if (global.version < constants.VERSION_16) then + + natives.lastShakeMessage = 0 + --remove version 14 retreat limit, it has been made redundant + natives.retreats = nil + + game.map_settings.unit_group.max_group_radius = 20 + + game.surfaces[1].print("Rampant - Version 0.14.13") + global.version = constants.VERSION_16 + end + if (global.version < constants.VERSION_18) then + + natives.safeEntities = {} + natives.safeEntityName = {} + + game.surfaces[1].print("Rampant - Version 0.15.5") + global.version = constants.VERSION_18 + end + if (global.version < constants.VERSION_20) then + + natives.aiPointsScaler = settings.global["rampant-aiPointsScaler"].value + natives.aiNocturnalMode = settings.global["rampant-permanentNocturnal"].value + + game.surfaces[1].print("Rampant - Version 0.15.8") + global.version = constants.VERSION_20 + end + return starting ~= global.version +end + +return upgrade diff --git a/control.lua b/control.lua index 3a02b4f..72cc514 100644 --- a/control.lua +++ b/control.lua @@ -1,5 +1,6 @@ -- imports +local upgrade = require("Upgrade") local entityUtils = require("libs/EntityUtils") local mapUtils = require("libs/MapUtils") local unitGroupUtils = require("libs/UnitGroupUtils") @@ -112,102 +113,10 @@ local function onModSettingsChange(event) end local function onConfigChanged() - if (global.version == nil) then - - -- removed in version 9 - -- regionMap.pQ = {{}} -- processing queue - -- regionMap.pI = 1 -- insertion location for chunk processing - -- regionMap.pP = 1 -- index for the chunk set to process - -- regionMap.pR = -1 -- current processing roll - natives.squads = {} - natives.scouts = {} - natives.tunnels = {} - natives.points = 0 - pendingChunks = {} - - global.version = constants.VERSION_5 - end - if (global.version < constants.VERSION_9) then - - -- remove version 5 references - regionMap.pQ = nil - regionMap.pI = nil - regionMap.pP = nil - regionMap.pR = nil - - global.version = constants.VERSION_9 - end - if (global.version < constants.VERSION_10) then - for _,squad in pairs(natives.squads) do - squad.frenzy = false - squad.frenzyPosition = {x=0,y=0} - squad.rabid = false - end - - global.version = constants.VERSION_10 - end - if (global.version < constants.VERSION_11) then - natives.state = constants.AI_STATE_AGGRESSIVE - natives.temperament = 0 - -- needs to be on inner logic tick loop interval - natives.stateTick = roundToNearest(game.tick + INTERVAL_LOGIC, INTERVAL_LOGIC) - natives.temperamentTick = roundToNearest(game.tick + INTERVAL_LOGIC, INTERVAL_LOGIC) - - global.version = constants.VERSION_11 - end - if (global.version < constants.VERSION_12) then - for _,squad in pairs(natives.squads) do - squad.status = constants.SQUAD_GUARDING - squad.kamikaze = false - end - - -- reset ai build points due to error in earning points - natives.points = 0 - - global.version = constants.VERSION_12 - end - if (global.version < constants.VERSION_13) then - -- switched over to tick event - regionMap.logicTick = roundToNearest(game.tick + INTERVAL_LOGIC, INTERVAL_LOGIC) - regionMap.processTick = roundToNearest(game.tick + INTERVAL_PROCESS, INTERVAL_PROCESS) - - -- used to rate limit the number of rally cries during a period of time - natives.rallyCries = MAX_RALLY_CRIES - - global.version = constants.VERSION_13 - end - if (global.version < constants.VERSION_14) then - game.map_settings.unit_group.member_disown_distance = 5 - game.map_settings.unit_group.max_member_speedup_when_behind = 1.1 - game.map_settings.unit_group.max_member_slowdown_when_ahead = 1.0 - game.map_settings.unit_group.max_group_slowdown_factor = 0.9 - - game.surfaces[1].print("Rampant - Version 0.14.11") - global.version = constants.VERSION_14 - end - if (global.version < constants.VERSION_16) then - - natives.lastShakeMessage = 0 - --remove version 14 retreat limit, it has been made redundant - natives.retreats = nil - - game.map_settings.unit_group.max_group_radius = 20 - - game.surfaces[1].print("Rampant - Version 0.14.13") - global.version = constants.VERSION_16 - end - if (global.version < constants.VERSION_18) then - - natives.safeEntities = {} - natives.safeEntityName = {} - - game.surfaces[1].print("Rampant - Version 0.15.5") - global.version = constants.VERSION_18 - end - if (global.version < constants.VERSION_19) then - + if upgrade.attempt(natives, regionMap) then onModSettingsChange(nil) - + + game.surfaces[1].print("Reindexing chunks, please wait") -- clear old regionMap processing Queue -- prevents queue adding duplicate chunks -- chunks are by key, so should overwrite old @@ -224,10 +133,7 @@ local function onConfigChanged() area = { left_top = { x = chunk.x * 32, y = chunk.y * 32 }}}) end - - game.surfaces[1].print("Rampant - Version 0.15.6") - global.version = constants.VERSION_19 - end + end end local function onTick(event) diff --git a/info.json b/info.json index 4fc1d72..cbb069d 100644 --- a/info.json +++ b/info.json @@ -1,7 +1,7 @@ { "name" : "Rampant", "factorio_version" : "0.15", - "version" : "0.15.7", + "version" : "0.15.8", "title" : "Rampant AI", "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index 7624a04..f06742b 100644 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -38,6 +38,10 @@ function aiPlanning.planning(natives, evolution_factor, tick, surface) maxPoints = maxPoints * 0.85 end if (natives.points < maxPoints) then + -- check for ai points scaler being nil + if not natives.aiPointsScaler then + natives.aiPointsScaler = settings.global["rampant-aiPointsScaler"].value + end natives.points = natives.points + math.floor((AI_POINT_GENERATOR_AMOUNT * math.random()) + ((AI_POINT_GENERATOR_AMOUNT * 0.7) * (evolution_factor ^ 2.5)) * natives.aiPointsScaler) end diff --git a/libs/Constants.lua b/libs/Constants.lua index 01cbad2..dbb58f1 100644 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -14,6 +14,7 @@ constants.VERSION_16 = 16 constants.VERSION_17 = 17 constants.VERSION_18 = 18 constants.VERSION_19 = 19 +constants.VERSION_20 = 20 -- misc diff --git a/make.rkt b/make.rkt index 6c7fae0..715b0c8 100644 --- a/make.rkt +++ b/make.rkt @@ -30,6 +30,7 @@ (string->path "data-updates.lua") (string->path "LICENSE.md") (string->path "tests.lua") + (string->path "Upgrade.lua") (string->path "settings.lua") (string->path "README.md") (string->path "NOTICE") @@ -66,6 +67,7 @@ (copyFile "data.lua" modFolder) (copyFile "data-updates.lua" modFolder) (copyFile "settings.lua" modFolder) + (copyFile "Upgrade.lua" modFolder) (copyFile "tests.lua" modFolder) (copyDirectory "libs" modFolder) (copyDirectory "locale" modFolder) @@ -73,7 +75,7 @@ (copyDirectory "prototypes" modFolder))) (define (run) - ;;(copyFiles modFolder) - (makeZip modFolder) + (copyFiles modFolder) + ;;(makeZip modFolder) ) ) From b0771de631e572bb3454353ec6d08fac20064b38 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sun, 14 May 2017 17:15:31 -0700 Subject: [PATCH 11/12] updated readme --- README.md | 3 +++ make.rkt | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6ae5cb8..a97ede5 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,9 @@ Configure Options not in game menu: # Version History +0.15.8 - +- Fixed: aiPointsScaler being nil + 0.15.7 - - Feature: Difficulty Scaling - A mod options to control how quickly the ai performs actions - Fixed: Spelling on mod option diff --git a/make.rkt b/make.rkt index 715b0c8..e356174 100644 --- a/make.rkt +++ b/make.rkt @@ -75,7 +75,7 @@ (copyDirectory "prototypes" modFolder))) (define (run) - (copyFiles modFolder) - ;;(makeZip modFolder) + ;;(copyFiles modFolder) + (makeZip modFolder) ) ) From b6a381cadbbcd15ae68cb88065c3e0b59f02000d Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sun, 14 May 2017 18:50:56 -0700 Subject: [PATCH 12/12] getting ready for next version --- Upgrade.lua | 5 +++++ info.json | 2 +- libs/AIPlanning.lua | 10 ++++++---- libs/Constants.lua | 1 + make.rkt | 4 ++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Upgrade.lua b/Upgrade.lua index 1fe21c2..52edceb 100644 --- a/Upgrade.lua +++ b/Upgrade.lua @@ -119,6 +119,11 @@ function upgrade.attempt(natives, regionMap) game.surfaces[1].print("Rampant - Version 0.15.8") global.version = constants.VERSION_20 end + if (global.version < constants.VERSION_21) then + + game.surfaces[1].print("Rampant - Version 0.15.9") + global.version = constants.VERSION_21 + end return starting ~= global.version end diff --git a/info.json b/info.json index cbb069d..eb604b5 100644 --- a/info.json +++ b/info.json @@ -1,7 +1,7 @@ { "name" : "Rampant", "factorio_version" : "0.15", - "version" : "0.15.8", + "version" : "0.15.9", "title" : "Rampant AI", "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index f06742b..9996ead 100644 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -38,10 +38,12 @@ function aiPlanning.planning(natives, evolution_factor, tick, surface) maxPoints = maxPoints * 0.85 end if (natives.points < maxPoints) then - -- check for ai points scaler being nil - if not natives.aiPointsScaler then - natives.aiPointsScaler = settings.global["rampant-aiPointsScaler"].value - end + --[[ check for ai points scaler being nil, potential race condition with mod config being run + discovered 0.15.8 + --]] + -- if not natives.aiPointsScaler then + -- natives.aiPointsScaler = settings.global["rampant-aiPointsScaler"].value + -- end natives.points = natives.points + math.floor((AI_POINT_GENERATOR_AMOUNT * math.random()) + ((AI_POINT_GENERATOR_AMOUNT * 0.7) * (evolution_factor ^ 2.5)) * natives.aiPointsScaler) end diff --git a/libs/Constants.lua b/libs/Constants.lua index dbb58f1..4235d13 100644 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -15,6 +15,7 @@ constants.VERSION_17 = 17 constants.VERSION_18 = 18 constants.VERSION_19 = 19 constants.VERSION_20 = 20 +constants.VERSION_21 = 21 -- misc diff --git a/make.rkt b/make.rkt index e356174..715b0c8 100644 --- a/make.rkt +++ b/make.rkt @@ -75,7 +75,7 @@ (copyDirectory "prototypes" modFolder))) (define (run) - ;;(copyFiles modFolder) - (makeZip modFolder) + (copyFiles modFolder) + ;;(makeZip modFolder) ) )