Rampant icon indicating copy to clipboard operation
Rampant copied to clipboard

fix redundant pollution-triggered activity

Open garrotte13 opened this issue 3 years ago • 5 comments

This change fixes old very annoying problem of abnormal biters activity when pollution cloud doesn't touch nests. Rampant should treat pollution value below min_diffuse_value as not-diffusable pollution, because it will never spread into nest chunk -> biters can sleep well.

P.S. Problem is caused by hidden factorio engine behavior of very slow pollution absorption when pollution units value in chunk is below min_diffuse_value and there are no active pollution eaters in chunk (trees, nests, filters). I described it in Rampant Industry mod portal thread. For Rampant this problem manifestates in more dramatic way, because pollution units value in adjacent chunk reduces to min_diffuse value very fast (diffusion and immediate absorption), but then non-zero minimal pollution stays in that adjacent chunk for dozens of minutes causing a lot of biters activities without real reason.

garrotte13 avatar Nov 24 '22 10:11 garrotte13

Best way is to replace 12.5 by some constant generated every game load / init: Safe_Adjacent_PU = game.MapSettings.pollution.min_to_diffuse - (game.MapSettings.pollution.diffusion_ratio * 3)

And the same replacement will be perfect in RampantIndustry filter logics.

https://lua-api.factorio.com/latest/Concepts.html#PollutionMapSettings

garrotte13 avatar Nov 24 '22 10:11 garrotte13

Hm, github automatically adds second commit to pull request. Second commit is to address issue https://mods.factorio.com/mod/Rampant/discussion/62cffec331bf5cf7d592b14c

garrotte13 avatar Nov 24 '22 11:11 garrotte13

both of these fixes should already be on the dev branch.

veden avatar Dec 01 '22 04:12 veden

if you separate out the sound change I would be happy to include it.

veden avatar Dec 01 '22 04:12 veden

I meant that the sound change be separate to allow for merging just the sound change. Otherwise the other two changes are already on the dev branch. https://github.com/veden/Rampant/blob/dev/prototypes/SwarmUtils.lua#L589

https://github.com/veden/Rampant/blob/dev/Upgrade.lua#L620 https://github.com/veden/Rampant/blob/dev/libs/ChunkPropertyUtils.lua#L629

veden avatar Dec 02 '22 00:12 veden

This code has been merged into the dev branch, thank you for the contribution.

veden avatar Jan 02 '23 23:01 veden