Page 1 of 1

[1.1.70] sometimes not finding ghosts -> find_entities_filtered{area=search_area.bounds, type="entity-ghost"}

Posted: Wed Oct 19, 2022 8:32 pm
by Tiavor
found bug on Factorio 1.1.69 (build 60061, win64, steam), also tested on Factorio 1.1.70 (build 60152, win64, steam)

Sometimes not all entities are found, the missing ones are always larger than 1x1.

complete command:
local entities = search_area.surface.find_entities_filtered{area=search_area.bounds, type="entity-ghost"}
search_area is defined by
search_area = {
bounds=bounds,
inner_bounds=inner_bounds,
force=force,
surface=cell.owner.surface
}
cell is part of a logistic-network:
logisticNetwork = ghostScanner.entity.surface.find_logistic_network_by_position(ghostScanner.entity.position, ghostScanner.entity.force )
for _,cell in pairs(logisticNetwork.cells) do

if the roboport is destroyed and a new one is placed, it often works, magically, all entities are found. but if you place a new roboport next to it, then replace the old one, nothing will change.

mod used:
https://mods.factorio.com/mod/GhostScanner -> in version 1.6.5 line 269 in control.lua
or the attached rework of it -> line 404 in control.lua

Savegame: tiny test save with two logistic network zones, on the northern one (current focus) there are 6 solar panel ghosts, which are detected and 3 assembly machine ghosts which aren't. these 3 ghosts can be replaced by any 3x3 ghost and still not be detected. on another save I could also place 2x2 on the spot to not be detected, but not here.

Re: [1.1.70] sometimes not finding ghosts -> find_entities_filtered{area=search_area.bounds, type="entity-ghost"}

Posted: Wed Oct 19, 2022 9:19 pm
by Rseding91
Thanks for the report however the search function is correct. The ghost scanner logic is filtering out the ghosts incorrectly.

It searches 2 areas: the top and the bottom. The top area overlaps the ghost bounding boxes but not the ghost center. So when the ghost scanner logic says "is_in_bbox" it says no, the center of the entity is not in the bounding box it is searching. But it marks it as found so future search areas will skip it if they do find it.

Re: [1.1.70] sometimes not finding ghosts -> find_entities_filtered{area=search_area.bounds, type="entity-ghost"}

Posted: Thu Oct 20, 2022 9:57 am
by Tiavor
that makes sense, thanks