Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Jun 23, 2018 11:54 am

All times are UTC




Post new topic  Reply to topic  [ 40 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Thu Jun 14, 2018 1:59 pm 
Offline
Engineer
Engineer

Joined: Sun Oct 02, 2011 6:56 pm
Posts: 83
New thread for shunting/coupling/decoupling feature.

How it works?
Decoupling is done in station, train simply leave some or all of its wagons in station.
Coupling is done in station too. There needs to be train in station waiting for engine. And there needs to be train close to station (max 1 pbs signal far) that is looking for train. The train outside the station will find its way to other train and they will couple.


Known issues
NPF is not supported yet.
It works fine with current reversing system, altho patch for realistic reversing would add more shunting options.
Block signals are not supported for coupling operation.
There are graphical incosistencies in advanced trains NewGRFs when performing decoupling/coupling.
Orders for second part of train should be handled better.
Cargodist is not supported yet, it's connected to better orders handling and maybe reversing.
Checks for number of trains and length of trains.

source code available at github https://github.com/Palo123/OpenTTD-YPS/tree/Decouple


Attachments:
File comment: 0.6 -> 0.7 changes: Feature - filter trains to couple by number of units
openttd_decouple_0.7_win32.zip [7.6 MiB]
Downloaded 272 times


Last edited by Karn on Sat Jun 16, 2018 9:09 pm, edited 3 times in total.
Top
   
PostPosted: Thu Jun 14, 2018 2:58 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon May 25, 2015 9:09 am
Posts: 262
Location: The Netherlands
Ooh. This is pretty cool.

_________________
No pics no clicks. Seriously.
ImageImageImage


Top
   
PostPosted: Thu Jun 14, 2018 6:55 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Jan 08, 2003 11:09 pm
Posts: 347
Location: Denmark
Regarding orders for the left-behind part, the best solution I can think of would involve a way to have "orphan" shared orders lists, which you can name. In fact decoupling "routes" from vehicles. (Similar to how it's done in Transport Fever.) When you have a named orders list, you can then insert an additional flag on the decouple order, "other half begins executing orders list B from position Y".


Top
   
PostPosted: Fri Jun 15, 2018 12:07 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 09, 2008 4:20 pm
Posts: 2131
Skype: yes
Location: Slovakia
cap'n, my train blew up again


Attachments:
ooofowie.zip [1.29 MiB]
Downloaded 10 times

_________________
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
Top
   
PostPosted: Fri Jun 15, 2018 3:37 am 
Offline
Engineer
Engineer

Joined: Sat Sep 27, 2014 5:16 am
Posts: 46
Location: Calgary, Canada
Hubba hubba. :bow:

Nice implementation, I like how you can get a locomotive close to the wagons and just have it couple back up. I can see how a patch to change reversing behaviour would compliment this.


Attachments:
OTTDShunt.gif
OTTDShunt.gif [ 485.41 KiB | Viewed 777 times ]


Last edited by le_harv on Fri Jun 15, 2018 4:05 am, edited 1 time in total.
Top
   
PostPosted: Fri Jun 15, 2018 4:01 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 28, 2003 6:52 pm
Posts: 1182
Thanks for the update! You might want to put your GitHub address as well: not everybody uses Windows ;)

I've tested your patch again, and I think it's brilliant. It works correctly so far, refusing to decouple those wagons that would change length as a result of being detached from their engine.
Also, I seem to understand you're already checking for attachment rules, and preventing two "uncompatible" consists from coupling? If so, it's really neat.

I've found that your patch works wonderfully together with my own way to do "push-pull" (i.e. swapping the graphics across wagons). It gives a very realistic final result, if not for the wagons changing graphics right upon decoupling and coupling (when they revert back to their default status). To correct for that, we'd need to enhance OTTD itself.


Now, I have a question about something that happened in my game. I sent a train composed by a coupling of 2 MUs to a station, then decoupled it, and ordered its former "head" to go to a depot. Then, I ordered another train of the same type to go pick up the decoupled half of the first, still waiting at the station.
The situation is as it appears on this picture:

Attachment:
coupling question0.png
coupling question0.png [ 50.03 KiB | Viewed 778 times ]


* Train 2 is the decoupled half of the initial train; it's patiently waiting at the station;
* Train 3 is just outside of the station and has "Couple Any Train" as its order.

Now, as you can see, the signal in front of Train 3 is red, because Train 2 is waiting at the station. Because of this, Train 3 won't start. However, shouldn't it rather ignore the signal, advance at a low speed, and couple with Train 2? I can't understand why it's waiting instead...
I have to manually force the train to ignore the signal. When I do, Train 3 behaves exactly as it's supposed to: it advances, couples with Train 2, and then drives off.

Perhaps this thing of ignoring the signal should be automated. Would you need me to post a savegame or anything else to help you out with this?


Top
   
PostPosted: Fri Jun 15, 2018 4:32 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 28, 2003 6:52 pm
Posts: 1182
le_harv wrote:
Hubba hubba. :bow:

Nice implementation, I like how you can get a locomotive close to the wagons and just have it couple back up. I can see how a patch to change reversing behaviour would compliment this.

Reversing can be implemented in a trainset. The one I'm developing does it, and works very well with this patch:


Attachment:
File comment: Train entering the station with mail van (white-red) in the head, with the locomotive boiler-forward...
ng decouple 1of3 small.png
ng decouple 1of3 small.png [ 49.06 KiB | Viewed 767 times ]

Attachment:
File comment: ... then the locomotive runs around it, cab-forward... (too bad the graphics of the wagons temporariliy change)
ng decouple 2of3 small.png
ng decouple 2of3 small.png [ 37.4 KiB | Viewed 767 times ]

Attachment:
File comment: ... then it couples the consist and drives away; the locomotive is cab-forward, and the consist has the mail van in the tail
ng decouple 3of3 small.png
ng decouple 3of3 small.png [ 46.58 KiB | Viewed 767 times ]


Top
   
PostPosted: Fri Jun 15, 2018 4:38 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 09, 2008 4:20 pm
Posts: 2131
Skype: yes
Location: Slovakia
I think he meant like, full train reversing. That'd be quite useful for stitching multiple trains together (there's probably a better term for this).

