News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

[BUG] Plane runway selection off-by-one error.

Started by DrSuperGood, June 28, 2019, 07:13:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DrSuperGood

Aircraft have an off-by-one error when selecting which runway to take-off from.

The De Havilland Comet has a minimum runway length of 2012 meters. This translates into a runway requirement of at least 17 tiles. The airport the De Havilland Comet is trying to depart from has a selection of runway lengths available for use. For small and light aircraft there is the 2,000 meter (16 tile) runway. For medium sized aircraft there is the 3,000 meter (24 tile) runway. Finally for very large (at the current stage of the server) aircraft there is the 4,000 meter (32 tile) runway. Logically the De Havilland Comet should be landing and taking off from either the 3,000 meter or 4,000 meter runway as the 2,000 meter runway is 12 meters too short.

However the De Havilland Comet will actively route to and try to take-off from the 2,000 meter runway. This obviously fails when it gets to the runway as the runway is too short by 12 meters.

This points towards an off-by-one style rounding error when searching for runways to take-off from. The 2,012 meter requirement must be getting rounded down to 16 tile requirement instead of correctly up to 17 tiles causing it to route to the 16 tile runway instead of the 24 tile runway. When the plane gets to the runway it correctly tests if it is 17 tiles before starting a take-off and fails because the runway is only 16 tiles.

jamespetts

Thank you for the report: I believe that I have now fixed this. I should be grateful if you could re-test with the next nightly build.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.