News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Bug: Something trash image is mixed in "High Voltage transmission line bridge"

Started by Vladki, January 09, 2017, 11:01:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

The picture should say all - there are weird artefacts on bridges - vehicles under the ramp, white squares above.

I have checked the way-power_lines-128.png file, but that looks OK to me, so it is porobably not a pakset problem.

jamespetts

At some point, I will need to re-create all of the power lines using the new alpha rendering. Oddly, I cannot find what is causing this, as the image itself appears to be clean.
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.

Ranran(retired)

"High Voltage transmission line bridge" always mixes strange image.

For example, you can see this in demo.sve of pak128.Britain at coordinates(433, 15).
This occurs not only in pak128.Britain but in other pakset.
In most case, the trash is something like GUI parts. (Checkbox or left corner parts?)

(Image1) - square boxes mixed in


(Image2) - when zooming out


In particular this small square trash is very noticeable when zooming out because it does not become small.

Occasionally, another strange images may appear under the transmission line bridge, such like a bulldozer, train, ship, illegal building, bridge pillar, and so on.
Even if you rotate the map, vehicles in the same direction will be displayed as they are and never move.
These will change every time you start the game even in the same place. For example, (Image1) and (Image4) are in the same place.

(Image3) - bridge pillar mixed in


(Image4) - same place as (Image1)


(Image5) - illigal train and ship are enshrined


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

Matthew

I also see the same misplaced images, both in demo.sve and in my own savegame. I am using the nightly from two days ago on Windows 7, if that helps.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

I have seen this before, but I have never tracked down the cause of this: I cannot find anything untoward in the image itself, and I do not have any idea how the graphics code works, as virtually nothing in the graphics code is changed from Standard in Extended.

If anyone has any idea what sort of problem that this might be (can this be reproduced in Standard with the Standard version of Pak128.Britain?), this would be most helpful.

Edit: I should note that I have seen the white(ish) squares before, but not the vehicles, which is odd.
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.

Ranran(retired)

I checked this error occurs in other paksets.

(It may work if you repaked by yourself with its makeobj.)

As far as I saw, it occurs only with "High Voltage transmission line bridge", any pakset in Extended.
In my case, I could not confirm this error in Standard. (128.Britain too)

This is the case of pak.nippon. (Although pak.nippon is for standard)

pak.nippon has some kinds of "High Voltage transmission line bridge", and this error occurs all of those.
That is just a wilderness, so all building things are illegal. And "ShoreTrans" is mixed in there, but this is a bad case. Mostly square whitish boxes, in my case.
Normally "ShoreTrans" does not appear on the game screen as it is. I certainly think it's quite odd. ???
EDIT: Resubmit expired images
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Junna

I've only seen it in the form of the vehicles, and it goes back at least to around the time when the new way wear concept was introduced, if not longer, which was years ago.

Dwachs

This looks like an uninitialized image variable (in the tile grund_t, the bridge bruecke_t, or the powerline leitng_t objects).
Parsley, sage, rosemary, and maggikraut.

jamespetts

Thank you both for your help - that is most useful. I have tested using Dr. Memory, but I cannot find any uninitialised variables when power line bridges (with this bug) are displayed, so this does not seem to be the issue.

However, by uninitialised, do you perhaps mean not that the memory is actually uninitialised in a way that Dr. Memory could find, but that it has a wrongly initialised default value?
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.

Ranran(retired)

I changed the current code by just one line like this. Then the drawing bug of power line bridge disappeared. And the drawing of has_own_way_graphics(railway bridges and road bridges) seems to be the same as before.
I think that this part is the cause of power line bridge drawing bug.
I am not familiar with C++ so I am not sure if this change is correct as a whole.

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

DrSuperGood

Can you provide a demo map (with any non-standard pakset files) with annotations showing where the issues are visible? Such map would be useful to debug the problem.

Ranran(retired)

Quote from: DrSuperGood on September 11, 2018, 10:42:12 AMCan you provide a demo map (with any non-standard pakset files) with annotations showing where the issues are visible? Such map would be useful to debug the problem.
Is this a problem with demo.sve?
I check this place in demo.sve every time.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

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.

DrSuperGood

This seems to be compiler specific behaviour...

Looks perfect on my self built MSVC debug (SDL2, GDI sound).
https://www.dropbox.com/s/3gs81ymbus26y6q/simscr00.bmp?dl=0

However it looks exactly like the image you provided when using the automatically GCC built optimized nightly.

Those white squares are absolute in size. They do not get smaller when zooming out or larger when zooming in.

jamespetts

Very odd. This looks on the face of it to be likely to be a bug in low level graphics code (possibly from Standard) about which I have very little understanding.
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.

Ranran(retired)

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

jamespetts

Quote from: Ranran on March 08, 2019, 03:36:14 PM
I think this bug may not be visible in the debug build.
I have not seen this bug in debug build.

