Problem with AI train in the way

Bug #1213165 reported by David Robinson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Rails
Fix Released
Medium
r.roeterdink

Bug Description

I am using the Allegra Add-On to the Glacier Express package from Simtrain.ch. I have tried it in x 1705 and v09 and the result is the same. I have also tried it in MSTS and it works as it should but not in Open Rails.
My train is waiting in Davos Platz station ready to leave on the single track line to Filisur. Another (AI) train arrives at another platford, stop for passengers to get off and then moves forward to park in a siding. To get to the siding it has to move across one of the cross overs my train has to use to get to it's main single track line to Filisur, but part way across it just stops.
My train is given to OK to proceed and a green signal, but if I move forward i go over the same cross over an into the side of the other train.

Revision history for this message
David Robinson (h5djr) wrote :
Revision history for this message
r.roeterdink (r-roeterdink) wrote :

Let's get this one rolling.
Would it be possible to provide the following screen-shots :

1) Similar as the one above, but with traffic reduced to just the AI train which sits in the player's train path.
As it is, there are three AI trains stopped, the train in question could be either of them. I need to know exactly which train it is if I need to get any more info from the system.
If you could take the screenshot so it would show the AI train from the front that would be even more usefull.
Please show the dispatcher info.

2) A screenshot of the path editor window of MSTS Activity Editor showing the path of the AI train at this location - please zoom out so all individual switches etc. are clearly visible. Also select paltform and siding markers but deselect platform and siding names.

Some info : from the dispatcher window shown in the screenshot above, I can see that three AI trains are stopped in a station, the fourth is still moving. For two of these AI trains, that station stop is the last item in their path, the third still has some way to go.
None of the AI train's paths cross the path of the player train, there is no common section on any of these paths.
This is what I can derive from that :
 - option 1: the AI train does not actually go into the siding at all. It is stopped short of the crossing as if to go beyond, but actually terminates there. The AI train path therefor has no overlap with the player train path. Differences in calculating the stop position means that in MSTS the train stops clear of the crossing, but in OR it just runs a bit further and sits faul of the crossing.
 - option 2 : there is no 'real' crossing - just two tracks laid accross one another but no 'cross-over' markers (or the cross-over is invalid due to errors in the tdb - that has the same effect). Therefor, the system sees no crossing and cannot control the trains to keep clear of one another.

The screenshot of the path should make clear what the actual situation is.

Revision history for this message
David Robinson (h5djr) wrote : RE: [Bug 1213165] Re: Problem with AI train in the way
Download full text (4.2 KiB)

Hello Rob

Thanks for your email. Attached are the screenshots that I think show what is happening. The AI train 8P is the one that stops across the points that the Player train needs to cross to join the main line to Filisur. In MSTS the 8P train does not stop across these points but continues into a siding out of the way and the Player train can join the main line.

Some good news - I ran another train in the Glacier Express package yesterday. It was a 2:00hr journey from St Moritz to Chur over the Albula Pass. The route is mostly single track with passing loops at stations and the Player train used a number of these loops to pass other stationary trains and also waiting in some loops for AI trains to pass and all the signals and points worked just as the should.

If you need anything else just let me know. I also have Team View remote control software on my PC so if you did want to connect and run anything on my PC to see what happens I would quite happy with that.

Kind regards

Dave

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of r.roeterdink
Sent: 26 August 2013 09:46
To: <email address hidden>
Subject: [Bug 1213165] Re: Problem with AI train in the way

Let's get this one rolling.
Would it be possible to provide the following screen-shots :

1) Similar as the one above, but with traffic reduced to just the AI train which sits in the player's train path.
As it is, there are three AI trains stopped, the train in question could be either of them. I need to know exactly which train it is if I need to get any more info from the system.
If you could take the screenshot so it would show the AI train from the front that would be even more usefull.
Please show the dispatcher info.

2) A screenshot of the path editor window of MSTS Activity Editor showing the path of the AI train at this location - please zoom out so all individual switches etc. are clearly visible. Also select paltform and siding markers but deselect platform and siding names.