_________________
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury


Top
   
PostPosted: Fri Jun 15, 2018 4:39 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5186
Snail wrote:
Train 3 won't start. However, shouldn't it rather ignore the signal, advance at a low speed, and couple with Train 2? I can't understand why it's waiting instead...

Karn, I have the same problem. Sometimes ignoring the signal works, sometimes the coupling locomotive "waits for free path", without any reason I can see. I´m using all 2-directional path signals for the layout shown in the original thread:

viewtopic.php?p=1208457#p1208457

regards
Michael

_________________
Image


Top
   
PostPosted: Fri Jun 15, 2018 7:25 am 
Offline
Engineer
Engineer

Joined: Sun Oct 02, 2011 6:56 pm
Posts: 83
Drury wrote:
cap'n, my train blew up again

Interesting bug, thanks for reporting.
Btw you can save the train by stopping and starting or reversing locomotive before coupling :D
Edit: nvm, it's fixed now

Snail wrote:
* Train 2 is the decoupled half of the initial train; it's patiently waiting at the station;
* Train 3 is just outside of the station and has "Couple Any Train" as its order.

Now, as you can see, the signal in front of Train 3 is red, because Train 2 is waiting at the station. Because of this, Train 3 won't start. However, shouldn't it rather ignore the signal, advance at a low speed, and couple with Train 2? I can't understand why it's waiting instead...
I have to manually force the train to ignore the signal. When I do, Train 3 behaves exactly as it's supposed to: it advances, couples with Train 2, and then drives off.

Perhaps this thing of ignoring the signal should be automated. Would you need me to post a savegame or anything else to help you out with this?

This is more complicated than it looks like.
Block signals are not supported, because it's more difficult to tell, what's inside the block. You can use pathfinder to look for train wanting to couple, but it doesn't tell you, if it's only train in the block. So then imagine multiple trains wanting to couple entering the block at the same time. Your case is simplified and ofcourse, it could be automated, but it would create more serious bugs when you play with it further in more complicated cases.
It's in know bugs and I can only suggest you for now to use path signals for coupling instead. I don't see quick way of fixing this.

My best idea for block signals is using white signal state, if there is right train in the station and nothing else in the block, but it's too much effort to code this. Altho I'm not sure, if block signals would be even useful in anything more complicated with more trains.

michael blunck wrote:
Karn, I have the same problem. Sometimes ignoring the signal works, sometimes the coupling locomotive "waits for free path", without any reason I can see. I´m using all 2-directional path signals for the layout shown in the original thread

Could you please post screenshot or savegame?


Top
   
