The International Simutrans Forum

Simutrans Extended => Simutrans Extended Development => Topic started by: Ranran on April 30, 2018, 10:30:23 AM

Title: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: Ranran on April 30, 2018, 10:30:23 AM
"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
(https://i.imgur.com/wnmB3LS.png)

(Image2) - when zooming out
(https://i.imgur.com/VMEXihJ.png)

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
(https://i.imgur.com/iBqiKIB.png)

(Image4) - same place as (Image1)
(https://i.imgur.com/s2bplnG.png)

(Image5) - illigal train and ship are enshrined
(https://i.imgur.com/JAdKYA2.png)

(´・ω・`)
EDIT: Resubmit expired images
Title: Re: Bug: Somthing trash image is mixed in "High Voltage transmission line bridge".
Post by: Matthew on April 30, 2018, 11:26:07 AM
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.
Title: Re: Bug: Somthing trash image is mixed in "High Voltage transmission line bridge".
Post by: jamespetts on May 04, 2018, 12:08:28 AM
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.
Title: Re: Bug: Somthing trash image is mixed in "High Voltage transmission line bridge
Post by: Ranran on May 04, 2018, 04:29:58 PM
I checked this error occurs in other paksets.
(https://simutrans-germany.com/files/upload/TLB-check.png)
(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)
(https://i.imgur.com/euGHV4g.png)
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
Title: Re: Bug: Somthing trash image is mixed in "High Voltage transmission line bridge".
Post by: Junna on May 04, 2018, 06:02:57 PM
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.
Title: Re: Bug: Somthing trash image is mixed in "High Voltage transmission line bridge".
Post by: Dwachs on May 04, 2018, 08:08:34 PM
This looks like an uninitialized image variable (in the tile grund_t, the bridge bruecke_t, or the powerline leitng_t objects).
Title: Re: Bug: Somthing trash image is mixed in "High Voltage transmission line bridge".
Post by: jamespetts on May 04, 2018, 09:24:46 PM
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?
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: Ranran on September 11, 2018, 10:36:15 AM
I changed the current code by just one line like this (https://github.com/Ranran-the-JuicyPork/simutrans-extended/commit/284de74ddcacfb623a8bc368a74a6d66e5329e33). 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?
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: DrSuperGood on September 11, 2018, 10:42:12 AM
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.
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: Ranran on September 11, 2018, 10:50:54 AM
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.
Is this a problem with demo.sve?
I check this place in demo.sve every time.
(https://i.imgur.com/VMEXihJ.png)
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: jamespetts on September 13, 2018, 12:39:00 PM
I cannot reproduce that with my version, I am afraid.
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: DrSuperGood on September 13, 2018, 05:06:15 PM
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.
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: jamespetts on September 15, 2018, 05:37:38 PM
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.
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: 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.
Title: Re: Bug: Something trash image is mixed in "High Voltage transmission line bridge"
Post by: jamespetts on March 08, 2019, 04:26:41 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.