News:

SimuTranslator
Make Simutrans speak your language.

Wish: Diagonal graphics for signals

Started by makie, July 24, 2026, 10:15:41 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

makie

#35
At the road traffic signs, the background and foreground are swapped in all direction.
But beware: for the railways, it is correct.

For driving on the left side of the road, this behavior would be correct. So, if the flag "drive_on_left" is set. Greetings from Japan!

It would be nice for motorway bridges if it is possible to define BackImage and FrontImage, but currently not possible.

For testing One-way street traffic sign added.
https://makie.de/diagonal-signal.zip

prissi

A no_shift flag would take care of gantries with front and back images...

makie

Quote from: prissi on August 08, 2026, 10:06:26 AMA no_shift flag would take care of gantries with front and back images...
No
Because one one bridge pillar is in front of the bus and the other is behind it, so it's obscured by the bus. If it's supposed to look nice, the there are two graphics.

Same for the One-way sign of pak128. There are Signs at both sides of the road. One bevor and one behind the bus. And this should be swapped for drive to the left. Same for the highway sign.

prissi

#38
Yes, two graphics, but not swapped as swapping with gantry would not work so the gantry would stay a gantry just not swapped. It would have the signs on the wrong side, but still would be a gantry.

EDIT1: Looking deeper into this, the sign system is severely flawed as there is no way to properly define the front and backimage in the first place. And the offset shoudl nto be needed, one should just mirror the image according to the central point of the tile.

EDIT2: With offset_left=0 for pak128 double signs, the road signs are at least no longer somewhere but at the same position as before. Still, a crutch.

makie

#39
Quote from: prissi on August 08, 2026, 01:20:54 PMStill, a crutch.
Yes
That's why I would suggest handling it the same way as with the winter graphics:
Bracket 0 = right-hand traffic,
Bracket 1 = left-hand traffic.

Since drive_on_left can only be changed by saving and reloading, it can select the corresponding graphic while loading.

Quote--------------------------------
#    PAK128.german
#    Signale
#    Neu:01-2011
---------------------------------
obj=roadsign
name=Einbahnstrasse
copyright=The Transporter
waytype=road
intro_year=1800
intro_month=1
cost=450
single_way=1
cursor=Einbahnstrasse2.0.4
icon=> Einbahnstrasse2.0.5
BackImage[0][0]=Einbahnstrasse2.0.1
BackImage[0][1]=Einbahnstrasse2.0.0
BackImage[0][2]=Einbahnstrasse2.0.3
BackImage[0][3]=Einbahnstrasse2.0.2
BackDiagonal[0][0]=Einbahnstrasse2.0.7,13,0
BackDiagonal[0][1]=Einbahnstrasse2.0.6,55,0
BackDiagonal[0][2]=Einbahnstrasse2.0.8,0,3
BackDiagonal[0][3]=Einbahnstrasse2.0.9,0,32
BackDiagonal[0][4]=Einbahnstrasse2.0.8,0,-29
BackDiagonal[0][5]=Einbahnstrasse2.0.9,0,0
BackDiagonal[0][6]=Einbahnstrasse2.0.6,-9,0
BackDiagonal[0][7]=Einbahnstrasse2.0.7,-51,0
FrontImage[0][0]=Einbahnstrasse2.0.1
FrontImage[0][1]=Einbahnstrasse2.0.0
FrontImage[0][2]=Einbahnstrasse2.0.3
FrontImage[0][3]=Einbahnstrasse2.0.2
FrontDiagonal[0][0]=Einbahnstrasse2.0.7,13,0
FrontDiagonal[0][1]=Einbahnstrasse2.0.6,55,0
FrontDiagonal[0][2]=Einbahnstrasse2.0.8,0,3
FrontDiagonal[0][3]=Einbahnstrasse2.0.9,0,32
FrontDiagonal[0][4]=Einbahnstrasse2.0.8,0,-29
FrontDiagonal[0][5]=Einbahnstrasse2.0.9,0,0
FrontDiagonal[0][6]=Einbahnstrasse2.0.6,-9,0
FrontDiagonal[0][7]=Einbahnstrasse2.0.7,-51,0
BackImage[1][0]=Einbahnstrasse2.0.1
BackImage[1][1]=Einbahnstrasse2.0.0
BackImage[1][2]=Einbahnstrasse2.0.3
BackImage[1][3]=Einbahnstrasse2.0.2
BackDiagonal[1][0]=Einbahnstrasse2.0.7,13,0
BackDiagonal[1][1]=Einbahnstrasse2.0.6,55,0
BackDiagonal[1][2]=Einbahnstrasse2.0.8,0,3
BackDiagonal[1][3]=Einbahnstrasse2.0.9,0,32
BackDiagonal[1][4]=Einbahnstrasse2.0.8,0,-29
BackDiagonal[1][5]=Einbahnstrasse2.0.9,0,0
BackDiagonal[1][6]=Einbahnstrasse2.0.6,-9,0
BackDiagonal[1][7]=Einbahnstrasse2.0.7,-51,0
FrontImage[1][0]=Einbahnstrasse2.0.1
FrontImage[1][1]=Einbahnstrasse2.0.0
FrontImage[1][2]=Einbahnstrasse2.0.3
FrontImage[1][3]=Einbahnstrasse2.0.2
FrontDiagonal[1][0]=Einbahnstrasse2.0.7,13,0
FrontDiagonal[1][1]=Einbahnstrasse2.0.6,55,0
FrontDiagonal[1][2]=Einbahnstrasse2.0.8,0,3
FrontDiagonal[1][3]=Einbahnstrasse2.0.9,0,32
FrontDiagonal[1][4]=Einbahnstrasse2.0.8,0,-29
FrontDiagonal[1][5]=Einbahnstrasse2.0.9,0,0
FrontDiagonal[1][6]=Einbahnstrasse2.0.6,-9,0
FrontDiagonal[1][7]=Einbahnstrasse2.0.7,-51,0

