The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: Matthew on April 26, 2022, 04:24:18 AM

Title: Some elevated ways do not display correctly on rotation
Post by: Matthew on April 26, 2022, 04:24:18 AM
I built some 'diagonal' elevated ways using the new system and then rotated the map. The results were not good.

View after one rotation looks wrong to me, as though the walls of the way are floating in mid-air:

(https://i.imgur.com/onG2oG0.png)

View after two rotations looks right, as we would expect:

(https://i.imgur.com/rr93sVb.png)

View after three rotations look wrong again:

(https://i.imgur.com/TNqmLER.png)

This is the heavy steel elevated support, but I get similar results with concrete.

Elevated ways that are perpendicular to the tile grid (north-south or east-west) look good after rotation, except for the diagonal tile at junctions:

(https://i.imgur.com/if9VeqF.png)

Possibly relevant: the directional options for some of the manual tools do not line up in the way that I expect. It it easiest to show with the Junction for concrete viaduct or elevated tool:

(https://i.imgur.com/KzHfqkm.png)
(For the avoidance of doubt, this screenshot was taken at the default rotation).

I would expect this junction element to be East, not North, because it appears on the East side of the tile. Which makes me wonder whether many graphical elements have ended up in the wrong place (very easily done). But maybe there is some aspect of the geometry that I have misunderstood.

PJMack, I am sorry to raise an issue with a new feature that we all thought was ready for prime-time, but I only just stumbled upon this when trying to understand something else.
Title: Re: Some elevated ways do not display correctly on rotation
Post by: PJMack on April 27, 2022, 12:32:46 AM
Quote from: Matthew on April 26, 2022, 04:24:18 AMI built some 'diagonal' elevated ways using the new system and then rotated the map. The results were not good.
Made a PR to fix this.  The elevated ways were rotating in the opposite direction as the map.  Multiplayer games do not have the rotation button so it is often overlooked in testing and support for it not given priority.  Even after 3+ iterations of private car routing, cars get lost after a map rotation.

Quote from: Matthew on April 26, 2022, 04:24:18 AMPossibly relevant: the directional options for some of the manual tools do not line up in the way that I expect.
The names of the orientations are a result of reusing code from the building placement.  When creating the junctions, I tried to make sure that the orientation of the junction would be the same as or opposing to the orientation of the straight/diagonal that it would attach to.  Likewise the orientations of posts and pillars are designed to be the same as what they are designed to support.  For the single/pillar of concrete or iron, they are designed so that the orientation would be the same as the diagonal or three pillar/post set.
Title: Re: Some elevated ways do not display correctly on rotation
Post by: jamespetts on May 01, 2022, 12:19:12 PM
Thank you - I have now integrated this fix. I should be grateful if you could re-test in the next nightly build.
Title: Re: Some elevated ways do not display correctly on rotation
Post by: Matthew on May 08, 2022, 01:16:07 PM
I find the current code produces a partial fix. If I build an elevated way in the default rotation (let's call it 0), then I can rotate the view to 1, 2 or 3 and it appears correctly. Thank you for fixing this part of the issue, PJMack.

Unfortunately, the bug in OP reoccurs if I build a 'diagonal' elevated way in rotations 1 or 3 and view it in rotations 0 or 2:

(https://i.imgur.com/VAC1LBc.png)
Title: Re: Some elevated ways do not display correctly on rotation
Post by: PJMack on May 08, 2022, 04:09:47 PM
I forgot to fix the parapet rotation as well.  Fix in PR#536.