1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

redistribute processing over more ticks

This commit is contained in:
Aaron Veden 2021-12-04 14:57:23 -08:00
parent edb589816a
commit a61194150c
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
4 changed files with 9 additions and 6 deletions

View File

@ -1053,7 +1053,7 @@ script.on_event(defines.events.on_tick,
function ()
local gameRef = game
local tick = gameRef.tick
local pick = tick % 7
local pick = tick % 8
-- local profiler = game.create_profiler()
@ -1069,8 +1069,6 @@ script.on_event(defines.events.on_tick,
if (pick == 0) then
processPendingChunks(map, tick)
processScanChunks(map)
universe.processedChunks = universe.processedChunks + PROCESS_QUEUE_SIZE
planning(map, gameRef.forces.enemy.evolution_factor, tick)
if universe.NEW_ENEMIES then
recycleBases(map)
@ -1086,13 +1084,17 @@ script.on_event(defines.events.on_tick,
processVengence(map)
elseif (pick == 4) then
scanResourceMap(map, tick)
elseif (pick == 5) then
scanEnemyMap(map, tick)
elseif (pick == 5) then
processSpawners(map)
scanEnemyMap(map, tick)
elseif (pick == 6) then
scanPlayerMap(map, tick)
processNests(map, tick)
temperamentPlanner(map)
elseif (pick == 7) then
processPendingChunks(map, tick)
processScanChunks(map)
end
processActiveNests(map, tick)

View File

@ -68,7 +68,7 @@ function chunkProcessor.processPendingChunks(map, tick, flush)
if not event then
event = next(pendingChunks, nil)
end
local endCount = 2
local endCount = 1
if flush then
endCount = table_size(pendingChunks)
event = next(pendingChunks, nil)

View File

@ -46,7 +46,7 @@ constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX = 130000
constants.PROCESS_QUEUE_SIZE = 105
constants.SCAN_QUEUE_SIZE = 2
constants.RESOURCE_QUEUE_SIZE = 2
constants.ENEMY_QUEUE_SIZE = 2
constants.ENEMY_QUEUE_SIZE = 1
constants.PLAYER_QUEUE_SIZE = 2
constants.CLEANUP_QUEUE_SIZE = 8
constants.ATTACK_QUEUE_SIZE = 18

View File

@ -138,6 +138,7 @@ function mapProcessor.processMap(map, tick)
else
map.processIndex = endIndex - 1
end
map.universe.processedChunks = map.universe.processedChunks + PROCESS_QUEUE_SIZE
end
function mapProcessor.processStaticMap(map)