This is seen in a save with Alien Loot Economy ("alien-module" mod). Before the update, it was only taking < 0.25 ms per tick. Now it is taking 25ms.
I am attaching two different saves. An older (8) that had a smaller active map, and now has 4ms / tick of time spent in alien-module mod, and the latest game (11), that now has 25ms / tick in alien-module mod.
The reason I am attributing this to filtered chunk-scanning, is this part of the "alien-module" mod:
Code: Select all
for index, surface_iterator in pairs(global.surface_iterators) do
for i=1, batch_size do
--***Want to get all the chunk logic in here so we can scan a surface more quickly per cycle.
local chunk = surface_iterator()
if chunk == nil then
-- Disable the printing if not in debug mode
if debug_mode then
game.print('Rescanning chunks on surface # ' .. tostring(index))
end
global.surface_iterators[index] = game.surfaces[index].get_chunks()
else
--game.print("x: " .. tostring(chunk.x).. "y: " .. tostring(chunk.y))
--include logic here to scan each surface @ chunk.
local surface = game.surfaces[index]
local chunk_position = { x = chunk.x * 32, y = chunk.y*32 }
update_modules_on_surface(surface,chunk_position)
--game.print(serpent.block(chunk_position))
local assemblers = surface.find_entities_filtered { type = "assembling-machine", position = chunk_position, radius = 16}
local miners = surface.find_entities_filtered { type = "mining-drill" , position = chunk_position, radius = 16}
local labs = surface.find_entities_filtered { type = "lab" , position = chunk_position, radius = 16}
local furnaces = surface.find_entities_filtered { type = "furnace" , position = chunk_position, radius = 16}
local rocketSilos = surface.find_entities_filtered { name = "rocket-silo" , position = chunk_position, radius = 16}
local chests = surface.find_entities_filtered { type = "container" , position = chunk_position, radius = 16}
local logisticChests = surface.find_entities_filtered { type = "logistic-container" , position = chunk_position, radius = 16}
local beacons = surface.find_entities_filtered { type = "beacon" , position = chunk_position, radius = 16}
if debug_mode then
rendering.draw_circle{color = {r = 1, g = 0, b = 0, a = 0.5}, radius = 16, target = chunk_position, filled = true, surface = game.surfaces[index], time_to_live = 30}
end
update_modules(assemblers, "machine")
update_modules(miners, "machine")
update_modules(labs, "machine")
update_modules(furnaces, "machine")
update_modules(rocketSilos, "machine")
update_modules(chests, "chest")
update_modules(logisticChests, "chest")
update_modules(beacons, "machine")
update_recipes(assemblers)
end
end
I am not the author of the mod, just peered into it.