OpenTTD / OpenTTD

OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe

Home Page:https://www.openttd.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Incorrect length of block section in a diagonal tracks

aleks0aleks opened this issue · comments

Version of OpenTTD

14.0, but seen before ~13.0

Expected result

I set traffic lights automatically every n cells. If the rail track is horizontal or vertical (relative to the boundaries of each cell), then the length is determined correctly. But if the path goes at an angle, then the automation must increase the number of cells by 2 in order to obtain the correct length of the block section on the diagonal path. However, the length calculation occurs with an error.

error

Actual result

On straight sections of the route, automatic signal placement works correctly. But in diagonal sections of the path, the length calculation is incorrect. Trains do not fit into the block section.

Steps to reproduce

  1. Enable automatic placement of traffic lights every n-cells.
  2. Make an automatic arrangement using Ctrl, starting from the first installed traffic light, but without dragging the mouse along the entire path. The path must have a rotation angle of 45 degrees relative to the boundaries of the cells. On such a diagonal path, the length of the section is calculated incorrectly. This problem did not exist before, but around 13.0 it appeared.

You might try changing the setting When dragging, keep fixed distance between signals to see if that fixes the problem for your usecase.

You might also find more information on this calculation (or just be confused by the arguments, as I was 🙂) in #10450.

I am closing this as a duplicate of #10450.