The International Simutrans Forum

Development => Bug Reports => Topic started by: arl85 on March 05, 2022, 11:45:45 AM

Title: Pak64 - North/South Choose point sign reversed?
Post by: arl85 on March 05, 2022, 11:45:45 AM
Hi,
I'm not sure it's a bug or I'm misunderstanding how road choose point sign works in pak64.
It seems that choose point sign facing north/south are working backward. I try to explain: instead of waiting on blue side of the sign, veichles wait at the white side.
(https://i.imgur.com/mdW7iTh.png)
They simply wait there "waiting for a clearance". I understand they are waiting a free bay at their destination ("Center" station) but that's now what I expect. I expect they wait for a free bay when coming back to "North" station.

On East/West directions it works this way, indeed: vehicles queue facing blue side of the sign when directed to go to East station. Not waiting at all when going to Center.
(https://i.imgur.com/zLf9D49.png)

I'm attaching savegame used for testing it; just default pak64 and simutrans 123.0.1

I'm quite sure it's a graphical bug, like having the image of the sign "reversed", so feel free to move it in an appropriate bug section in case it's indeed a bug.
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: Andarix on March 05, 2022, 11:57:10 AM
https://sourceforge.net/p/simutrans/code/2104/ (https://sourceforge.net/p/simutrans/code/2104/)
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: arl85 on March 05, 2022, 12:01:53 PM
Quote from: Andarix on March 05, 2022, 11:57:10 AM
https://sourceforge.net/p/simutrans/code/2104/ (https://sourceforge.net/p/simutrans/code/2104/)

Nice, So it should be fixed in next release (or maybe I'll try to "compile" it in a .pak file to use it earlier). Thanks!
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: arl85 on March 05, 2022, 06:08:30 PM
I dowloaded the fix, packed it but it was not working:

(https://i.imgur.com/TUHKZI5.png)
with rev 2103 dat, the same as OP file

(https://i.imgur.com/WlDat1E.png)
with rev 2104 dat, the suggested fix: notice how N/S's graphics (according to compass) did not change, but E/W did, instead!

(https://i.imgur.com/8Y3qtuA.png)
fixed reverting to 2103 and swapping E/W (attached dat and pak). Now graphics are matching the real behavior.

Then I found another strange behavior: according to this post (https://forum.simutrans.com/index.php/topic,21427.msg199112.html#msg199112) first number in traffic light settings is N/S green period, but according to this video (https://imgur.com/61yqhfx) it's indeed the E/W timing (I set 1 and 10 to clearly differentiate timings). So, does the compass indicate the "real" north?

Last thing: probably after adding yellow timings something broken because rotating the map the third value (extra offset) should remain 0, instead it changes (gif here (https://imgur.com/t5iPNNx)
(https://i.imgur.com/t5iPNNx.gif)

and if values rotates, so should be done with labels: the direction you're facing should not change the timing or at least labels should be changed accordingly

Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: arl85 on March 05, 2022, 07:51:48 PM
A quick check:
loading a simple heigtmap like this
(https://i.imgur.com/tB6BXsB.png)

produces that
(https://i.imgur.com/OVFwc4N.png)
so compass is correct
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: prissi on March 06, 2022, 03:14:41 AM
The traffic light should change indeed.

For the signs, N and S seems consequently swapped, also for minimum speed. THat is a bug, which needs addressing!
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: arl85 on March 06, 2022, 09:43:27 AM
Quote from: prissi on March 06, 2022, 03:14:41 AM
The traffic light should change indeed.
Sorry, my English is not so good. I don't understand if you're saying that traffic lights are working correctly right now or if they should be changed (label, third value setting, etc)

Quote from: prissi on March 06, 2022, 03:14:41 AM
For the signs, N and S seems consequently swapped, also for minimum speed. THat is a bug, which needs addressing!
for no-entry too, but even in this case Image[E] vs Image[W]

I investigated furhter and found that rails.dat works correctly and it uses numbered syntax (Image[0]) while roadsign.dat uses character syntax (Image[N]).
image[0]=railsign.0.0
Image[1]=railsign.0.1
Image[2]=railsign.0.2
Image[3]=railsign.0.3

(https://sourceforge.net/p/simutrans/code/2103/tree/pak64/way/railsign.png?format=raw)

(revision 2103)
image[N][0]=roadsign.0.0
Image[S][0]=roadsign.0.1
Image[W][0]=roadsign.0.2
Image[E][0]=roadsign.0.3

(https://sourceforge.net/p/simutrans/code/2103/tree/pak64/way/roadsign.png?format=raw)

if I read the code correctly, in roadsign_writer.cc directions are defined as
static const char* general_sign_directions[] = {"n", "s", "e", "w"};
so
N -> 0
S -> 1
E -> 2
W -> 3


attached pak seems to work fine, now

ps. sorry, maybe I'm just making wrong assumptions on a lot of things, first time trying to understand how code works.
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: prissi on March 06, 2022, 01:02:32 PM
The definitions in makeobj itself were wrong. Fixed in r10538, I hope
.
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: prissi on March 06, 2022, 01:45:27 PM
The traffic lights ue the apparent screen direction. It even changes EW and NS on rotation intentionally.

The compass is a later addition and not for all paksets. So maybe the text of the traffic lights uses the screen NS/EW directions. I tried a new one using / and \ instead of NS and EW
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: arl85 on March 06, 2022, 07:56:24 PM
Quote from: prissi on March 06, 2022, 01:02:32 PM
The definitions in makeobj itself were wrong. Fixed in r10538, I hope

Nice; I'm quite sure revision 2104 of pak 64 should be reverted, then, because it reverses wrong couple (N/S were in the right order in rev. 2103)
Title: Re: Pak64 - North/South Choose point sign reversed?
Post by: prissi on March 07, 2022, 01:39:08 AM
Thanks, I also forget the offset_left