[boskid][1.1.61] Selection box doesn't handle 8 way rotations correctly when set in a custom entity prototype

Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

[boskid][1.1.61] Selection box doesn't handle 8 way rotations correctly when set in a custom entity prototype

Post by Muppet9010 »

When a prototype has a selection_box (possibly also collision_box ?) set to be non centered, this is placed based on the entities 4 main directions (N, E, S, W) cleanly, but for the extra rotations (NE, SE, SW, NW) in an 8 way rotatable entity the offsets are always as if the rotation is north.
Example selection box specification on a rail signal: `selection_box = {{0.5, -0.5}, {1.5, 0.5}} -- shifted +1 on the x from center`

In this example a modded rail signal has it's selection box moved offset from the centre of the entity. The aim was to get it towards the middle of the rails so that rails could be built directly next to each other with the signals embedded in the rails.
The rail signal graphics has a hard coded shift in their graphic a tile to the left, this is irrelevant from the bug. The collision boxes are default and show where the signals really are.

In the below picture the North, East, West and South orientations of the custom rail signal all have their selection boxes moved towards the centre of the rails due to their rotation as expected. These selection_box's are highlighted green in the picture.
The NorthEast, SouthEast, SouthWest and NorthWest orientations of the custom rail signal all have their selection boxes shifted east, this is the same as the North direction. These selection_box's are highlighted yellow. This is the issue that Factorio isn't rotating or offsetting these based on their direction. Obviously Factorio does this for vehicles with their orientations, but doesn't seem to for non orientation entities.
8 way rotated selection_box.PNG
8 way rotated selection_box.PNG (850.04 KiB) Viewed 1088 times

Mod:
Factorio-Embedded-Rail-Signals.zip
(7.43 KiB) Downloaded 64 times
Save:
8 way rotated selection box.zip
(1.53 MiB) Downloaded 63 times


User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.61] Selection box doesn't handle 8 way rotations correctly when set in a custom entity prototype

Post by boskid »

Thanks for the report. Issue is now fixed for 1.2.0. I do not want to back-port this fix to 1.1.x.

Post Reply

Return to “Fixed for 2.0”