PostPosted: Fri Jun 15, 2018 12:19 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1072
Great work.
It is possible now not only to decouple, go around and couple from other end, but also to leave wagons for full load and couple different set of cars already loaded:
http://149.156.194.203/~mczapkie/Train/ ... pling1.png

I noticed, that normal decouple would not load cars, which are abandoned, is it bug or feature? (in my opinion it should load, we have "no loading" option for that).

Another problem: train cannot be decoupled, if station is too short.
By the way, similar to "load trough" patch, train should always try to proceed outside of the station, if station stopping position is set to "far". For example, if locomotive have to be detached, it should stick outside station, leaving first detached wagon in "far" position.

If talking about reversing mentioned by Snail: this approach is OK for single non-symetric vehicle, for example steam locomotive should go with tender forward, if reversed:
http://149.156.194.203/~mczapkie/Train/ ... pling0.png
but is useless for whole trainset.
Trainset should be reversed physically (first go last) not just due to aesthetic reasons, but to enable proper shunting operations.

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension.


Top
   
PostPosted: Fri Jun 15, 2018 1:08 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 28, 2003 6:52 pm
Posts: 1182
McZapkie wrote:
If talking about reversing mentioned by Snail: this approach is OK for single non-symetric vehicle, for example steam locomotive should go with tender forward, if reversed:
http://149.156.194.203/~mczapkie/Train/ ... pling0.png
but is useless for whole trainset.
Trainset should be reversed physically (first go last) not just due to aesthetic reasons, but to enable proper shunting operations.

My approach is only a workaround, and of course it doesn't work for non-symmetric consists with respect to wagon lengths.
OTTD itself should handle proper reversing, but that would require a specific patch.


Top
   
PostPosted: Fri Jun 15, 2018 1:09 pm 
Offline
Engineer
Engineer

Joined: Sun Oct 02, 2011 6:56 pm
Posts: 83
McZapkie wrote:
Great work.
It is possible now not only to decouple, go around and couple from other end, but also to leave wagons for full load and couple different set of cars already loaded:
http://149.156.194.203/~mczapkie/Train/ ... pling1.png

I noticed, that normal decouple would not load cars, which are abandoned, is it bug or feature? (in my opinion it should load, we have "no loading" option for that).

I see some misunderstanding here.
The second part of train gets the current_order + wait_for_couple order.
So after it's loaded, it waits to be coupled. When you don't set full_load, it will take what's available in station and then it will wait for locomotive.


McZapkie wrote:
Another problem: train cannot be decoupled, if station is too short.

Decoupling longer train than station is not supported, because it's difficult to program. Let's not assume that my free time is endless and I can do this patch without compromises. Btw if anybody feels like he wants to contribute (with programming), it's welcome.
This picture shows, why it's difficult to couple train outside the station. You need to compute exact position to join a wagon from + offset if reversing switch length of front vehicle. In station you have just 2 simple cases without 45° and 90° options and you don't have to care (too much) about wagon lengths.

Attachment:
corner_cases.png
corner_cases.png [ 145.7 KiB | Viewed 629 times ]


Top
   
PostPosted: Fri Jun 15, 2018 2:32 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1072
Karn wrote:
I see some misunderstanding here.
The second part of train gets the current_order + wait_for_couple order.
So after it's loaded, it waits to be coupled. When you don't set full_load, it will take what's available in station and then it will wait for locomotive.

To be more precise:
if current order is default (load if any, unload if wanted), i.e. it is untouched, wagons are loaded with existing cargo, but are not loaded with any new cargo which appear at the station later.

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension.


Top
   
PostPosted: Fri Jun 15, 2018 3:32 pm 
Offline
Engineer
Engineer

Joined: Sun Oct 02, 2011 6:56 pm
Posts: 83
McZapkie wrote:
Karn wrote:
I see some misunderstanding here.
The second part of train gets the current_order + wait_for_couple order.
So after it's loaded, it waits to be coupled. When you don't set full_load, it will take what's available in station and then it will wait for locomotive.

To be more precise:
if current order is default (load if any, unload if wanted), i.e. it is untouched, wagons are loaded with existing cargo, but are not loaded with any new cargo which appear at the station later.

That's about, how it should behave in basics.
I don't think the station order should have more options, there are too many already. So I prefer keeping Waiting for couple as separate order. Altho if it's important, train could check, if next order (not only current) is waiting for couple and then couple the train. I can see benefits from this, but I don't know if it's more or less confusing than current behaviour.

Back to your question. Train can't load when it already finished its station order. Altho it could behave differently with full load - the locomotive could join the train earlier and leave station with about half loaded train. Is it useful to have such feature?


Top
   
PostPosted: Fri Jun 15, 2018 3:57 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Aug 24, 2014 12:20 pm
Posts: 60
Location: Kaon Prison, Cybertron
My only contribution here will be this question: What about cargo distribution?

I know that you're limited for time to work on this patch (which is pretty epic, I must say!) and a work around will be difficult.
But I've been playing around with it for 2 days now and the main issue I've seen is that passengers don't know where the empty carriages are going, so they don't get loaded.
Have you thought of any work arounds for it? The only one I could think of is if the carriages are to load any of its refitted cargo, regardless of desitation/route. Not sure how this works down to the game, but I thought I'd suggest it.

Btw, amazing patch :bow:

_________________
Some links to stuff I've made:
-=RUKTS=- | -=NML Py-Patcher (a Python 3.0 pre-compiler)=- | -=Screenshots=- | -=Doom Soundtrack port to OpenTTD=-

Image


Top
   
PostPosted: Fri Jun 15, 2018 4:08 pm 
Offline
Engineer
Engineer

Joined: Sun Oct 02, 2011 6:56 pm
Posts: 83
FulliAutomatix wrote:
My only contribution here will be this question: What about cargo distribution?

I know that you're limited for time to work on this patch (which is pretty epic, I must say!) and a work around will be difficult.
But I've been playing around with it for 2 days now and the main issue I've seen is that passengers don't know where the empty carriages are going, so they don't get loaded.
Have you thought of any work arounds for it? The only one I could think of is if the carriages are to load any of its refitted cargo, regardless of desitation/route. Not sure how this works down to the game, but I thought I'd suggest it.

Btw, amazing patch :bow:

Question here is, what does cargodist care about. Is it just next hop, or whole route when it comes to orders? If it was just next hop, it could be pretty simplified, but I don't have such insight to be sure.


Top
   
PostPosted: Fri Jun 15, 2018 10:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 09, 2008 4:20 pm
Posts: 2131
Skype: yes
Location: Slovakia
here's a pathfinder bug (?) that I've encountered once before

train engine reserves a path that loops through a dead end, but it intersects with itself so it gets stuck


Attachments:
lostmyhead.sav [1.52 MiB]
Downloaded 6 times

_________________
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
Top
   
PostPosted: Fri Jun 15, 2018 11:03 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2342
Location: Newcastle, Australia
Hi Karn,

Great set you made will create a lot of fun for the game.

A few months ago I made some overlap platforms they go well with your Realistic Train Shunting.
Attachment:
DecoupleStation1.png
DecoupleStation1.png [ 89.98 KiB | Viewed 487 times ]


Attachment:
DecoupleStation.png
DecoupleStation.png [ 86.75 KiB | Viewed 487 times ]


As can see the Overlap platform which is fake allows a set of switchers (points) at the platforms.

The only fault I found so far when I send the engine to the Waypoint, which is the signal box .. if I did have that signal there, the train would continue down the track as far as it can go before returning to the train.

Does this even if I put a station there instead of the Waypoint and signal. But this could also be I getting the orders wrong.

If I can figure this out will be great at country terminal stations where there is only a single line.

Looks like I need to make a few more overlap platforms and a nice terminal end with buffers to go with it.

Cheers pal

_________________
Soot Happens
All my projects are GPLv2 License.
AuzTrains & NSWTrains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
AuzInd (Industry Set): http://www.tt-forums.net/viewtopic.php?f=26&t=74471
AuzObjects: viewtopic.php?f=26&t=75657
AuzBridges: viewtopic.php?f=26&t=75248
AuzStations: viewtopic.php?f=26&t=76390
AuzTracks: viewtopic.php?f=26&t=82691


Top
   
PostPosted: Fri Jun 15, 2018 11:34 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 09, 2008 4:20 pm
Posts: 2131
Skype: yes
Location: Slovakia
another interesting behavior, when an engine gets autoreplaced and then couples to a train, the train flips instead of going straight ahead

it'd be cool if this was always the case if you uncheck "disallow reversing of trains at stations" in settings


Attachments:
reverseafterreplace.sav [1.55 MiB]
Downloaded 7 times

_________________
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 40 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.