Page 1 of 1

[Rseding91] [1.1.110] "find_tiles_filtered" doesn't correctly take orientation using rotated areas in filtered searches

Posted: Fri Feb 09, 2024 11:32 am
by AckEmma
I've been developing a mod that places tiles under entities and knew I'd have some trouble with curved rails.
I've seen others make bitmasks for rails specifically but I wanted to be able to have it work for any entity (including ones with secondary bounding boxes with orientation).

I've found that `find_tiles_filtered` doesn't correctly take the orientation still even though `find_entities_filtered` does.

- Version and before image (version 1.1.101)
before-version.png
before-version.png (729.37 KiB) Viewed 884 times
- After `find_entities_filtered`

Code: Select all

/c for _,e in pairs(game.surfaces[1].find_entities_filtered{area={left_top={0.1,-9.9},right_bottom={9.9,19.9},orientation=0.1}}) do e.destroy() end
entities_filter.png
entities_filter.png (709.82 KiB) Viewed 884 times
-After `find_tiles_filtered`

Code: Select all

/c for _,e in pairs(game.surfaces[1].find_tiles_filtered{area={left_top={0.1,-9.9},right_bottom={9.9,19.9},orientation=0.1}}) do game.surfaces[1].create_entity{ name = "tile-ghost", position = e.position, inner_name = "concrete", force = game.player.force, expires = false } end
tiles_filter.png
tiles_filter.png (827.93 KiB) Viewed 884 times

I've gotten around this by programming my own version of `find_tiles_filtered` that makes special calls to the builtin after apply the orientation to the bounding box using a rotation matrix but anticipate that it would be much slower than any builtin method.

When BoundingBox Orientation support was added in 1.1.82 was it only for `find_entities_filtered` or meant to be for all functions that used BoundingBox in that way?
106122

Re: Using rotated areas in filtered searches

Posted: Wed Oct 30, 2024 9:50 am
by AckEmma
10-30-2024, 20-46-00.png
10-30-2024, 20-46-00.png (1.71 MiB) Viewed 570 times
This issue still exists in Factorio version 2.0.11.


Is it possible to move this thread to Bug Reports?

Re: Using rotated areas in filtered searches

Posted: Wed Oct 30, 2024 11:03 am
by ssilk
Moved to Bug reports due to user request.

Re: [Rseding91] [1.1.110] "find_tiles_filtered" doesn't correctly take orientation using rotated areas in filtered searc

Posted: Wed Nov 06, 2024 7:23 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.

Re: [Rseding91] [1.1.110] "find_tiles_filtered" doesn't correctly take orientation using rotated areas in filtered searc

Posted: Fri Nov 08, 2024 12:51 pm
by AckEmma
Sweet :)
Thanks, appreciate it and the entire wube team!