Yes, this is a very difficult and obscure problem: there is clearly some indeterminate or compiler specific behaviour somewhere buried deep in the graphics code, about which code I know very little.
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.

Mariculous

Hey there,
Yesterday My server has reached the age of electricity which introduced some funny randomly appearing bug at powerline bridges.


How to reproduce:
Well, I don't know exactly. Just build powerline bridges until it happens. This visual bug is not even persistent over network clients or map save/loads so I can't provide a savegame for this bug.

Matthew

This bug has already been reported by ranran.

The result of the discussion was: nobody here understands the graphics code, and it's a minor bug, so none of us are bothered enough to fix it.

(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

Indeed, this is a known issue: I have merged the topics accordingly.
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.

Ranran(retired)

I've been testing the display of images and found that if I rewrite it like this, I get similar symptoms.

//return tile->get_background(anim_frame, 0, season);

Just comment out the return statement.


The images mixed in the transmission line bridge are almost always the same white box.
I think there is a similar error in the code that drawing the transmission line bridge. I mean, the image value is not returned.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Quote from: Ranran on July 19, 2020, 03:49:03 PM
I've been testing the display of images and found that if I rewrite it like this, I get similar symptoms.

//return tile->get_background(anim_frame, 0, season);

Just comment out the return statement.


The images mixed in the transmission line bridge are almost always the same white box.
I think there is a similar error in the code that drawing the transmission line bridge. I mean, the image value is not returned.

Interesting - I wonder whether there is a missing return statement somewhere...?
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.

Mariculous

Might or might not be the case.
The mising return will cause null data to be stored (although it's undefined behavior to be exact)
Any kind of unitialised values might cause the high voltage transmission line bridge bug.
My assumption was it had to do with the seperation of waygraphics from bridge graphics, but when tracing transmission line construction, I did not find the exact cause.

Ranran(retired)

Santa Claus in 2020 brought me an inspiration. :lightbulb:
I'm very worried if he brought the coronavirus, but I did things according to the gift.

The inspiration is to replace the part that may be generating the trash image with another image and narrow down the habitat of the bug.

And it was narrowed down to the following code in leitung2.h.

image_id get_image() const OVERRIDE {return is_crossing ? IMG_EMPTY : image;}
image_id get_front_image() const OVERRIDE {return is_crossing ? image : IMG_EMPTY;}

Above is the original code.

Replace it like this:

image_id get_image() const OVERRIDE {return is_crossing ? IMG_EMPTY : skinverwaltung_t::mail->get_image_id(0);}
image_id get_front_image() const OVERRIDE {return is_crossing ? skinverwaltung_t::goods->get_image_id(0) : IMG_EMPTY;}


This change will, of course, display those symbols in the wrong place like this.


But strangely, I expected all the high-voltage power lines to be replaced, but the bridges were not.
So what does the mail image there usually display? Yeah, I suspect it's displaying a trash image.

Based on this result I made a change that seems to resolve this. Unfortunately, this bug cannot be reproduced with MSVC. At least I don't think it will have any negative effects. I would appreciate it if you could confirm this.

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

jamespetts

Thank you very much for working on this: it is much appreciated.

Unfortunately, this does not seem to have any effect in Linux. Adding similar code for get_frontimage() makes no difference and I was not even able to reproduce the results that you obtained testing with the mail symbol: in each case, the power line bridge simply displayed a little blue square for each tile (note that this is now the same blue as player colour, not white whether or not your patch is applied).
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.

Ranran(retired)

Quote from: jamespetts on December 26, 2020, 11:23:34 AMUnfortunately, this does not seem to have any effect in Linux. Adding similar code for get_frontimage() makes no difference and I was not even able to reproduce the results that you obtained testing with the mail symbol: in each case, the power line bridge simply displayed a little blue square for each tile (note that this is now the same blue as player colour, not white whether or not your patch is applied).
Thank you for your confirmation. It's a shame that it didn't give good results. (´・ω・`)
The results suggest that it is due to the power line bridge display code elsewhere, which was found to be displayed independently of leitung2.
I performed the same verification method again to uncover the habitat of the bug.
And I found a place where could display the mail symbol in the same place with another code. So I changed it to return IMG_EMPTY in case of powerline brdge.
I would appreciate if you could check again if this fix can get rid of the bug.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Excellent, thank you: this has now fixed the problem for Linux builds. Thank you very much for your work on this. This is incorporated and will be part of to-morrow's 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.

Ranran(retired)

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

Matthew

Quote from: Ranran on December 26, 2020, 09:19:40 AM
Santa Claus in 2020 brought me an inspiration. :lightbulb:
I'm very worried if he brought the coronavirus, but I did things according to the gift.

...

I'm glad it's finally eradicated. 

This is a very long-standing bug that has defeated several efforts to remove it. Thank you Ranran for the patch, James for the code review, and.... Santa for the inspiration?!  ???
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。