[13.10] find_entities_filtered is sometimes very slow
Posted: Fri Jul 22, 2016 11:35 pm
When using find_entities_filtered to find a player under specific position in every 4th tick, factorio lags massively.
This worked fine (with no performance penalty) in 13.9. The code is used in Magnet mod to check if the player is active (whatever that means).
Basically, running this code every several ticks takes more than 40 ms per update:
This worked fine (with no performance penalty) in 13.9. The code is used in Magnet mod to check if the player is active (whatever that means).
Basically, running this code every several ticks takes more than 40 ms per update:
Code: Select all
local index = player.position
player.surface.find_entities_filtered{area={index,index}, name="player"}