News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

[Bug] Rotating the map deletes the region info from the map

Started by Ranran(retired), December 06, 2020, 01:59:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran(retired)

Most of the information about the region is masked in the master branch, and the range of the region is hard to recognize.

But I added a lot of display about region in addition to GUI overhaul.
When I was testing it, I noticed that rotating the map completely lost information about the region. Rotating it four times will not restore it. (´・ω・`)
Even if you save it and reload it, it will not be restored. All region information will be lost and all will be in the same region (Albion).

Originally the information in the region was hard to recognize, so I'm not sure if this was brought about by the patch or was it originally.

The zstd branch adds region information to many list dialogs. For example city list dialog and attraction list. You can see about this symptom.

EDIT:
I think region will be empty() instead of albion.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Ranran(retired)


This bug turned out to be reproducible on the master branch.

Reproduction procedure
(1) Display the ground dialog with the inspection tool. You can see that region info is written.


(2) Keep it open and rotate the camera. You can see that the region info disappears.

(3) Save the game and reload it.

(4) Display the ground dialog with the inspection tool again. You can see that region info isn't anywhere.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Thank you for your report. I have now partly fixed this, in that region data are no longer deleted on rotation.

However, there is a more complex issue: when the map is rotated, what counts as 0,0 changes place and is no longer 0,0. The region code (karte_t::get_region()) assumes that all the regions are defined relative to a fixed 0,0, as regions are intended to be layered on top of one another. Thus, on rotation, the "Albion" region will take over the whole map until it is rotated back to its original orientation when the original regions are restored.

It is difficult to think of a straightforward solution to this.
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.

Vladki

How about evaluating the regions at map generation, and storing the region on each tile (similar to climate)?
Would that take too much space? Or, recalculating the region borders according to current rotation?

jamespetts

Quote from: Vladki on December 12, 2020, 06:39:53 PM
How about evaluating the regions at map generation, and storing the region on each tile (similar to climate)?
Would that take too much space? Or, recalculating the region borders according to current rotation?

I deliberately avoided doing this because of the memory requirements: the tile data already takes the most memory of any single data structure in the game.

As to recalculating the region borders based on rotation, it is exactly that that is difficult to think how to do.
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.

Vladki

So, the regions are defined by upper left, and lower right corner, with 0,0 - 100,100 being the whole map.
Lets mark upper left coordinates as x1,y1 and lower right as x2,y2. After rotation - clockwise, the new coordinates are X1,Y1 and X2, Y2
X1 = 100-y2
Y1 = x1
X2 = 100-y1
Y2 = x2


prissi

You could easily rotate the coordinates back; the scripting engine always uses fixed coordinates, regardless of rotation.