Close adjacent level crossings

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Close adjacent level crossings

Post by FooBar »

Thanks for the binary, Zuu. I'll try this out later with some savegames I have sitting around with loads of road vehicles.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Close adjacent level crossings

Post by FooBar »

Zuu wrote:Here is a windows 32bit binary. Hope it helps for anyone who want to try out this patch and provide feedback to Eddi.
Finally found some time to give this a whirl, only to find out the zip doesn't include an executable...
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Close adjacent level crossings

Post by Zuu »

FooBar wrote:
Zuu wrote:Here is a windows 32bit binary. Hope it helps for anyone who want to try out this patch and provide feedback to Eddi.
Finally found some time to give this a whirl, only to find out the zip doesn't include an executable...
I'm sorry for the trouble that I've caused you. Thanks for telling me about the issue. I've replaced the zip file with a new one that now includes the exe file. (I have to add it manually as I can't execute the msvc makefile in my cygwin environment)

Interesting enough there was already 8 downloads of the file when I replaced it.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Close adjacent level crossings

Post by FooBar »

No worries, no harm done :)
This one works fine (in starting that is), thank you.

As for the patch itself: it handles existing savegames fine. Only I'm starting to doubt whether this is the best solution. Observe the following screenshot: the road vehicle entered the level crossing when there was no train. Although by the time it gets to the other side, a train has appeared and the road vehicle will just carry on and crash into it.
Untitled-1.png
Untitled-1.png (20.24 KiB) Viewed 5824 times
With the old behaviour, the road vehicle would have stopped on the now clear track and no harm done.
Of course, with some careful (path) signal placement you can work around this very nicely in order to close the crossing enough in advance. But older savegames don't have such in place.

In conclusion, I still like the patch and the possibilities it provides. But it's not something that should be enabled by default in existing savegames. So for trunk inclusion I think this has to become an advanced setting.

What also would be nice is to only have crossing lights at the beginning and end of the crossing, like in the quick mockup below. Now this is not possible with the default level crossings, but it is possible for railtypes. For railtypes, the crossing lights are separate sprites. This should then probably come with an additional rail type flag that allows railtype authors to choose what behaviour they would like to see.
Attachments
Untitled-2.png
Untitled-2.png (16.09 KiB) Viewed 5824 times
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Close adjacent level crossings

Post by Eddi »

i agree with both of these statements, but adding a setting is unweildy before it is merged. changing the drawing of the default crossing is possible, with the help of some rail overlay sprites, but this breaks the method of Action A replacement of level crossing sprites, like in the DBSetXL, or Action A track sprite replacement, like transrapid tracks or narrow gauge/"fine scale" tracks.

i recently looked into updating the old "diagonal crossings" patch. (wait. did i just say this outloud?) the code part of this works fine, but the drawing part needs to be revamped, and probably rely on breaking the things mentioned above.
Last edited by Eddi on 01 Aug 2011 21:45, edited 1 time in total.
User avatar
Level Crossing
Tycoon
Tycoon
Posts: 1187
Joined: 07 Feb 2011 22:04
Location: East Coast, United States

Re: Close adjacent level crossings

Post by Level Crossing »

A possible solution would be to only stop if the vehicle detects that the next track has a train on it (this is detectable, right?)
Like my avatar? See my screenshot thread
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Close adjacent level crossings

Post by Eddi »

Level Crossing wrote:A possible solution would be to only stop if the vehicle detects that the next track has a train on it (this is detectable, right?)
not in a sensible way...
Lockwood
Engineer
Engineer
Posts: 57
Joined: 14 Aug 2005 17:24

Re: Close adjacent level crossings

Post by Lockwood »

Was my previous suggestion wrt an RV possessing the track close to possible?
User avatar
Level Crossing
Tycoon
Tycoon
Posts: 1187
Joined: 07 Feb 2011 22:04
Location: East Coast, United States

Re: Close adjacent level crossings

Post by Level Crossing »

Lockwood wrote:Was my previous suggestion wrt an RV possessing the track close to possible?
That's quite unrealistic. Besides, it would make abuse overly easy (e.g. block train tracks by building a crossing and spamming trucks).
Like my avatar? See my screenshot thread
Lockwood
Engineer
Engineer
Posts: 57
Joined: 14 Aug 2005 17:24

