Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trains crash at certain circumstances #1030

Closed
DorpsGek opened this issue Jul 12, 2007 · 9 comments
Closed

Trains crash at certain circumstances #1030

DorpsGek opened this issue Jul 12, 2007 · 9 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

dannys9 opened the ticket and wrote:

Given the following track layout: multiple platform terminus station - bridges - crossing tracks with depot, using pre-signals. Both trains directing to the same station, the first drives into the depot, while in there, the other one services the station. When the first train leaves the depot, both exit signals switch to green, so the second train crashes with the first one in the station. It does not happen if there's only 'plain' track between depot and station, i.e. no bridges.

In the attached savegame you can simulate this behaviour. Train 1 will go to depot. Make sure train 2 passes the crossing while train 1 is still in the depot (however, don't stop it there; it must be scheduled or for maintainance, forced depot stops won't show the bug).

Using r10532 with no newgrfs. I guess, it might be r10513 that introduced this.

Attachments

Reported version: trunk
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/1030
@DorpsGek
Copy link
Member Author

SmatZ wrote:

Simplified testcase attached. First appeared it r10111. May be present in older releases, but doesn't show in this testcase.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1593

@DorpsGek
Copy link
Member Author

SmatZ wrote:

Attached fix. SignalVehicleCheck() uses VehicleFromPos(), but there is check for v->tile==tile, while that check is illegal. Removing this check solves this problem. The r10111 patch didn't remove any other v->tile==tile in *Proc checks, so this should work.
(the original gui.diff sems not to have this problem, but it uses a bit different approach)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1595

@DorpsGek
Copy link
Member Author

dannys9 wrote:

These seem to be two different bugs, though they depend on each other. I've checked the revisions. Your testcase, smatz, shows in revisions earlier than 10513, my one definitely shows beginning with 10513. Your diff fixes both :-) Thanks for your help.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1596

@DorpsGek
Copy link
Member Author

SmatZ wrote:

I am sorry, I had hard time to reproduce your bug - trains crashed maybe three times in 100 tries - maybe I did something wrong. But I though the reduced testcase is the same.

Peter will probably look over this patch and whole r10111 - I didn't have time to check anything and that is not good...


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1598

@DorpsGek
Copy link
Member Author

dannys9 wrote:

Yes, I know. For some reason, yesterday I could produce the crash everytime I tried, now I'm having the same "problems" :-/
I've attached a savegame, where the crash happens within gameplay without any interaction - everytime! Watch trains 43 and 44.
This savegame uses the following grf's: newstatsw, cargosetw, PlaneSetw, generictrams_v03_151, pb_viaduct in data/newgrf.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1599

@DorpsGek
Copy link
Member Author

SmatZ wrote:

Nice testcase - there it was introduced in r10513. Hopefully another.diff fixes this. (anyway, the whole behavior is a bit strange - why does the train leaving depot affect signal in opposite direction?)


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1600

@DorpsGek
Copy link
Member Author

dannys9 wrote:

After playing for some time with your patch applied, I would say, it fixes the bug and causes no other strange things.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1624

@DorpsGek
Copy link
Member Author

peter1138 wrote:

This patch reverts the cause of this bug (r10513) and adds special cases for collision detection on bridges/tunnels and also means the signal checking stuff only needs to check the bridge/tunnel ends, not each tile in between.

While collision detection on bridges/tunnel now involves two lookups, removing the tile check as in "another.diff" incurs its own performance penalty for every lookup.

Testing is appreciated.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030#comment1729

@DorpsGek
Copy link
Member Author

peter1138 closed the ticket.

Reason for closing: Fixed

in r10734


This comment was imported from FlySpray: https://bugs.openttd.org/task/1030

@DorpsGek DorpsGek added Bridge flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant