Author Topic: Uncertainty of the drawing order of way-objects of road and tram  (Read 1593 times)

0 Members and 1 Guest are viewing this topic.

Offline Ichou

Uncertainty of the drawing order of way-objects of road and tram
« on: February 26, 2017, 11:52:34 AM »
<This might be a specification, not a bug.>

As we can build both road and tram in one tile, we can build way-objects of both road and tram.
Usually, the order of drawing objects is decided and not changeable.

Example : (BACK)   way(backImg) - stop(backImg) - way-object(backImg) - vehicle - (frontImgs)   (FRONT)

However, when it comes to way-objects of road and tram, the order is uncertain and changeable.
Road's way-object(backImage) sometimes hide tram's way-object(backImage), and vice versa.
There seem to be some rules about this issue.
1. The backimage of what has been built the earlier hides the backimage of the later.
2. The order is reversed when a saved data is reloaded.
3. The order of frontimages is opposite to that of backimages.

I suggest that we decide which to be drawn front, because the uncertainty will bring us nothing good, and if we decide it, we will be able to make more orderly worlds.
I hope that way-objects of tram are drawn on the inside(which means backimages of them hide those of road, and frontimages are hidden), but it's an issue the developers should decide that which should be drawn front.


Simutrans version: 120.2 r8077

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #1 on: February 26, 2017, 12:01:00 PM »
Actually it was never foreseen to have more than one wayobj on a tile. So it is no surprise that double wayobj are buggy. (Also the drawing of trams together with long trucks makes artefacts.)

Could you show an image, because I have some problem to imagine wayobj where the drawing order matters?

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #2 on: February 26, 2017, 12:26:50 PM »

The two ways look very similar, but there are some differences.(You would get it by looking at the pillars)
As for the left, I built tram's way-object first and then built road's.
As for the right, I built road's first.

Offline Leartin

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #3 on: February 26, 2017, 02:28:38 PM »
Topic: (wishful thinking) two way_objects on one tile

Why not change it to generally allow two way_objects per waytile, which are predefined as "inner" and "outer" one, and in turn disallow a road with tram to have two 'random' ones? IIRC, either electrification works for both waytypes anyway, and if there is work put into a correct drawing order, it would be more beneficial if all ways can use it, not just the special case of road+tram.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #4 on: February 27, 2017, 02:55:42 AM »
So far the code enforced one wayobj for waytype. That you could two on trams was rather more an accident than planning, which you can tell by the random drawing order. It would be very easy the order by waytype. i.e. rail first then road in this case. Allow two different wayobjs for all tiles will un in all sorts of usability troubles, like the need to strip the outer wayobj before the inner and so on, on not clear at the end of a wayobj which connects to which.

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #5 on: February 27, 2017, 11:21:21 AM »
Thank you for your reply, prissi!

I was amazed to know that double wayobj is like an accident, and now I'm afraid that you might want to delete this 'accidental' function and that we would be perhaps not able to build two wayobjs on one tile, even there are both road and tram. That's because there is an addon which takes advantage of tram's 'double wayobj', and I like it.

If it is easy, could you fix the random drawing order?


Quote
Allow two different wayobjs for all tiles will un in all sorts of usability troubles, like the need to strip the outer wayobj before the inner and so on
Indeed we already have troubles like this quote.
I've thought I'll make a new topic about this trouble, but I'm telling it here.

We can remove either road's and tram's way-objects with 'Remove wayobj road' tool, and that of tram can remove both, too.
Sometimes road's tool doesn't remove road's wayobj, but removes tram's wayobj. The same thing occurs to tram's tool.
And it seems that which to remove depends on the drawing order.


I disagree with Leartin's idea because the system would be more complex, as prissi told.

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #6 on: March 02, 2017, 03:40:23 AM »
I'm sorry to have written too many unnecessary things in my previous post.

Most importantly, random drawing order is a problem, right?
So could you fix the problem?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #7 on: March 02, 2017, 05:10:21 AM »
Check r8126 please

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #8 on: March 02, 2017, 05:58:26 AM »
Thank you!

Has it not released yet?
There is yet r8125 on the following page.
https://nightly.simutrans.com/en/

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4900
  • Total likes: 217
  • Helpful: 108
  • Languages: EN, NO
Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #9 on: March 02, 2017, 06:23:09 AM »
The nightly builds are are all dated 07:00 UTC. That is still over half an hour away. (Apparently, they are nightly according to Americans.)

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #10 on: March 02, 2017, 06:36:26 AM »
Wow, I've heard it for the first time, thank you for telling!
Then I'll try it a few hours later.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #11 on: March 02, 2017, 07:27:24 AM »
Especially since it is now later afternoon in Japan ...

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #12 on: March 02, 2017, 07:44:43 AM »
Yeah, we Japanese perhaps should call it 'afternoon version.'

I tried the new one, and the drawing order problem seems to be fixed well.
But it has another problem: the tram's removing wayobj tool doesn't work at all.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #13 on: March 02, 2017, 08:51:42 AM »
I tested it with pak128 britain and it worked. Which pak did you use?

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #14 on: March 02, 2017, 09:11:10 AM »
I usually use my original pak based on pak128.
And with pak128, it didn't work well either.

Offline Ichou

Re: Uncertainty of the drawing order of way-objects of road and tram
« Reply #15 on: March 02, 2017, 09:17:24 AM »
I got the reason and I could solve this problem.

In menuconf in pak128, the following is written as the default.

# tramtools (waytype 7)
toolbar[5][0]=ways(7,0)
toolbar[5][1]=ways(2,7)
toolbar[5][2]=wayobjs(7)
toolbar[5][3]=signs(7)
toolbar[5][4]=general_tool[17],16,,2
toolbar[5][5]=general_tool[33],,,2
toolbar[5][6]=buildings(33,7)
toolbar[5][7]=buildings(34,7)


So I changed it to the following

# tramtools (waytype 7)
toolbar[5][0]=ways(7,0)
toolbar[5][1]=ways(2,7)
toolbar[5][2]=wayobjs(7)
toolbar[5][3]=signs(7)
toolbar[5][4]=general_tool[17],16,,2
toolbar[5][5]=general_tool[33],,,7
toolbar[5][6]=buildings(33,7)
toolbar[5][7]=buildings(34,7)


Then it worked well.