Some info : from the dispatcher window shown in the screenshot above, I can see that three AI trains are stopped in a station, the fourth is still moving. For two of these AI trains, that station stop is the last item in their path, the third still has some way to go.
None of the AI train's paths cross the path of the player train, there is no common section on any of these paths.
This is what I can derive from that :
 - option 1: the AI train does not actually go into the siding at all. It is stopped short of the crossing as if to go beyond, but actually terminates there. The AI train path therefor has no overlap with the player train path. Differences in calculating the stop position means that in MSTS the train stops clear of the crossing, but in OR it just runs a bit further and sits faul of the crossing.
 - option 2 : there is no 'real' crossing - just two tracks laid accross one another but no 'cross-over' markers (or the cross-over is invalid due to errors in the tdb - that has the same effect). Therefor, the system sees no crossing and cannot control the trains to keep clear of one another.

The screenshot of the path should make clear what th...

Read more...

Revision history for this message
r.roeterdink (r-roeterdink) wrote :

Well, each screenshot only adds to the confusion here. The position where the trains are and the information in the Dispatcher Info simply do not match at all. It almost seems as if the train is just completely in the wrong position.
But lets try to get some more info out of the system.
Attached is a special test version of run_activity.exe. To run this, backup the existing version and replace it with this test-version.
This contains two test facilities.
First, it contains a trial version for the Dispatcher Control Window. This shows the track occupation and reservation based on the actual TrackCircuitSection database, this is the data which controls the signalling and AI train control.
Could you please take a screenshot from the Dispatcher Control Window, at the moment the passenger train is ready to depart and the AI blocks the switch? Use CTRL-9 to open the Dispatcher Window. Please set the scale in such a way that the window shows both trains (player train = train 0, AI = train 3), and also the end of the siding where the AI is supposed to go.
Further, this version outputs a series of test data files. These is both static data - build-up of signalling and trackcircuitsection database, as well as the train routes. It also dumps dynamic data - all actions taken by trains, on a high level for all trains but on a very detailed level for one selected train - in this case the selected train is train 3, the AI train.
All output is send to directory C:\temp, so please ensure this directory exists. Also, if you have to run this version more than once, then please remove all files from C:\temp before restarting. Not all files are cleared when the program starts.
If you then can please send me the screenshot plus all files from C:\temp, I can have a further look at what is happening.
Thanks.

Revision history for this message
David Robinson (h5djr) wrote :
Download full text (3.3 KiB)

Hello Rob

I assume by run_activity.exe you means RunActivity.exe in the Open Rails\Program directory as I don't seem to have a run_activity.exe anywhere on my PC. Also you a special version of that file is attached for me to run but there was no attachment to the email.

David

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of r.roeterdink
Sent: 27 August 2013 18:08
To: <email address hidden>
Subject: [Bug 1213165] Re: Problem with AI train in the way

Well, each screenshot only adds to the confusion here. The position where the trains are and the information in the Dispatcher Info simply do not match at all. It almost seems as if the train is just completely in the wrong position.
But lets try to get some more info out of the system.
Attached is a special test version of run_activity.exe. To run this, backup the existing version and replace it with this test-version.
This contains two test facilities.
First, it contains a trial version for the Dispatcher Control Window. This shows the track occupation and reservation based on the actual TrackCircuitSection database, this is the data which controls the signalling and AI train control.
Could you please take a screenshot from the Dispatcher Control Window, at the moment the passenger train is ready to depart and the AI blocks the switch? Use CTRL-9 to open the Dispatcher Window. Please set the scale in such a way that the window shows both trains (player train = train 0, AI = train 3), and also the end of the siding where the AI is supposed to go.
Further, this version outputs a series of test data files. These is both static data - build-up of signalling and trackcircuitsection database, as well as the train routes. It also dumps dynamic data - all actions taken by trains, on a high level for all trains but on a very detailed level for one selected train - in this case the selected train is train 3, the AI train.
All output is send to directory C:\temp, so please ensure this directory exists. Also, if you have to run this version more than once, then please remove all files from C:\temp before restarting. Not all files are cleared when the program starts.
If you then can please send me the screenshot plus all files from C:\temp, I can have a further look at what is happening.
Thanks.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1213165

Title:
  Problem with AI train in the way

Status in Open Rails Tracker:
  New

Bug description:
  I am using the Allegra Add-On to the Glacier Express package from Simtrain.ch. I have tried it in x 1705 and v09 and the result is the same. I have also tried it in MSTS and it works as it should but not in Open Rails.
  My train is waiting in Davos Platz station ready to leave on the single track line to Filisur. Another (AI) train arrives at another platford, stop for passengers to get off and then moves forward to park in a siding. To get to the siding it has to move across one of the cross overs my train has to use to get to it's main single track line to Filisur, but part way across it just stops.
  My train is given to OK to proceed and ...

