[13.10] find_entities_filtered is sometimes very slow

Bugs that are actually features.
tux_mark_5
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Thu Jan 15, 2015 2:20 pm
Contact:

[13.10] find_entities_filtered is sometimes very slow

Post by tux_mark_5 »

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:

Code: Select all

local index = player.position
player.surface.find_entities_filtered{area={index,index}, name="player"}

Rseding91
Factorio Staff
Factorio Staff
Posts: 14142
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [13.10] find_entities_filtered is sometimes very slow

Post by Rseding91 »

Yeah that's going to scan the entire surface since the bounding box is zero.

The mod needs to be re-written and update for 0.13.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”