The International Simutrans Forum

 

Author Topic: [Bug] Regions do not support camera rotation  (Read 386 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1555
  • Languages: ja
[Bug] Regions do not support camera rotation
« on: February 01, 2021, 01:04:19 PM »
The previously reported bug was a problem that the region information was "lost" when the camera was rotated, but this bug is different. (´・ω・`)

There are four camera angles, but only the default angle can display the correct region information. If you change to another direction, all regions will be replaced with default regions.
The region state is restored when the camera position returns to the initial state after rotating 4 times.

EDIT:
I've investigated this a bit, but the regional rotation algorithm is completely broken.

The coordinates of the regions before the map rotation in demo.sve are as follows.
Code: [Select]
Albion (0,0)-(256,256)
Northumberland (0,0)-(256,128)
Caledonia (0,0)-(256,64)
Cambria (0,89)-(64,166)
Kernow (0,166)-(51,256)
Erin (0,0)-(64,89)

The coordinates of each region according to the debug output when rotated once are as follows.

Code: [Select]
Albion (512,0)-(256,256)
Northumberland (512,0)-(384,256)
Caledonia (512,0)-(448,256)
Cambria (423,0)-(346,64)
Kernow (346,0)-(256,51)
Erin (512,0)-(423,64)

It should be noted that these coordinates represent the upper left and lower right.
The demo map is an elongated map with a width of only 31 tiles, but the region area is much wider than that.
32 or more of the x coordinate is outside the map area. That is, all regions are outside the map.
For example, Erin is the upper left area of the map and must contain (0,0)-(31,64) after rotation.
« Last Edit: June 23, 2021, 05:48:49 PM by Ranran »

Offline Ranran

  • Devotee
  • *
  • Posts: 1555
  • Languages: ja
Re: [Bug] Regions do not support camera rotation
« Reply #1 on: June 23, 2021, 05:28:10 PM »
I think I'm fortunate enough to have successfully fixed this bug.
I would appreciate it if you could check it.
https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/fix-region-rotation

EDIT:
However, if you have already rotated the map and the region information is corrupted, it will not be repaired automatically.
« Last Edit: June 23, 2021, 05:44:17 PM by Ranran »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20815
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] Regions do not support camera rotation
« Reply #2 on: June 26, 2021, 12:55:59 PM »
Thank you - now incorporated.