Author Topic: method for finding unconnected tracks  (Read 9954 times)

0 Members and 1 Guest are viewing this topic.

phillyj

  • Guest
method for finding unconnected tracks
« on: February 28, 2014, 04:45:34 PM »
Sometimes it is not obvious that a track or road is not connected. Sometimes, careful examination of the route fails us, since the eyes probably overlook it.

My method is to have the route in question be run using waypoints. For example, place a waypoint as far as possible and run the vehicle. Try a few different point and eventually you will find the point which the vehicle can't cross. It's systematic, don't just randomly place points hoping to find the location.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: method for finding unconnected tracks
« Reply #1 on: February 28, 2014, 06:31:32 PM »
I just rebuild the track at known problem spots (bridges, tunnels, certain platforms), progressing to less likely spots if that fail. If electification is involved, I try to rebuild that first, which can be done over long stretches with little fear of unintended effects. This tactic will however fail if the problem is with signals, but that's rarely the case, for me at least.

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1387
  • Total likes: 22
  • Helpful: 53
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: method for finding unconnected tracks
« Reply #2 on: February 28, 2014, 07:59:29 PM »
Quote
My method is to have the route in question be run using waypoints. For example, place a waypoint as far as possible and run the vehicle

I use a slightly better method by trying to place a waypoint halfway each time. So, first time halfway between start and finish. If no route is found, try another waypoint halfway start and first waypoint. If a route is found, try another waypoint between first waypoint and finish. Etcetera.

Known to programmers as binary search...
Bob Marley: No woman, no cry

Programmer: No user, no bugs



Offline ӔO

  • Devotee
  • *
  • Posts: 2345
  • Total likes: 2
  • Helpful: 66
  • Hopefully helpful
  • Languages: en, jp
Re: method for finding unconnected tracks
« Reply #3 on: February 28, 2014, 10:05:10 PM »
I use electrification preview.

If you drag electrification between two points, and they don't preview the build, then it's disconnected.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

Offline benjad

Re: method for finding unconnected tracks
« Reply #4 on: February 28, 2014, 10:13:23 PM »
Known to programmers as binary search...

Had to chuckle... just taught that today... somewhat successfully.

That being said, the pakset goes a long way to helping you find these 'adjacent tiles' not connected.  I like paksets that have large 'bumpers' at the end of rails... that helps a lot. 

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: method for finding unconnected tracks
« Reply #5 on: March 01, 2014, 09:36:04 AM »
I just remembered another place where disconnects may go unnoticed due to lack of bumper graphics: slopes.

phillyj

  • Guest
Re: method for finding unconnected tracks
« Reply #6 on: March 01, 2014, 04:24:02 PM »
I use a slightly better method by trying to place a waypoint halfway each time. So, first time halfway between start and finish. If no route is found, try another waypoint halfway start and first waypoint. If a route is found, try another waypoint between first waypoint and finish. Etcetera.

Known to programmers as binary search...

Yes, that is what I meant. Sorry for my poor explanation. Much faster than following the roads by sight.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: method for finding unconnected tracks
« Reply #7 on: March 01, 2014, 04:56:56 PM »
Much faster than following the roads by sight.

I guess what gives it an edge is that the vehicle can start moving immediately as far as it gets, rather than having to wait at the starting point until everything is fixed. But visual inspection can be done with the game paused, which might be important if things pile up quickly while something is stuck.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: method for finding unconnected tracks
« Reply #8 on: March 01, 2014, 09:23:44 PM »
The problem with "Halfway waypoint" is that to set a waypoint at half way, a computer need a successful way search, which does not finish for "not found".

Offline gauthier

Re: method for finding unconnected tracks
« Reply #9 on: March 01, 2014, 10:36:51 PM »
Just a simple algorithm idea to find such connection problems automatically : for each way ending, test if there is an opposite ending just after it. Could it be easily implemented ?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: method for finding unconnected tracks
« Reply #10 on: March 01, 2014, 11:36:03 PM »
That would be a way search ignoring ribis, and it is easy. However, this will not find signals facing in the wrong way. One would then need a special convoi, which uses the setting of the routeless vehicle to find the missing linke, wrong singal, wrong slope ...