makie

Quote from: makie on August 08, 2026, 02:16:09 PMSince drive_on_left can only be changed by saving and reloading, it can select the corresponding graphic while loading.
Ok no, not possible, because pak-set is load bevor the save-game.

Nevertheless, I think this solution covers all possible cases, because you can assign a specific offset to each graphic.


prissi

I think having a back and front sign (like for gantries) is another thing to consider.

Image[n,s,e,w][0]  (old)
Image[n,s,e,w][1]  (left)
FrontImage[n,s,e,w][0..1]

analog.

Needs a special flag for traffic lights, which are currently only recognized by their image number.

makie

Quote from: prissi on August 08, 2026, 02:59:59 PMImage[n,s,e,w][0]  (old)
Image[n,s,e,w][1]  (left)
FrontImage[n,s,e,w][0..1]


Ok, missing diagonals  ne, nw, se, sw, en, es, ws, wn?

Edit: ups we have 8 diagonals



prissi

Diagonals are "diagonal[][]" and "fontrdiagonal[][]" then, similar to signals.


makie

#45
I created the "autobahn" traffic signs for pak128, including diagonal, frontimage and left-hand traffic.
https://makie.de/p128_sign_road_autobahn.zip
I created it carefully, but since I can't test it, there might be errors. The positions of the straight sections aren't optimal; I left them as they were originally.

Attention: The program normally decides whether it draw as backimage or frontimage.
If the pak provide frontimage then "image" must drawn as backimage. Independent of the program logic.
That might be nonsensical for vertical diagonals, but I use it to position the graphics on the left and right independently.

Should set "offset_left=0" automatically if graphics provided for "drive on left"?

prissi

Somehow neither on diagonals nor on straight tiles I seen a sign appearing. Unluckily, I had not more time to test this today.
 

makie

#47
Of course not, that requires the program change discussed above for drive on left. That is precisely why I haven't been able to test it.

Haven't you already received tons of error messages from makeobj?


prissi

A, sorry, I thought the signal code was incorporated. Indeed, makeobj does not yet recognize the diagonal images.