Read more...

Revision history for this message
r.roeterdink (r-roeterdink) wrote :

Ooops - sorry about that. Here is the RunActivity.exe (ehh, yes, that's what I meant ...)

Revision history for this message
David Robinson (h5djr) wrote :

Hi

I have now run the RunActivity.exe file. Ataached are the two screen shots as Word files. I will send the other files in another email as the one I send with all the files in was too large are was blocked.

Regards

David

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of r.roeterdink
Sent: 27 August 2013 19:29
To: <email address hidden>
Subject: [Bug 1213165] Re: Problem with AI train in the way

Ooops - sorry about that. Here is the RunActivity.exe (ehh, yes, that's what I meant ...)

** Attachment added: "RunActivity.zip"
   https://bugs.launchpad.net/or/+bug/1213165/+attachment/3790476/+files/RunActivity.zip

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1213165

Title:
  Problem with AI train in the way

Status in Open Rails Tracker:
  New

Bug description:
  I am using the Allegra Add-On to the Glacier Express package from Simtrain.ch. I have tried it in x 1705 and v09 and the result is the same. I have also tried it in MSTS and it works as it should but not in Open Rails.
  My train is waiting in Davos Platz station ready to leave on the single track line to Filisur. Another (AI) train arrives at another platford, stop for passengers to get off and then moves forward to park in a siding. To get to the siding it has to move across one of the cross overs my train has to use to get to it's main single track line to Filisur, but part way across it just stops.
  My train is given to OK to proceed and a green signal, but if I move forward i go over the same cross over an into the side of the other train.

To manage notifications about this bug go to:
https://bugs.launchpad.net/or/+bug/1213165/+subscriptions

Revision history for this message
David Robinson (h5djr) wrote :

Here are the second batch of files - zipped up with WinRAR

David

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of r.roeterdink
Sent: 27 August 2013 19:29
To: <email address hidden>
Subject: [Bug 1213165] Re: Problem with AI train in the way

Ooops - sorry about that. Here is the RunActivity.exe (ehh, yes, that's what I meant ...)

** Attachment added: "RunActivity.zip"
   https://bugs.launchpad.net/or/+bug/1213165/+attachment/3790476/+files/RunActivity.zip

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1213165

Title:
  Problem with AI train in the way

Status in Open Rails Tracker:
  New

Bug description:
  I am using the Allegra Add-On to the Glacier Express package from Simtrain.ch. I have tried it in x 1705 and v09 and the result is the same. I have also tried it in MSTS and it works as it should but not in Open Rails.
  My train is waiting in Davos Platz station ready to leave on the single track line to Filisur. Another (AI) train arrives at another platford, stop for passengers to get off and then moves forward to park in a siding. To get to the siding it has to move across one of the cross overs my train has to use to get to it's main single track line to Filisur, but part way across it just stops.
  My train is given to OK to proceed and a green signal, but if I move forward i go over the same cross over an into the side of the other train.

To manage notifications about this bug go to:
https://bugs.launchpad.net/or/+bug/1213165/+subscriptions

Revision history for this message
r.roeterdink (r-roeterdink) wrote :
Download full text (3.5 KiB)

Thanks - now it's beginning to make some sense.
The AI train has a reverse point in the sidings and, at the moment of the screenshots, has actually reversed - so it is heading away from the crossing, and that is why there is no overlap between the AI path and the player path. But the train is indeed in the wrong location. I will try to explain.

So, this is what is defined for the AI train.
It stops at the station, then runs to the siding where it reverses, heads back to the station and has another station stop.

This is how it works in MSTS.
The train stops at the station, runs to the siding and will run up to the point where the front of the train passes the reversal point. At that moment, the rear of the train has cleared the crossing, and the route is released for the player train. The AI train waits in the siding until the player train has cleared the crossing, and then reverses into the station for the second stop.

This is how it works in OR - and how it should work.
The train stops at the station, and then runs to the siding. Unlike in MSTS, in OR it is not necesarry for the train to run as far as the actual reversal point. Based on the actual 'diverging' point (where incoming and outgoing routes 'split'), the actual reversal point and any signals inbetween and beyond the reversal point, a fairly complex algorithm is used to determine to actual point where the train will stop and reverse. In this situation, as there are no signals involved, the train will reverse just clear of the 'diverging' point.
Now, bad luck has crept in here, for this reversal point puts the front of the train just short of the first switch of the crossing with the player train, but still within the overlap for this switch. But when the AI train reverses, track occupation etc. is reset and in this process, the overlap is not taken into account. So the switch is not occupied by the AI train, and the system clears the route for the player train. This is not quite correct - more on that later. It is not the main cause of the problem, though.
The main problem is what happens next. The train has reversed, is still stopped, and the system now checks if it is allready in the next station. And here is where things went wrong. A very small error (>= instead of <=) caused the system to assume the train is in the station, and activated the station stop - but is in, in fact, still 300m short of the station. Even when the station stop time has expired, the train does not depart as the exit signal for the station is at danger - a train is not allowed to depart from a station if the exit signal is at danger. So the train remains stopped.
I have corrected this error, so the train should now reverse and head back into the station, clearing the path for the player train.
So please try the attached version. I still have left the debug output switched on just in case it still not runs as expected.

As for the overlap protection - that is quite complicated, and I will have to think of a proper way of dealing with that. It is likely to be a rather extensive change of code and may take quite a while before this is done. With the station stop in the correct location, it should no longe...

Read more...

Revision history for this message
David Robinson (h5djr) wrote :
Download full text (5.7 KiB)

Hi Rob

Thanks very much for the amended version. It works just as it should. The AI train arrives in the platform. It then moves forward over the switch and then reverses back into a different platform ready for it's return journey, clearing the switch for the player train. The signal gives the player train the OK to leave and it moves forward, crosses several tracks on to the main single track route and leaves for Filisur. I have run it all the way to Filisur and it waits in a two loops for other AI trains coming in the opposite direction. As soon as these have entered the loop the signals change and the player trains is free to leave.

It's amazing the difference a small change to the program can make.

Thanks again. I will now try the new versaion with some of the other routes and see what happens with them.

Regards

David

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of r.roeterdink
Sent: 28 August 2013 12:03
To: <email address hidden>
Subject: [Bug 1213165] Re: Problem with AI train in the way

Thanks - now it's beginning to make some sense.
The AI train has a reverse point in the sidings and, at the moment of the screenshots, has actually reversed - so it is heading away from the crossing, and that is why there is no overlap between the AI path and the player path. But the train is indeed in the wrong location. I will try to explain.

So, this is what is defined for the AI train.
It stops at the station, then runs to the siding where it reverses, heads back to the station and has another station stop.

This is how it works in MSTS.
The train stops at the station, runs to the siding and will run up to the point where the front of the train passes the reversal point. At that moment, the rear of the train has cleared the crossing, and the route is released for the player train. The AI train waits in the siding until the player train has cleared the crossing, and then reverses into the station for the second stop.

This is how it works in OR - and how it should work.
The train stops at the station, and then runs to the siding. Unlike in MSTS, in OR it is not necesarry for the train to run as far as the actual reversal point. Based on the actual 'diverging' point (where incoming and outgoing routes 'split'), the actual reversal point and any signals inbetween and beyond the reversal point, a fairly complex algorithm is used to determine to actual point where the train will stop and reverse. In this situation, as there are no signals involved, the train will reverse just clear of the 'diverging' point.
Now, bad luck has crept in here, for this reversal point puts the front of the train just short of the first switch of the crossing with the player train, but still within the overlap for this switch. But when the AI train reverses, track occupation etc. is reset and in this process, the overlap is not taken into account. So the switch is not occupied by the AI train, and the system clears the route for the player train. This is not quite correct - more on that later. It is not the main cause of the problem, though.
The main problem is what happens next. The train has reversed, is still st...

Read more...

Revision history for this message
r.roeterdink (r-roeterdink) wrote :

OK - that's good.
The attached version is the same patch but without the debug output - that runs a bit better.
I will commit the patch to the official version tomorrow.

Changed in or:
status: New → In Progress
assignee: nobody → r.roeterdink (r-roeterdink)
James Ross (twpol)
Changed in or:
importance: Undecided → Medium
Changed in or:
status: In Progress → Fix Committed
James Ross (twpol)
Changed in or:
milestone: none → 1.0
James Ross (twpol)
Changed in or:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.