Page 1 of 1

[0.16.51] Trains on parallel tracks can collide if in the same block

Posted: Tue Jan 22, 2019 4:05 pm
by Syhn
There is a very small window where two trains on S bends directly next to each other can clip the corner of the other. This only happens when they are in the same block as the collision check doesn't happen when they are in different blocks.

Here's what they look like:
in the same block
in different blocks

We found this when experimenting with a signal-less rail network which means every trains is in one giant block. It was hard to track down because of how rarely they clip each other, but easily resolved (move the bends apart) once we found it.

The way trains only check collisions against trains in the same block leads me to believe it was never intended for trains to be able to collide in this way.

Re: [0.16.51] Trains on parallel tracks can collide if in the same block

Posted: Tue Jan 22, 2019 4:40 pm
by Loewchen
It seems to be specifically tailored to do exactly what you consider a bug; preventing unexpected collisions between independent parts of track.

Re: [0.16.51] Trains on parallel tracks can collide if in the same block

Posted: Tue Jan 22, 2019 9:51 pm
by Rseding91
Loewchen wrote: Tue Jan 22, 2019 4:40 pm It seems to be specifically tailored to do exactly what you consider a bug; preventing unexpected collisions between independent parts of track.
Yes it is.

Re: [0.16.51] Trains on parallel tracks can collide if in the same block

Posted: Tue Jan 22, 2019 10:03 pm
by Syhn
Sorry, it appears I wasn't clear on what I considered to be the bug. I expected there to be no difference between collisions in the two scenarios (either the trains collide in both or neither.) The way it is now, simply removing a signal down the line (causing the blocks to merge) would cause trains to suddenly start colliding where they weren't before because they were in different blocks. I understand this is quite a niche situation because it requires trains be the same block which would almost never be the case.

Re: [0.16.51] Trains on parallel tracks can collide if in the same block

Posted: Tue Jan 22, 2019 11:08 pm
by Rseding91
Syhn wrote: Tue Jan 22, 2019 10:03 pm Sorry, it appears I wasn't clear on what I considered to be the bug. I expected there to be no difference between collisions in the two scenarios (either the trains collide in both or neither.) The way it is now, simply removing a signal down the line (causing the blocks to merge) would cause trains to suddenly start colliding where they weren't before because they were in different blocks. I understand this is quite a niche situation because it requires trains be the same block which would almost never be the case.
I'm aware of what you meant but I'm not going to change anything. The train bounding boxes overlap in that setup - that's not going to change. When the rails aren't on the same blocks they're specifically coded to never collide - that's also not going to change.

Therefor, nothing here is going to change.

Re: [0.16.51] Trains on parallel tracks can collide if in the same block

Posted: Wed Jan 23, 2019 1:08 am
by Syhn
Ah, that's fair. I was curious how (or if) this could be fixed. Though I do understand it may not be worth it. Thanks! :P

Re: [0.16.51] Trains on parallel tracks can collide if in the same block

Posted: Tue Nov 12, 2019 11:41 pm
by Syhn
This has since been fixed as a result of 71990 changing the rail bounding boxes slightly.
Screenshot from 2019-11-12 17-21-14.png
Screenshot from 2019-11-12 17-21-14.png (216.9 KiB) Viewed 2402 times