mirror of
https://github.com/veden/Rampant.git
synced 2025-03-17 20:58:35 +02:00
checking speed vs memory cost
This commit is contained in:
parent
d8a36bc5f7
commit
0dd998daaf
@ -58,6 +58,7 @@ Configure Options not in game menu:
|
||||
# Version History
|
||||
|
||||
0.15.17 -
|
||||
- Tweak: Increased sampling threshold for water tiles from 5 to 10 tiles
|
||||
- Tweak: Increased small worm turret range from 17 to 18
|
||||
- Improvement: added ground effect to worm turret for attacking drones
|
||||
- Improvement: Added option to remove blood particles on biter deaths, which should help reduce lag spikes (default is to remove them)
|
||||
|
@ -108,14 +108,14 @@ function chunkUtils.checkChunkPassability(chunkTiles, chunk, surface)
|
||||
local get_tile = surface.get_tile
|
||||
|
||||
--[[
|
||||
0-4 represents water chunk
|
||||
5-46 chunk requires full scan
|
||||
0-10 represents water chunk
|
||||
11-46 chunk requires full scan
|
||||
47-49 assume chunk is passable in all directions
|
||||
--]]
|
||||
local cleanSpotCheck = spotCheck(x, y, get_tile)
|
||||
|
||||
local pass = CHUNK_ALL_DIRECTIONS
|
||||
if (cleanSpotCheck > 5) and (cleanSpotCheck < 47) then
|
||||
if (cleanSpotCheck > 10) and (cleanSpotCheck < 47) then
|
||||
pass = CHUNK_IMPASSABLE
|
||||
local rating, passableNorthSouth, passableEastWest = fullScan(chunkTiles, x, y, get_tile)
|
||||
|
||||
@ -131,7 +131,7 @@ function chunkUtils.checkChunkPassability(chunkTiles, chunk, surface)
|
||||
if (rating < 0.6) then
|
||||
pass = CHUNK_IMPASSABLE
|
||||
end
|
||||
elseif (cleanSpotCheck <= 4) then
|
||||
elseif (cleanSpotCheck <= 10) then
|
||||
pass = CHUNK_IMPASSABLE
|
||||
else
|
||||
chunk[PATH_RATING] = 1
|
||||
|
@ -52,6 +52,9 @@ end
|
||||
local function removeTendril(base, tendril)
|
||||
for i=1,#base.tendrils do
|
||||
if (base.tendrils[i] == tendril) then
|
||||
if tendril.unit.valid then
|
||||
tendril.unit.destroy()
|
||||
end
|
||||
table.remove(base.tendrils,i)
|
||||
break
|
||||
end
|
||||
@ -94,7 +97,7 @@ local function buildTendrilPath(regionMap, tendril, surface, base, tick, natives
|
||||
tendril.target = position
|
||||
tendrilUnit.set_command({ type = defines.command.go_to_location,
|
||||
destination = position,
|
||||
distraction = defines.distraction.by_damage })
|
||||
distraction = defines.distraction.by_none })
|
||||
|
||||
-- needs to check to make sure unit still exists as well.
|
||||
--tendril.cycles = 2
|
||||
@ -103,7 +106,7 @@ local function buildTendrilPath(regionMap, tendril, surface, base, tick, natives
|
||||
-- local biterSpawner = {name="spitter-spawner", position=position}
|
||||
-- local hive = surface.create_entity(biterSpawner)
|
||||
-- registerEnemyBaseStructure(regionMap, hive, base)
|
||||
-- elseif not position then
|
||||
-- elseif not position then
|
||||
-- removeTendril(base, tendril)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user