News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

Way drawing order related to tunnel images

Started by Phystam, May 05, 2018, 05:35:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phystam

I am playing simutrans-extended now, but I found some drawing bug(?) related to tunnel images.
1. Tram track on the portal of tunnel is not drawn --- probably behind the backimage of tunnel
2. Track catenary behind terrain is drawn
These images (ways, tunnels, way-objects, vehicles, ...) should be drawn behind the front terrain.
So I propose the drawing order like this:
(back terrain) -> image (way) -> backimage (tunnel) -> backimage(tram) ->backimage (wayobj) -> vehicles -> frontimage(wayobjs) ->frontimage(way) -> frontimage (tunnel) -> (front terrain)
However the importance is low... I will try it.



[note] This issue can also be seen in standard version.

jamespetts

That is an interesting observation. I have not looked much into the graphics code (and certainly nothing to do with drawing order), so if you are able to look into this, that would be most useful.
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.

Phystam


jamespetts

Nor can I - I am not familiar enough with the drawing routines to be able to decipher what causes 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.

Ranran(retired)

 
Quote1. Tram track on the portal of tunnel is not drawn --- probably behind the backimage of tunnel
This seems to be common issue both Standard and Extended.
I checked this issue in pak.nippon with both Standard and Extended.


Quote2. Track catenary behind terrain is drawn
I think No.2 is pakset issue.
Generally, the catenary pole and overhead wire on the tunnel entrance tile are hidden by the tunnel image. And the part which does not hide is displayed as it is.

The near side pole is not necessary(except for the terminal end:Image[N],Image[E],Image[W],Image{S]), and it should be supported from the near side tile.
For example, North to South catenary image(Image[NS]) need the north side of pole, but the south side pole not needed.

Sorry for my poor Engrish thing. "far side" and "near side" means:

Red position is the "far side". Blue position is the "near side".

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

jamespetts

Thank you for confirming. I have moved this to the Standard bug reports section, as this issue can be reproduced there.
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.

Dwachs

#6
@Phystam: I cannot  reproduce the issue with catenary behind terrain and with catenary painted on tunnel walls in standard. There are some issues with catenary poles visible on tiles to the side of tunnel portals.

Changing the drawing order to show tram tracks inside tunnel portals is possible but it would be quite hackish.

Edit: with commit r8427 some glitches should be fixed: catenary images that were drawn onto adjacent tiles is now hidden behind the terrain.
Parsley, sage, rosemary, and maggikraut.

ACarlotti

Quote from: Dwachs on May 06, 2018, 10:08:02 AM
@Phystam: I cannot  reproduce the issue with catenary behind terrain and with catenary painted on tunnel walls in standard. There are some issues with catenary poles visible on tiles to the side of tunnel portals.

Having just checked Standard (and seen results as you describe), that seems to be exactly the same underlying issue; any difference in presentation appears to be due to the differences in the pakset (pak128.Britain has more elaborate catenaries with more widely spaced poles than pak64 does).

The issue in pak128.Britain Extended appears to be because the catenary is rendered after the rendering of the ground of the tile to the south or east. There is some clipping applied to objects, but as far as I can tell this is only for the purpose of rendering vehicles that are straddling multiple tiles. In this case it is evident that we also need to either render the ground after the catenary, or apply more clipping to cover this scenario.
In pak64 Standard, the issue is in fact more difficult, because the depicted catenary occupies (3D) space that is not within the tunnel. This suggests that a full solution of this problem requires separate catenary images for use in tunnels, and use in tunnel mouths.

Dwachs

I cannot reproduce the issue in post #3 in simutrans standard with pak64 or pak128.Britain. So at least this issue is not pak-set dependent, but a bug in simutrans extended.

The tile behind the tunnel portal should have flag draw_as_obj set, which then would paint the vertical wall after the catenary on the tunnel tile is drawn.
Parsley, sage, rosemary, and maggikraut.

Ranran(retired)

#9
Sorry, pak.nippon was a special case...
It is almost not covered with a cover, and the entrance is on the back side.
So it seems there is no tram track on the tunnel entrance tile, but it is just one image with road and concrete cover (not separated).
If you try to display tram track here, it is certainly hackish... Dwachs and ACarlotti are right.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

ACarlotti

Quote from: Dwachs on May 06, 2018, 10:59:01 AM
I cannot reproduce the issue in post #3 in simutrans standard with pak64 or pak128.Britain.

Oops, retested using the latest version and it is indeed fixed there (wasn't fixed in Standard 120.2.2). Once that fix is included in Extended, then I think the only catenary issue remaining that I know of will be that pak64's catenary doesn't fit inside the tunnel. (It still seems reasonable to aspire to separate graphic - in reality you wouldn't generaly put up ordinary poles inside a tunnel; you'd mount the catenary to the tunnel roof/walls).

I think, fundamentally, the problem in Extended is that we're not consistently picking up changes made in Standard (1354 revisions in Standard since the last merge, and I'm not sure wha tthe policy has been since then). I'm going to post about this in the Extended forums.