The International Simutrans Forum

 

Author Topic: Bug: Overlapping drawing of vehicle panels in the depot dialog  (Read 327 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran jp

  • *
  • Posts: 442
  • Languages: ja
The depot vehicle panel is drawn overlapping every time player performs an action. (´・ω・`)))))
In other words, the vehicle picture that looks like 1 vehicle at first glance may actually be 20 overlapping pictures.

This bug became apparent when I was making a constraint display patch of a depot dialog. This affected not only the vehicle but also the color bar.


I used to know that vehicle panels of the depot dialog don't display transparency properly, but I have thought it to be a bug from the standard.
For example, when the alpha channel is used for the outline of the vehicle picture created by 3d modeling, it looks unnatural because the pixel becomes opaque after the deterioration.
And the image is different from before and after selection, and after selection (upper part of the depot dialog) it is displayed normally.
However, as a result of verification, it turns out that this is a bug specific to extended.
(This is different from the nighttime display bug I previously reported to the standard bug report)





I made an image dummy vehicle pak showing transparency for verification of this bug. The numbers in this dummy vehicle pak indicate the percentage of transparency.


Test on standard:

There is no particular problem.
(The transparency of the image does not change through various operations. This is the correct behavior.)



Test on extended:



Description of the demonstration image:
There are experimental paks with different transparencies. The numbers represent transparency.
One can not be selected because the axial weight is too heavy. They are displayed with a gray color bar.

Pay attention the change in the "90" on the right side of the screen.

1) Repeating "Show all" on and off. You can see that this operation causes the panel to lose transparency.

2) Reopen the depot dialog and reset the duplicate display bug. Then I have repeatedly clicked on the panel of "10" whose color bar is gray. You can see that this operation causes the panel to lose transparency.

3) Reopen the depot dialog and reset the duplicate display bug. Then I'm choosing numbers and assembling convoy. The assembled convoy has the correct transparency, but the lower panel has lost transparency.

4) Reopen the depot dialog and reset the duplicate display bug. However, the transparency seems to be different at the assembled convoy and the choose panel.







This is the state that just opened the depot dialog.
Notice the color differences of 10, 25 and 90. The difference is already seen in the initial state. The lower 10 and 25 are true black, and the lower 90 is darker than the upper 90.
Judging from its transparency, the lower selection panel seems to overlap two sheets from the beginning.


This bug has also been confirmed to occur on the June 19, 2018 build.
The code around the depot is different between extended and standard. The extended code is partially transferred to gui_convoy_assembler.
I speculate that this may be a bug that has existed since it was done.

I attach png and pak for test to this thread.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18615
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Overlapping drawing of vehicle panels in the depot dialog
« Reply #1 on: April 09, 2019, 10:30:15 PM »
Thank you for the report. I have never looked into the transparency code, and I do not know how this works; I suspect that some code somewhere was not ported when transparency was implemented in Extended. Given the amount of time that it would take me to understand the code in order to fix it compared with the seriousness of the issue, I will have to categorise this as low priority for now, but if anyone else would care to work on a fix for this, I should be most grateful.

Offline Ranran jp

  • *
  • Posts: 442
  • Languages: ja
Re: Bug: Overlapping drawing of vehicle panels in the depot dialog
« Reply #2 on: April 11, 2019, 02:23:46 PM »
Quote
I have never looked into the transparency code, and I do not know how this works
I am sorry that my explanation was not transmitted well but this is not a transparency code problem. The problem is the duplicate drawing process of "Vehicle panel".
"Vehicle panel" is the contents of tab, that is, the part enclosed in red.


For example, when looking at bundled 10 canvases from directly above, you do not know how many canvases overlap.
What if the picture was colored clear glass? The lower picture may be seen through, and it may be understood from the color depth that it is overlapping.
That is, the use of a transparent image exposed the duplicate drawing process. For example, if two images with 50% transmittance are superimposed, it will appear as an image with 25% transmittance.
Repeating that will eventually make it not transparent.

I tried searching for and removed the code that seems to be the cause of the duplication.
https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/fix-duplicate-drawing-in-the-depot
Testing this results in correct transparency, but does not seem to cause other problems. Please check just in case.



The transparency of assembled convoy and vehicle panel is the same.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18615
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Overlapping drawing of vehicle panels in the depot dialog
« Reply #3 on: April 11, 2019, 10:36:30 PM »
Splendid, thank you for that: now incorporated.