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

x/y location of wagons outside of wagons #3569

Closed
DorpsGek opened this issue Jan 25, 2010 · 15 comments
Closed

x/y location of wagons outside of wagons #3569

DorpsGek opened this issue Jan 25, 2010 · 15 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Yexo opened the ticket and wrote:

Open the attached savegame, start the train in the red depot and fastforward a few days. The red train and the purple one will crash.

Attachments

Reported version: trunk
Operating system: All


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

frosch wrote:

Most likely caused by FindTrainCollideEnum not considering wagonlength. For short wagons v->x_pos and v->y_pos are actually "outside" the wagon.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7462

@DorpsGek
Copy link
Member Author

SmatZ wrote:

I think the reason is that trains now stop at the very end of the station, not few "ticks" before it. It was change because someone complained that trains didn't fit inside station, while they should.
A bit modified savegame is attached. I wasn't able to reproduce it with normal wagon lengths though.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7463

@DorpsGek
Copy link
Member Author

SmatZ wrote:

Indeed, r14526 is most likely the cause.

In this case, both vehicles have length 6.

Specifically:
- if (!signal && x + 4 >= TILE_SIZE) {
+ if (!signal && x + (v->u.rail.cached_veh_length + 1) / 2 >= TILE_SIZE) {
// (v->u.rail.cached_veh_length + 1) / 2 == 3, originally 4

Short train leaving the depot is allowed to go nearer to the line end.

+ int stop = TILE_SIZE - (v->u.rail.cached_veh_length + 1) / 2;
// stop == 16 - 3 = 13, originally 12

Short train entering the station is allowed to stop further.

So: distance <= 5 --> BOOM


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7466

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 6, 2010

Rubidium wrote:

Possible solution to the problem.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7532

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 6, 2010

frosch wrote:

different testcase

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7542

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 8, 2010

SmatZ wrote:

fs3569test.sav (14.8 KiB)
If I understand it correctly, train cannot get to that place without removing the track it just left. If that's the case, it can be ignored - one can get train "to the last subtile coordinate" and then remove the track in front of it. That case is too artificial.
If it's not the case, eg. it can be reached with removing any track, it's valid.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7561

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 8, 2010

SmatZ wrote:

Also, I think it's correct when train crash in this case. There has to be a cooperation between players to do that (or one has to have a dead-end diagonal track).
Still it won't allow crashing trains loading at stations. If we wanted to prevent all cases, simple check for same owner would be better.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7562

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 8, 2010

frosch wrote:

Simple testgrf providing vehicles in all lengths. No nice graphics though.
(Start game around 1925 or never retire engines.)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7563

@DorpsGek
Copy link
Member Author

peter1138 wrote:

SmatZ, it's never correct that you can crash other's trains.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7577

@DorpsGek
Copy link
Member Author

Rubidium wrote:

A simple fix has been committed to 1.0 in r19144. The proper fix consists of redoing the location of vehicles.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment7602

@DorpsGek
Copy link
Member Author

Rubidium wrote:

In r21800 the major issue for multiplayer got fixed in trunk as well (merge of 1.0 branch fix). To see the trains crashing you'll need to revert that diff.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment9465

@DorpsGek
Copy link
Member Author

frosch wrote:

#4628 shows another effect which has not been mentioned explicitly in this task yet. When the last wagon of a train is shorter than 4/8, the train might not fit into stations though the length in the depot says so (while the depot is actually right).

The last wagon being outside the station causes PBS reservations to stay and might block junctions, and of course the loading time penalty kicks in.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment9972

@DorpsGek
Copy link
Member Author

Chris_Booth wrote:

Comment by Vaclav Benc (V453000) - Saturday, 28 May 2011, 16:24 GMT
Another interesting thing is, that when the counter says 2.0 for some trains such as for example this eh40 with copper ore wagons of tropic refurbishment set,
the trains do fit in stations, but they slow down on curves where "normal" trains long 2.0 do not slow down.
Note: the same happened with the older depot counter.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment9973

@DorpsGek
Copy link
Member Author

Chris_Booth wrote:

that is also noted in FS 4628


This comment was imported from FlySpray: https://bugs.openttd.org/task/3569#comment9974

@DorpsGek
Copy link
Member Author

michi_cc closed the ticket.

Reason for closing: Fixed

Hopefully finally fixed in r23290. This is re-fixing #2379 as well.


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

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 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