The railway station's hitbox does not match the model

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
SANTIMEL
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Mon Oct 23, 2023 12:00 pm
Contact:

The railway station's hitbox does not match the model

Post by SANTIMEL »

The railway station occupies one square more than it should.

Sometimes it gets in the way of building.

Visually ↴
1.png
1.png (351.08 KiB) Viewed 246 times
eugenekay
Smart Inserter
Smart Inserter
Posts: 1051
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: The railway station's hitbox does not match the model

Post by eugenekay »

The Train Stop (like the Rail entity) occupies 2x2 tiles; not 2x1:

Code: Select all

    collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
    selection_box = {{-0.9, -0.9}, {0.9, 0.9}},
    damaged_trigger_effect = hit_effects.entity(),
    drawing_boxes =
    {
      north = {{-3,-2.5}, {0.8, 1.25}},
      east = {{-1.75, -4.25},{1.625, 0.5}},
      south = {{-0.8125, -3.625},{2.75, 0.4375}},
      west = {{-1.75, -1.6875},{2.0625, 2.75}}
    },
    tile_width = 2,
    tile_height = 2,
04-23-2026, 08-23-23.png
04-23-2026, 08-23-23.png (860.63 KiB) Viewed 221 times
The collision_box is only 1x1, so the character can get "close" to the middle of the entity. The selection_box (visible in Yellow in the screenshot) is 1.8 x 1.8, and the tile_width/height are both set to 2. The drawing_box offsets are slightly different because the visuals extend past the edge of the tile, consistent with the Factorio artstyle.

Good Luck!
Post Reply

Return to “Ideas and Suggestions”