I tried a patch with only a modified route search, but it is not very easy for a computer to find the right missing ways. Even in very simple geometries. SO one may need to drive this found route also.

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1387
  • Total likes: 22
  • Helpful: 53
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: method for finding unconnected tracks
« Reply #11 on: March 02, 2014, 12:33:30 AM »
The problem with "Halfway waypoint" is that to set a waypoint at half way, a computer need a successful way search, which does not finish for "not found".

I know, my method is meant to be performed manual  ;)
Bob Marley: No woman, no cry

Programmer: No user, no bugs



Offline ӔO

  • Devotee
  • *
  • Posts: 2345
  • Total likes: 2
  • Helpful: 66
  • Hopefully helpful
  • Languages: en, jp
Re: method for finding unconnected tracks
« Reply #12 on: March 02, 2014, 12:54:05 AM »
How about a visual toggle to highlight all the dead ends?
or a visual toggle to replace all signals with arrows in which they face?

The latter would obviously require a pak for the images.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

Offline AP

Re: method for finding unconnected tracks
« Reply #13 on: March 02, 2014, 01:31:07 AM »
How about a visual toggle to highlight all the dead ends?

That sounds (a) simple, and (b) very useful.

Offline Lmallet

  • Devotee
  • *
  • Posts: 727
  • Total likes: 10
  • Helpful: 12
  • 128 on the brain...
  • Languages: FR, EN
Re: method for finding unconnected tracks
« Reply #14 on: March 02, 2014, 01:33:48 AM »
How about a visual toggle to highlight all the dead ends?

You beat me to it :).  I take it the ribis are different when something is connected vs. something is not?

Offline isidoro

Re: method for finding unconnected tracks
« Reply #15 on: March 02, 2014, 02:30:11 AM »
I like the idea of highlighting dead ends and arrows for signals.  The second part is even useful when building two one-direction parallel rail tracks.  Sometimes it is difficult to see the direction when placing one-direction signals on curves.


Red_Wraith

  • Guest
Re: method for finding unconnected tracks
« Reply #16 on: July 06, 2014, 08:38:57 PM »
or a visual toggle to replace all signals with arrows in which they face?

I would love that feature. I've already spent too much time debugging signals and trying to see where the signals are. That's especially difficult with monorail tracks which often cover the signals (at least in pak128). If it was possible to temporarily display big arrows on the tracks, that would help a lot.

Offline gauthier

Re: method for finding unconnected tracks
« Reply #17 on: July 06, 2014, 09:58:16 PM »
Building signals "automatically", by keeping mouse button down between two points of the track, avoids such problems on long linear sections at least.

mph1977

  • Guest
