From aa0bbf78393068bd50e70bec6cd1b06aeb00ec38 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Wed, 15 May 2019 22:11:43 -0700 Subject: [PATCH] see changelog --- Upgrade.lua | 6 ++-- changelog.txt | 22 +++++++++++++ control.lua | 31 +++++++++++++------ info.json | 2 +- libs/ChunkProcessor.lua | 26 +++++++++------- libs/ChunkPropertyUtils.lua | 18 +++-------- libs/ChunkUtils.lua | 28 +++++++++++------ libs/Constants.lua | 62 +++++++++++++++++++------------------ libs/MapProcessor.lua | 18 ++++++----- libs/SquadAttack.lua | 12 +++++++ locale/en/locale.cfg | 4 ++- settings.lua | 11 ++++++- tests.lua | 2 +- 13 files changed, 156 insertions(+), 86 deletions(-) diff --git a/Upgrade.lua b/Upgrade.lua index cc761f9..f37fb5c 100755 --- a/Upgrade.lua +++ b/Upgrade.lua @@ -308,10 +308,10 @@ function upgrade.attempt(natives) game.surfaces[natives.activeSurface].print("Rampant - Version 0.17.22") global.version = 89 end - if (global.version < 91) then + if (global.version < 92) then - game.surfaces[natives.activeSurface].print("Rampant - Version 0.17.25") - global.version = 91 + game.surfaces[natives.activeSurface].print("Rampant - Version 0.17.26") + global.version = 92 end return starting ~= global.version, natives diff --git a/changelog.txt b/changelog.txt index 44f81e3..bbb3ec5 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,25 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.17.26 +Date: 5. 14. 2019 + Contributions: + - Choumiko - Added event hooks for script_built and script_destroyed events + Optimizations: + - Disabled full map scan by default in favor of script_built and script_destroyed events. If a mod does not use these events and creates or destroys entities through scripts, you may need to re-enable this feature in the mod map settings under Compatibility: enable full map scan. + Improvements: + - Added a check for script created resources in the script_built and script_destroyed events + - When a squad is destroyed its last few chunk moves now receive a portion of the death generator pheromone from the chunk they died on + Tweaks: + - Removed unused mapping tables + - Chunk properties now use <= instead of == when checking for minimum allowed values + - Increased death pheromone generator amount to 1300 + - Increased retreat levels by 30% + - Increased raiding base activition threshold to 550 + - Decreased minimum cooldown time for attack waves in aggressive state to 30 seconds + - Reduced all player generator values by half + Bugfixes: + - Memory leak with settlers last tick map + - Multiple version of chunks where in the processing queue causing double processing issues with a duplicate context + --------------------------------------------------------------------------------------------------- Version: 0.17.25 Date: 5. 8. 2019 diff --git a/control.lua b/control.lua index 369d269..3ee5b46 100755 --- a/control.lua +++ b/control.lua @@ -115,6 +115,9 @@ local unregisterEnemyBaseStructure = chunkUtils.unregisterEnemyBaseStructure local registerEnemyBaseStructure = chunkUtils.registerEnemyBaseStructure local makeImmortalEntity = chunkUtils.makeImmortalEntity +local registerResource = chunkUtils.registerResource +local unregisterResource = chunkUtils.unregisterResource + local upgradeEntity = baseUtils.upgradeEntity local rebuildNativeTables = baseUtils.rebuildNativeTables @@ -203,7 +206,7 @@ local function rebuildMap() map.chunkToRetreats = {} map.chunkToRallys = {} - map.chunkToSpawner = {} + -- map.chunkToSpawner = {} map.chunkToSettler = {} map.chunkToPassable = {} @@ -538,12 +541,18 @@ end) local function onBuild(event) local entity = event.created_entity or event.entity if (entity.surface.index == natives.activeSurface) then - accountPlayerEntity(map, entity, natives, true, false) - if natives.safeBuildings then - if natives.safeEntities[entity.type] or natives.safeEntityName[entity.name] then - entity.destructible = false - end - end + if (entity.type == "resource") and (entity.force.name == "neutral") then + -- print("registering resource", entity.name) + registerResource(entity, map) + else + -- print("registering entity", entity.name) + accountPlayerEntity(map, entity, natives, true, false) + if natives.safeBuildings then + if natives.safeEntities[entity.type] or natives.safeEntityName[entity.name] then + entity.destructible = false + end + end + end end end @@ -551,7 +560,11 @@ local function onMine(event) local entity = event.entity local surface = entity.surface if (surface.index == natives.activeSurface) then - accountPlayerEntity(map, entity, natives, false, false) + if (entity.type == "resource") and (entity.force.name == "neutral") then + unregisterResource(entity, map) + else + accountPlayerEntity(map, entity, natives, false, false) + end end end @@ -779,7 +792,7 @@ end local function onResourceDepleted(event) local entity = event.entity if (entity.surface.index == natives.activeSurface) then - chunkUtils.unregisterResource(entity, map) + unregisterResource(entity, map) end end diff --git a/info.json b/info.json index 7c7760f..f41ebe5 100755 --- a/info.json +++ b/info.json @@ -1,7 +1,7 @@ { "name" : "Rampant", "factorio_version" : "0.17", - "version" : "0.17.25", + "version" : "0.17.26", "title" : "Rampant", "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", diff --git a/libs/ChunkProcessor.lua b/libs/ChunkProcessor.lua index ca6346b..ef918d9 100755 --- a/libs/ChunkProcessor.lua +++ b/libs/ChunkProcessor.lua @@ -20,6 +20,7 @@ local MAX_TICKS_BEFORE_SORT_CHUNKS = constants.MAX_TICKS_BEFORE_SORT_CHUNKS -- imported functions local createChunk = chunkUtils.createChunk +local mapScanChunk = chunkUtils.mapScanChunk local initialScan = chunkUtils.initialScan local chunkPassScan = chunkUtils.chunkPassScan @@ -63,25 +64,28 @@ function chunkProcessor.processPendingChunks(natives, map, surface, pendingStack local topLeft = event.area.left_top local x = topLeft.x local y = topLeft.y - local chunk = createChunk(x, y) topOffset[1] = x topOffset[2] = y bottomOffset[1] = x + CHUNK_SIZE bottomOffset[2] = y + CHUNK_SIZE - chunk = initialScan(chunk, natives, surface, map, tick, evolutionFactor, rebuilding) + if map[x] and map[x][y] then + mapScanChunk(map[x][y], surface, map) + else + if map[x] == nil then + map[x] = {} + end - if (chunk ~= SENTINEL_IMPASSABLE_CHUNK) then - local chunkX = chunk.x + local chunk = createChunk(x, y) + + chunk = initialScan(chunk, natives, surface, map, tick, evolutionFactor, rebuilding) - if map[chunkX] == nil then - map[chunkX] = {} - end - map[chunkX][chunk.y] = chunk - - processQueue[#processQueue+1] = chunk - end + if (chunk ~= SENTINEL_IMPASSABLE_CHUNK) then + map[x][y] = chunk + processQueue[#processQueue+1] = chunk + end + end end if (#processQueue > natives.nextChunkSort) or diff --git a/libs/ChunkPropertyUtils.lua b/libs/ChunkPropertyUtils.lua index f81ae2e..1f7e503 100755 --- a/libs/ChunkPropertyUtils.lua +++ b/libs/ChunkPropertyUtils.lua @@ -23,7 +23,7 @@ function chunkPropertyUtils.getWormCount(map, chunk) end function chunkPropertyUtils.setWormCount(map, chunk, count) - if (count == 0) then + if (count <= 0) then map.chunkToWorms[chunk] = nil else map.chunkToWorms[chunk] = count @@ -31,7 +31,7 @@ function chunkPropertyUtils.setWormCount(map, chunk, count) end function chunkPropertyUtils.setNestCount(map, chunk, count) - if (count == 0) then + if (count <= 0) then map.chunkToNests[chunk] = nil else map.chunkToNests[chunk] = count @@ -43,7 +43,7 @@ function chunkPropertyUtils.getChunkSettlerTick(map, chunk) end function chunkPropertyUtils.setChunkSettlerTick(map, chunk, tick) - if (tick == 0) then + if (tick <= 0) then map.chunkToSettler[chunk] = nil else map.chunkToSettler[chunk] = tick @@ -87,21 +87,13 @@ function chunkPropertyUtils.setRetreatTick(map, chunk, tick) end function chunkPropertyUtils.setResourceGenerator(map, chunk, resourceGenerator) - if (resourceGenerator == 0) then + if (resourceGenerator <= 0) then map.chunkToResource[chunk] = nil else map.chunkToResource[chunk] = resourceGenerator end end -function chunkPropertyUtils.setChunkSpawnerEggTick(map, chunk, tick) - map.chunkToSpawner[chunk] = tick -end - -function chunkPropertyUtils.getChunkSpawnerEggTick(map, chunk) - return map.chunkToSpawner[chunk] or 0 -end - function chunkPropertyUtils.getResourceGenerator(map, chunk) return map.chunkToResource[chunk] or 0 end @@ -223,7 +215,7 @@ function chunkPropertyUtils.getSquadsOnChunk(map, chunk) end function chunkPropertyUtils.setPlayerBaseGenerator(map, chunk, playerGenerator) - if (playerGenerator == 0) then + if (playerGenerator <= 0) then map.chunkToPlayerBase[chunk] = nil else map.chunkToPlayerBase[chunk] = playerGenerator diff --git a/libs/ChunkUtils.lua b/libs/ChunkUtils.lua index 105e3f3..96b4894 100755 --- a/libs/ChunkUtils.lua +++ b/libs/ChunkUtils.lua @@ -169,12 +169,12 @@ local function scanPaths(chunk, surface, map) end local function scorePlayerBuildings(surface, map) - return (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery50) * 50) + - (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery200) * 200) + - (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery1000) * 1000) + - (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery2000) * 2000) + - (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery3500) * 3500) + - (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery12000) * 12000) + return (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery50) * 25) + + (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery200) * 100) + + (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery1000) * 500) + + (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery2000) * 1000) + + (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery3500) * 1750) + + (surface.count_entities_filtered(map.filteredEntitiesPlayerQuery12000) * 6000) end function chunkUtils.initialScan(chunk, natives, surface, map, tick, evolutionFactor, rebuilding) @@ -399,11 +399,11 @@ function chunkUtils.unregisterEnemyBaseStructure(map, entity) end function chunkUtils.accountPlayerEntity(map, entity, natives, addObject, creditNatives) - + if (BUILDING_PHEROMONES[entity.type] ~= nil) and (entity.force.name ~= "enemy") then local entityValue = BUILDING_PHEROMONES[entity.type] - - local overlapArray = getEntityOverlapChunks(map, entity) + + local overlapArray = getEntityOverlapChunks(map, entity) if not addObject then if creditNatives then if (natives.state == AI_STATE_ONSLAUGHT) then @@ -439,6 +439,16 @@ function chunkUtils.unregisterResource(entity, map) end end +function chunkUtils.registerResource(entity, map) + local overlapArray = getEntityOverlapChunks(map, entity) + + for i=1,#overlapArray do + local chunk = overlapArray[i] + if (chunk ~= SENTINEL_IMPASSABLE_CHUNK) then + addResourceGenerator(map, chunk, RESOURCE_NORMALIZER) + end + end +end function chunkUtils.makeImmortalEntity(surface, entity) local repairPosition = entity.position diff --git a/libs/Constants.lua b/libs/Constants.lua index 0a74f0e..e49457f 100755 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -40,8 +40,8 @@ constants.VERSION_88 = 88 constants.MAGIC_MAXIMUM_NUMBER = 1e99 -- used in loops trying to find the lowest/highest score constants.MAGIC_MAXIMUM_BASE_NUMBER = 100000000 -constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL_MIN = 10000 -constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX = 170000 +constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL_MIN = 13000 +constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX = 221000 constants.PROCESS_QUEUE_SIZE = 85 constants.SCAN_QUEUE_SIZE = 10 @@ -90,6 +90,8 @@ constants.CHUNK_ALL_DIRECTIONS = 3 constants.BASE_SEARCH_RADIUS = 4 * constants.CHUNK_SIZE constants.EVOLUTION_INCREMENTS = 0.05 +constants.DIVISOR_DEATH_TRAIL_TABLE = { 0.75, 0.65, 0.55, 0.45, 0.35 } + -- ai constants.MAX_TICKS_BEFORE_SORT_CHUNKS = 60 * 60 * 30 -- 1 tick = 1/60 sec * 60 = 1 second @@ -107,7 +109,7 @@ constants.AI_TUNNEL_COST = 100 constants.AI_MAX_POINTS = 12500 constants.AI_MAX_OVERFLOW_POINTS = constants.AI_MAX_POINTS * 3 -constants.RAIDING_MINIMUM_BASE_THRESHOLD = 250 +constants.RAIDING_MINIMUM_BASE_THRESHOLD = 550 constants.AI_UNIT_REFUND = 3 @@ -132,7 +134,7 @@ constants.BASE_AI_STATE_OVERDRIVE = 4 constants.BASE_AI_STATE_MUTATE = 5 -constants.AGGRESSIVE_CAN_ATTACK_WAIT_MIN_DURATION = 1 +constants.AGGRESSIVE_CAN_ATTACK_WAIT_MIN_DURATION = 0.5 constants.AGGRESSIVE_CAN_ATTACK_WAIT_MAX_DURATION = 3 constants.AI_MIN_STATE_DURATION = 7 @@ -380,7 +382,7 @@ constants.NO_RETREAT_SQUAD_SIZE_BONUS_MAX = 0.40 -- pheromone amounts constants.MOVEMENT_PENALTY_AMOUNT = 300000 -constants.DEATH_PHEROMONE_GENERATOR_AMOUNT = 750 +constants.DEATH_PHEROMONE_GENERATOR_AMOUNT = 1300 constants.PLAYER_PHEROMONE_GENERATOR_AMOUNT = 300 constants.IMPASSABLE_TERRAIN_GENERATOR_AMOUNT = 0 @@ -436,31 +438,31 @@ constants.MAX_PENALTY_BEFORE_PURGE = 36000 -- player building pheromones constants.BUILDING_PHEROMONES = {} -constants.BUILDING_PHEROMONES["wall"] = 50 -constants.BUILDING_PHEROMONES["transport-belt"] = 50 -- 1 -constants.BUILDING_PHEROMONES["splitter"] = 200 -constants.BUILDING_PHEROMONES["pump"] = 200 -constants.BUILDING_PHEROMONES["offshore-pump"] = 200 -- 2 -constants.BUILDING_PHEROMONES["lamp"] = 1000 -constants.BUILDING_PHEROMONES["generator"] = 1000 -constants.BUILDING_PHEROMONES["solar-panel"] = 1000 -constants.BUILDING_PHEROMONES["programmable-speaker"] = 1000 -constants.BUILDING_PHEROMONES["accumulator"] = 1000 -constants.BUILDING_PHEROMONES["assembling-machine"] = 1000 -constants.BUILDING_PHEROMONES["turret"] = 1000 -constants.BUILDING_PHEROMONES["roboport"] = 1000 -constants.BUILDING_PHEROMONES["beacon"] = 1000 -constants.BUILDING_PHEROMONES["ammo-turret"] = 1000 -- 3 -constants.BUILDING_PHEROMONES["boiler"] = 2000 -constants.BUILDING_PHEROMONES["furnace"] = 2000 -constants.BUILDING_PHEROMONES["lab"] = 2000 -constants.BUILDING_PHEROMONES["reactor"] = 2000 -constants.BUILDING_PHEROMONES["radar"] = 2000 -constants.BUILDING_PHEROMONES["electric-turret"] = 2000 -- 4 -constants.BUILDING_PHEROMONES["fluid-turret"] = 3500 -constants.BUILDING_PHEROMONES["mining-drill"] = 3500 -- 5 -constants.BUILDING_PHEROMONES["artillery-turret"] = 12000 -constants.BUILDING_PHEROMONES["rocket-silo"] = 12000 -- 6 +constants.BUILDING_PHEROMONES["wall"] = 25 +constants.BUILDING_PHEROMONES["transport-belt"] = 25 -- 1 +constants.BUILDING_PHEROMONES["splitter"] = 100 +constants.BUILDING_PHEROMONES["pump"] = 100 +constants.BUILDING_PHEROMONES["offshore-pump"] = 100 -- 2 +constants.BUILDING_PHEROMONES["lamp"] = 500 +constants.BUILDING_PHEROMONES["generator"] = 500 +constants.BUILDING_PHEROMONES["solar-panel"] = 500 +constants.BUILDING_PHEROMONES["programmable-speaker"] = 500 +constants.BUILDING_PHEROMONES["accumulator"] = 500 +constants.BUILDING_PHEROMONES["assembling-machine"] = 500 +constants.BUILDING_PHEROMONES["turret"] = 500 +constants.BUILDING_PHEROMONES["roboport"] = 500 +constants.BUILDING_PHEROMONES["beacon"] = 500 +constants.BUILDING_PHEROMONES["ammo-turret"] = 500 -- 3 +constants.BUILDING_PHEROMONES["boiler"] = 500 +constants.BUILDING_PHEROMONES["furnace"] = 500 +constants.BUILDING_PHEROMONES["lab"] = 500 +constants.BUILDING_PHEROMONES["reactor"] = 500 +constants.BUILDING_PHEROMONES["radar"] = 500 +constants.BUILDING_PHEROMONES["electric-turret"] = 500 -- 4 +constants.BUILDING_PHEROMONES["fluid-turret"] = 1750 +constants.BUILDING_PHEROMONES["mining-drill"] = 1750 -- 5 +constants.BUILDING_PHEROMONES["artillery-turret"] = 6000 +constants.BUILDING_PHEROMONES["rocket-silo"] = 6000 -- 6 -- constants.RETREAT_FILTER = {} diff --git a/libs/MapProcessor.lua b/libs/MapProcessor.lua index f02f35c..57c9d49 100755 --- a/libs/MapProcessor.lua +++ b/libs/MapProcessor.lua @@ -285,13 +285,15 @@ function mapProcessor.scanMap(map, surface, natives, tick) local retreats = map.chunkToRetreats local rallys = map.chunkToRallys - local spawners = map.chunkToSpawner + -- local spawners = map.chunkToSpawner local settlers = map.chunkToSettler local drained = map.chunkToDrained local processQueue = map.processQueue local endIndex = mMin(index + SCAN_QUEUE_SIZE, #processQueue) + local isFullMapScan = settings.global["rampant-enableFullMapScan"].value + for x=index,endIndex do local chunk = processQueue[x] @@ -311,12 +313,12 @@ function mapProcessor.scanMap(map, surface, natives, tick) rallys[chunk] = nil end - local spawnerTick = spawners[chunk] - if spawnerTick and ((tick - spawnerTick) > INTERVAL_SPAWNER) then - spawners[chunk] = nil - end + -- local spawnerTick = spawners[chunk] + -- if spawnerTick and ((tick - spawnerTick) > INTERVAL_SPAWNER) then + -- spawners[chunk] = nil + -- end - local settlerTick = spawners[chunk] + local settlerTick = settlers[chunk] if settlerTick and ((tick - settlerTick) > 0) then settlers[chunk] = nil end @@ -336,7 +338,9 @@ function mapProcessor.scanMap(map, surface, natives, tick) end end - mapScanChunk(chunk, surface, map) + if isFullMapScan then + mapScanChunk(chunk, surface, map) + end local nests = getNestCount(map, chunk) if (nests > 0) then diff --git a/libs/SquadAttack.lua b/libs/SquadAttack.lua index b410593..c0621e2 100755 --- a/libs/SquadAttack.lua +++ b/libs/SquadAttack.lua @@ -21,6 +21,8 @@ local RESOURCE_PHEROMONE = constants.RESOURCE_PHEROMONE local ATTACK_SCORE_KAMIKAZE = constants.ATTACK_SCORE_KAMIKAZE +local DIVISOR_DEATH_TRAIL_TABLE = constants.DIVISOR_DEATH_TRAIL_TABLE + local BASE_CLEAN_DISTANCE = constants.BASE_CLEAN_DISTANCE local SQUAD_BUILDING = constants.SQUAD_BUILDING @@ -48,6 +50,7 @@ local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK -- imported functions local mRandom = math.random +local mMin = math.min local tRemove = table.remove local euclideanDistancePoints = mathUtils.euclideanDistancePoints @@ -55,6 +58,8 @@ local euclideanDistancePoints = mathUtils.euclideanDistancePoints local findMovementPosition = movementUtils.findMovementPosition local removeSquadFromChunk = chunkPropertyUtils.removeSquadFromChunk +local addDeathGenerator = chunkPropertyUtils.addDeathGenerator +local getDeathGenerator = chunkPropertyUtils.getDeathGenerator local getNestCount = chunkPropertyUtils.getNestCount @@ -295,6 +300,13 @@ function squadAttack.squadsDispatch(map, surface, natives) if (memberCount == 0) then tRemove(squads, i) removeSquadFromChunk(map, squad) + local deathGen = getDeathGenerator(map, squad.chunk) + local penalties = squad.penalties + for x=1,mMin(#squad.penalties,5) do + addDeathGenerator(map, + penalties[x].c, + deathGen * DIVISOR_DEATH_TRAIL_TABLE[x]) + end group.destroy() elseif (memberCount > AI_MAX_BITER_GROUP_SIZE) then local members = group.members diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index d55c271..e4668ff 100755 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -12502,6 +12502,7 @@ rampant-energyThiefEnemy=World: Energy Thief Biter Faction rampant-poisonEnemy=World: Poison Biter Faction rampant-disableCollidingProjectiles=Projectiles: Non biter force colliding projectiles +rampant-enableFullMapScan=Compatibility: Enable full map scanning [mod-setting-description] rampant-unitSpawnerBreath=Now unit spawners breath air so they are affected by things like poison capsules @@ -12589,4 +12590,5 @@ rampant-energyThiefEnemy=Energy Thief Biter Faction, Major resistance to Electri rampant-poisonEnemy=Poison Biter Faction, Only Biters. On death creates a cloud that heals biters and hurts player objects. Major resistance to Poison, Minor weakness to Electric, Minor weakness to Explosive, Minor weakness to Laser, Minor resistance to Fire. rampant-disableCollidingProjectiles=Biter projectiles no longer collide with other biters, worms or nests. Everything else still collides with biter projectiles. -rampant-liteMode=AI is still fully functional but the map scanning and processing is slowed, which will cause pheromones to remain longer, reduce the number of attacks spawned, and pheromones will spread slower. \ No newline at end of file +rampant-liteMode=AI is still fully functional but the map scanning and processing is slowed, which will cause pheromones to remain longer, reduce the number of attacks spawned, and pheromones will spread slower. +rampant-enableFullMapScan=This setting causes the game map to slowly be scanned for entities created or destroyed outside of the factorio event system. (If a mod isn't using script_raised_built or script_raised_destroyed this will cause Rampant to still eventually be consistent with the game map) \ No newline at end of file diff --git a/settings.lua b/settings.lua index cd3ea0b..51e20ba 100755 --- a/settings.lua +++ b/settings.lua @@ -17,7 +17,7 @@ data:extend({ default_value = true, order = "b[modifier]-b[trigger]", per_user = false - }, + }, { type = "bool-setting", @@ -539,6 +539,15 @@ data:extend({ per_user = false }, + { + type = "bool-setting", + name = "rampant-enableFullMapScan", + setting_type = "runtime-global", + default_value = false, + order = "n[modifier]-a[optimize]", + per_user = false + }, + { type = "bool-setting", name = "rampant-unkillableLogisticRobots", diff --git a/tests.lua b/tests.lua index b1c0c9d..481d8b5 100755 --- a/tests.lua +++ b/tests.lua @@ -30,7 +30,7 @@ function tests.pheromoneLevels(size) for i=1,#chunk do str = str .. " " .. tostring(i) .. "/" .. tostring(chunk[i]) end - str = str .. " " .. "p/" .. game.surfaces[global.natives.activeSurface].get_pollution(chunk) .. " " .. "n/" .. chunkPropertyUtils.getNestCount(global.map, chunk) .. " " .. "w/" .. chunkPropertyUtils.getWormCount(global.map, chunk) + str = str .. " " .. "p/" .. game.surfaces[global.natives.activeSurface].get_pollution(chunk) .. " " .. "n/" .. chunkPropertyUtils.getNestCount(global.map, chunk) .. " " .. "w/" .. chunkPropertyUtils.getWormCount(global.map, chunk) .. " pg/" .. chunkPropertyUtils.getPlayerBaseGenerator(global.map, chunk) if (chunk.x == playerChunkX) and (chunk.y == playerChunkY) then print("=============") print(chunk.x, chunk.y, str)