The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Patches/pull requests for consideration => Topic started by: freddyhayward on January 21, 2021, 02:48:02 AM

Title: Pull request: trains immediately un-request level crossings
Post by: freddyhayward on January 21, 2021, 02:48:02 AM
This pull request (https://github.com/jamespetts/simutrans-extended/pull/348) fixes an issue where trains would immediately un-request level crossings, forcing them to wait for several minutes, sometimes indefinitely, for cars to pass through. It does this by removing one block of code originally added in a bug fix from 2016 that aimed to prevent trains from incorrectly reserving level crossings (https://github.com/jamespetts/simutrans-extended/commit/7cbfbe4721f1d0ba0ca360b28ce6083755857d1c). That commit changed the code in many places, so it is likely that it functions correctly without the removed section - but I unfortunately cannot confirm this. In my opinion, the bug that removing that block of code fixes significantly affects gameplay, so the fix should be merged and we should observe whether it re-introduces incorrect reservations.
Title: Re: Pull request: trains immediately un-request level crossings
Post by: jamespetts on January 21, 2021, 09:21:04 PM
Thank you - now incorporated.
Title: Re: Pull request: trains immediately un-request level crossings
Post by: freddyhayward on January 22, 2021, 09:05:15 AM
Unfortunately, this has caused disruptive behaviour to all diagonal level crossings where cars are trapped inside preventing trains from crossing at all. While these were never an intended feature and could be considered bugs or exploits themselves, they are extensively featured in bridgewater-brunel.
Title: Re: Pull request: trains immediately un-request level crossings
Post by: jamespetts on January 22, 2021, 09:33:22 AM
Thank you for letting me know - now reverted.

I should note that what applies to diagonal level crossings may well also apply to level crossings of double track lines when two trains are passing at once.
Title: Re: Pull request: trains immediately un-request level crossings
Post by: freddyhayward on January 22, 2021, 09:49:04 AM
I should note that what applies to diagonal level crossings may well also apply to level crossings of double track lines when two trains are passing at once.
The issue with diagonal crossings is that cars must traverse several independently operating crossings. Perpendicular crossings of any size do not have this problem because the entire crossing is operated as one. This problem could conceivably be fixed by allowing diagonal crossings to form, but it is only worth doing if it is decided that diagonal crossings are worth supporting in the long-term. In my opinion, they are.
Title: Re: Pull request: trains immediately un-request level crossings
Post by: jamespetts on January 22, 2021, 09:50:55 AM
The issue with diagonal crossings is that cars must traverse several independently operating crossings. Perpendicular crossings of any size do not have this problem because the entire crossing is operated as one. This problem could conceivably be fixed by allowing diagonal crossings to form, but it is only worth doing if it is decided that diagonal crossings are worth supporting in the long-term. In my opinion, they are.

Another feature to join the ever growing list of things that, all other things being equal, it would be good to have one day...
Title: Re: Pull request: trains immediately un-request level crossings
Post by: freddyhayward on January 22, 2021, 09:54:14 AM
Another feature to join the ever growing list of things that, all other things being equal, it would be good to have one day...
In that case, would you mind if I set out to accommodate diagonal crossings in the crossing code? The more challenging part (graphics), can come later.
Title: Re: Pull request: trains immediately un-request level crossings
Post by: jamespetts on January 22, 2021, 10:00:41 AM
In that case, would you mind if I set out to accommodate diagonal crossings in the crossing code? The more challenging part (graphics), can come later.

I certainly do not mind, but I cannot commit any time to producing graphics for this in the foreseeable future.