Re: method for finding unconnected tracks
« Reply #18 on: August 13, 2014, 04:56:11 PM »
missing electrification can be seen if you open the map view  and click on 'tracks' as  none electrified track is white and electrified track is red ( although it won't show  what type of electrification is present)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: method for finding unconnected tracks
« Reply #19 on: August 13, 2014, 05:31:09 PM »
missing electrification can be seen if you open the map view  and click on 'tracks' as  none electrified track is white and electrified track is red ( although it won't show  what type of electrification is present)

That works for tunnels (I guess), and even some bridges, but perhaps not so much for the occasional tile gap.

Offline Philip

Re: method for finding unconnected tracks
« Reply #20 on: August 13, 2014, 07:02:38 PM »
I like the idea of highlighting dead ends and arrows for signals.  The second part is even useful when building two one-direction parallel rail tracks.  Sometimes it is difficult to see the direction when placing one-direction signals on curves.

Here's a five-minute hack (patch against Experimental) to do something like that, using ASCII text overlays rather than arrow symbols (which has the advantage of making them more visible as you zoom out). To enable the overlays, go into block reservation mode with the B key. Could anyone confirm this is something like what they had in mind? I believe Unicode has characters for diagonal arrows, so we could probably avoid the trouble of adding PAK support...)

I'm not sure I understand what precisely should be indicated for electrification.

Offline gauthier

Re: method for finding unconnected tracks
« Reply #21 on: August 13, 2014, 07:31:07 PM »
This is definitely helpful.

Offline isidoro

Re: method for finding unconnected tracks
« Reply #22 on: August 14, 2014, 12:35:39 AM »
Very nice!  But diagonal arrows would make it look better indeed.

I guess that what was suggested for electrification is marking "dead ends" in the wires, i.e., in a certain point the track can be contiguous, but the electric wires aren't.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: method for finding unconnected tracks
« Reply #23 on: August 14, 2014, 05:00:32 AM »
Here's a five-minute hack (patch against Experimental) to do something like that, using ASCII text overlays rather than arrow symbols (which has the advantage of making them more visible as you zoom out). To enable the overlays, go into block reservation mode with the B key. Could anyone confirm this is something like what they had in mind? I believe Unicode has characters for diagonal arrows, so we could probably avoid the trouble of adding PAK support...)
There will of course will a lot of false positives (the screen shot is nothing but), but I think it might still work. As for Unicode, the font might not contain these symbols. The new font backend being worked on currently might reduce this problem.

I'm not sure I understand what precisely should be indicated for electrification.
Pretty much the same. The exact text can be tweaked later.

Offline Philip

Re: method for finding unconnected tracks
« Reply #24 on: August 14, 2014, 06:42:18 PM »
There will of course will a lot of false positives (the screen shot is nothing but), but I think it might still work.

I'm not a hundred percent sure what would constitute a false positive. This modified version uses red messages only for the common (for me) case of two dead-ends facing each other, pretty much, not for regular dead ends in the middle of a field.

As for Unicode, the font might not contain these symbols. The new font backend being worked on currently might reduce this problem.

Your suspicion is correct. I ended up using fontforge to add diagonal arrows to the BDF file, though the font code also fails to work for fonts with fewer than 256 glyphs some of which still have code points > 256.

(To test this with the Unicode characters, use the attached font file and edit en.tab to include an initial §. It should just fall back to ASCII characters, though).

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: method for finding unconnected tracks
« Reply #25 on: August 15, 2014, 04:52:40 AM »
I'm not a hundred percent sure what would constitute a false positive. This modified version uses red messages only for the common (for me) case of two dead-ends facing each other, pretty much, not for regular dead ends in the middle of a field.

Then you've modified away most of the false positives. It will still generate a few for the map I currently have, but I can't think of any way the game can realize that those dead-ends facing each other are not errors. In fact, when not intentional, they can be one of the most difficult breaks to find in pak64: a platform divided in two.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: method for finding unconnected tracks
« Reply #26 on: August 17, 2014, 09:45:01 PM »
I think I would prefer an arrow graphics overlay; that would point in the right direction and could get a color (depending on the signal state). Theose arrow could be very flimsy in certain ddd box settings.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: method for finding unconnected tracks
« Reply #27 on: August 18, 2014, 04:46:42 AM »
What does signal state have to do with this?

Offline Philip

Re: method for finding unconnected tracks
« Reply #28 on: August 18, 2014, 06:52:28 AM »
I think I would prefer an arrow graphics overlay; that would point in the right direction and could get a color (depending on the signal state). Theose arrow could be very flimsy in certain ddd box settings.

I don't disagree that would be nicer (and I seem to have a problem with the tooltips disappearing in some zoom levels (ETA: I think I've got this tracked down and fixed now)), but I don't know how to go about it. Any hints would be appreciated. Certainly text arrows can also be given a colour, though signal state is usually quite obvious from the reserved blocks, so that's not really necessary.
« Last Edit: August 18, 2014, 11:39:53 AM by Philip »