News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[Bug] Regions do not support camera rotation

Started by RESTRICTED ACCOUNT, February 01, 2021, 01:04:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RESTRICTED ACCOUNT

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.

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.


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.

RESTRICTED ACCOUNT

#1
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.

jamespetts

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.