Re: Close adjacent level crossings

Post by Lockwood »

Level Crossing wrote:
Lockwood wrote:Was my previous suggestion wrt an RV possessing the track close to possible?
That's quite unrealistic. Besides, it would make abuse overly easy (e.g. block train tracks by building a crossing and spamming trucks).
Is it? Is it really?
I'm sure I've seen informations about levelcrossings that are remotely monitored, the implication being that if the crossing were not clear the signalman would set the signal aheadof it to danger to prevent a collision.
TERdON
Engineer
Engineer
Posts: 90
Joined: 09 Nov 2010 15:30

Re: Close adjacent level crossings

Post by TERdON »

Well, I guess in those cases, the crossing would be closed for new trucks to enter, but would still let old vehicles leave. It's actually quite a common system at high-speed level crossings, at least in Sweden. Of course, to avoid the problem of trucks actually hitting the train, you would have to make sure the truck reserves all tiles up until completely leaving the crossing, not only the one it's currently occupying (between - this behaviour could potentially be dependant on railtype if using NuTracks - where only e.g. > 100 km/h track would have this behavior, since lower-speed track usually don't have vehicle detection at the crossings.)

There still is room for abuse - consider for example the case where you have two successive level crossings close to each other, but with at least one tile in between. Then a train on the second track could cause a pile-up of trucks, blocking the crossing for trains indefinitely. But there are many other similar sources for abuse (just the other way around, e.g. block the road with your truck next to a crossing, send an train engine to demolish your competitors road vehicles...
Lockwood
Engineer
Engineer
Posts: 57
Joined: 14 Aug 2005 17:24

Re: Close adjacent level crossings

Post by Lockwood »

I set up a snaking track in a game vs AI.
My track tried to cross every single "enemy" road.
One PBS signal, one engine, 30 crossings closed at once.

Griefers gonna grief however you set up crossings.
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Close adjacent level crossings

Post by Eddi »

Lockwood wrote:Was my previous suggestion wrt an RV possessing the track close to possible?
let's cut this short, i will not implement this. there are too many problems with it, both conceptionally and technically.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Close adjacent level crossings

Post by Leanden »

Could you not have RVs "reserve" the crossing, so trains cannot pass over it while an RV is crossing the level crossing sections. Of course trains have priority but the vehicles on the crossing have enough time to leave the other side while the train waits.
Image
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Close adjacent level crossings

Post by Eddi »

no. if at all, only broken down trucks would block the crossing. regular trucks would be assumed to leave the crossing in time, if they can't, it's the player's fault.
User avatar
Level Crossing
Tycoon
Tycoon
Posts: 1187
Joined: 07 Feb 2011 22:04
Location: East Coast, United States

Re: Close adjacent level crossings

Post by Level Crossing »

How about this:

Instead of having two level crossing 'states' (open, closed) have three (open, fake closed, real closed). When a train approaches a level crossing, the track it is on changes to 'real closed', which prevents RVs from entering the track. Other tracks are 'fake closed', where only vehicles that are already in the crossing are allowed to proceed.

Is this feasible?
Like my avatar? See my screenshot thread
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Close adjacent level crossings

Post by Eddi »

it's a little tricky, because level crossings are one of the tiles that have almost all bits in the map array used.
User avatar
kyosuke1989
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 24 Mar 2008 13:04
Location: Finland

Re: Close adjacent level crossings

Post by kyosuke1989 »

When the new map array is introduced in form of more height levels, that could help in this?
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Close adjacent level crossings

Post by Eddi »

not at all.
User avatar
doxlulzem
Traffic Manager
Traffic Manager
Posts: 161
Joined: 05 Mar 2014 21:44
Skype: carl.stonehouse1
Location: Teesside, North Yorkshire

Re: Close adjacent level crossings

Post by doxlulzem »

I know I sound like a reeeaaalllll noob, but where do you put the .diff, and will it change the level crossings in existing savegames?
IJN Takao is life. Why did the Shinano get converted? Gotta love NeuroTec for Garry's Mod. I even have a server!
How Can Mirrors Be Real If Our Eyes Aren't Real? - Jaden Smith 2014
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest