[patch] Realistic Train Shunting

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

Karn
Traffic Manager
Traffic Manager
Posts: 128
Joined: 02 Oct 2011 18:56

Re: [patch] Realistic Train Shunting

Post by Karn »

Drury wrote: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
Depot acts as direction flip for pathfinder, I forgot about that, it's fixed now. Thanks for report.
Drury wrote: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
McZapkie wrote: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.
Well, then there is 3rd example, when train just decoupled, it should maybe try to reverse too to be consistent.
But we got suggestion to change stop location, which would make wagons wait outside station after reversing, which is currently not supported. I hope this is not major issue, I wanna think this through before modifying this, I don't think there will be way back once it's settled.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: [patch] Realistic Train Shunting

Post by michael blunck »

Karn wrote:
Drury wrote: train engine reserves a path that loops through a dead end, but it intersects with itself so it gets stuck
Depot acts as direction flip for pathfinder, I forgot about that, it's fixed now. Thanks for report.
Karn wrote:
mb wrote: [...] 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?
This should be the same bug as Drury reported, also involving depots. I´ll check with v0.6 later.

regards
Michael
Image
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [patch] Realistic Train Shunting

Post by Wahazar »

Karn wrote: 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?
Well, I expected that for example passenger consist, during change of locomotives, will be loaded if something become available, instead of just sitting and waiting. But if it is complicated to implement, forget it.

Another issue: start-stop switch result is not checked. If it fails, train would stuck forever.
For example PKP set use start-stop to check if brake force is enough, if you decouple heavy locomotive and try to couple light one, you will get warning inside depot while trying to run train, but no information when coupling on the station.
Not sure how handle such case - locomotive should check before coupling and don't go for, or should decouple if failed and proceed empty?
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: [patch] Realistic Train Shunting

Post by supermop »

Hi All,

Been playing with this for a few hours, think I've got the hang of the basics of it.

It seems like one good use for shunting would be to not waste your locomotive's time with loading trains. Currently it seems like it is impossible to have a rake of wagons load on their own, so I'm trying to use a cheaper shunter to take the wagons to the industry and load them, while the fast mainline locomotive only carries the full train as in the linked video.


Currently with all the running around, Its actually much less efficient that just keeping the big locomotive on the whole time, and I have ended up buying just as many mainline locomotives as rakes of wagons. So I am not saving any money or time, but it does certainly look cute to watch.


I've not yet tried playing with the keep wagons etc to marshall together longer trains, if that is possible.



https://vimeo.com/275400707
User avatar
FulliAutomatix
Engineer
Engineer
Posts: 119
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

Re: [patch] Realistic Train Shunting

Post by FulliAutomatix »



Made another video demonstrating the patch quite well :D
User avatar
Drury
Tycoon
Tycoon
Posts: 2168
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: [patch] Realistic Train Shunting

Post by Drury »

supermop wrote:Currently with all the running around, Its actually much less efficient that just keeping the big locomotive on the whole time, and I have ended up buying just as many mainline locomotives as rakes of wagons. So I am not saving any money or time, but it does certainly look cute to watch.
As far as efficiency goes, you can use the patch to improve efficiency of two-way lines serviced by a single engine.

Say you have a really long line going between a bubble generator and a fizzy drink factory. By the time a train makes the whole trip to the factory and back, station rating of bubbles will have deteriorated. Normally you'd solve the problem by adding a second train and passing points, possibly even a second track. With this patch you don't need to do any of that, you can just have a bunch of wagons loading at the station while the engine delivers the other bunch. As it comes back, it leaves the empty wagons, picks up the full ones, rinse repeat. This way you always have wagons loading at the station without a need to upgrade the tracks for multiple trains.

The great thing about this is that theoretically you can have mammoth trains and have them be really effective, if the line is really long. Basically, the longer the line the longer you want the trains to be, and you can afford it just fine since cargo is always being loaded, regardless if there's an engine or not.
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: [patch] Realistic Train Shunting

Post by wallyweb »

I'm sort of busy at the moment so I can't add this patch just yet, but I will eventually.
I the meanwhile, a couple of questions ...

Q1. Sometimes I need extra power and I add two or three engines to the head end of my train.
Will the shunt move detach just the lead engine or can the full head end power set detach as a unit?

Q2. I occasionally have a long line with several same cargoes to be collected at each of several stations. There are several ways to accommodate this so that station ratings are preserved, but they all involve running at least two trains per station. Very expensive.
Can, for example on a five station line, the shunting train start it's outbound trip with two empty wagons for each station, total ten, and drop two wagons at each station and then on the return inbound trip, collect the full wagons from each station until after the last inbound station, the train has collected the ten full wagons?
User avatar
Drury
Tycoon
Tycoon
Posts: 2168
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: [patch] Realistic Train Shunting

Post by Drury »

wallyweb wrote:Q1. Sometimes I need extra power and I add two or three engines to the head end of my train.
Will the shunt move detach just the lead engine or can the full head end power set detach as a unit?
You can set the exact amount of units to detach.
wallyweb wrote:Q2. I occasionally have a long line with several same cargoes to be collected at each of several stations. There are several ways to accommodate this so that station ratings are preserved, but they all involve running at least two trains per station. Very expensive.
Can, for example on a five station line, the shunting train start it's outbound trip with two empty wagons for each station, total ten, and drop two wagons at each station and then on the return inbound trip, collect the full wagons from each station until after the last inbound station, the train has collected the ten full wagons?
Yes. You can drop any amount of wagons and order a train pick up only full ones, even filter the coupling command by cargo (so a coal train doesn't go picking up full fizzy drink wagons across the map).

However I think there might be a problem with the order that the wagons are picked up. You don't really send a train to a specific station, you just tell it to go couple to a bunch of wagons somewhere. If you send it to a coal mine where coal wagons are still in the process of being loaded and tell it to pick up full coal wagons, it may instead go to a completely different coal mine where full coal wagons are ready and waiting for couple.

Then again there are probably ways to trap the train and prevent it from going where you don't want it to.


EDIT: nvm Karn got that covered of course
Last edited by Drury on 17 Jun 2018 07:12, edited 1 time in total.
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
Karn
Traffic Manager
Traffic Manager
Posts: 128
Joined: 02 Oct 2011 18:56

Re: [patch] Realistic Train Shunting

Post by Karn »

Drury wrote:
wallyweb wrote:Q2. I occasionally have a long line with several same cargoes to be collected at each of several stations. There are several ways to accommodate this so that station ratings are preserved, but they all involve running at least two trains per station. Very expensive.
Can, for example on a five station line, the shunting train start it's outbound trip with two empty wagons for each station, total ten, and drop two wagons at each station and then on the return inbound trip, collect the full wagons from each station until after the last inbound station, the train has collected the ten full wagons?
Yes. You can drop any amount of wagons and order a train pick up only full ones, even filter the coupling command by cargo (so a coal train doesn't go picking up full fizzy drink wagons across the map).

However I think there might be a problem with the order that the wagons are picked up. You don't really send a train to a specific station, you just tell it to go couple to a bunch of wagons somewhere. If you send it to a coal mine where coal wagons are still in the process of being loaded and tell it to pick up full coal wagons, it may instead go to a completely different coal mine where full coal wagons are ready and waiting for couple.

Then again there are probably ways to trap the train and prevent it from going where you don't want it to.
Train look only through one PBS for wagons. It will not find anything far if there are signals and intersections between stations.

There is a limit to this, if there are no intersections, then train will simply pass straight line with PBS, but stations to couple always contains intersections so it shouldn't be a problem.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: [patch] Realistic Train Shunting

Post by wallyweb »

Drury wrote: ...
:bow:
(so a coal train doesn't go picking up full fizzy drink wagons across the map).
Climate change fans might find that one useful. :lol:
EDIT: nvm Karn got that covered of course
:bow: to Karn. :D
User avatar
FulliAutomatix
Engineer
Engineer
Posts: 119
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

Re: [patch] Realistic Train Shunting

Post by FulliAutomatix »

AVG seems to be flagging the executable in version 0.7 as "dangerous" and refuses to let me launch it while "it is sent off for interrogation".
Anyone else having issues like this?
User avatar
Drury
Tycoon
Tycoon
Posts: 2168
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: [patch] Realistic Train Shunting

Post by Drury »

Not with glorious NOD32

entirely possible AVG flags on basis of not having it on the database yet
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
User avatar
TrainLover
Engineer
Engineer
Posts: 107
Joined: 01 Jul 2015 15:03

Re: [patch] Realistic Train Shunting

Post by TrainLover »

Dude, this is incredibly cool! The thing that was said was impossible to do has finally been done. Now let's pester the devs to put this into the base game! :)
Developer of North American Passenger Liveries: viewtopic.php?f=26&t=87228
Karn
Traffic Manager
Traffic Manager
Posts: 128
Joined: 02 Oct 2011 18:56

Re: [patch] Realistic Train Shunting

Post by Karn »

I will be unavailable next week and another few days, there won't be updates or answers from me. It's not dead, I'm just abroad. I feel responsibility to state this after working on this project on daily basis.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: [patch] Realistic Train Shunting

Post by Leanden »

TrainLover wrote:Dude, this is incredibly cool! The thing that was said was impossible to do has finally been done. Now let's pester the devs to put this into the base game! :)
“Done” and “Stable” are two very different things.

Pestering the devs will get you literally nowhere, people dont like being pestered. *hint* borts *hint*

It is also unlikely this will ever make trunk, the best you can hope for is a major patchpack if it doesnt massively conflict with other patches already in those packs.

On topic however: karn ive been following this for years, and i think its great you finally have a working patch. This really boosts my hopes for a working modular airports patch.
Image
Deicide
Engineer
Engineer
Posts: 19
Joined: 17 May 2011 16:02

Re: [patch] Realistic Train Shunting

Post by Deicide »

I think, to make cargodist work, the wagons need to be able to store their destinations to tell that information to the locomotive that couples to them.

Here is how it could work:

The passenger train is created in a depot with a shunter at the head. Said shunter is given an order list: go to the station that will load the passengers, decouple the wagons and store the following order list in the consist -> order list for wagons that is skipped by the shunter -> go back to the depot or to the storage consist yard to pick up another set of wagons for the route. The mainline locomotive in the mean time has the following orders: couple to the passenger consist and proceed to the destinations specified by the consist -> go back to the depot or locomotive yard or go couple to another consist, preferably one that goes in the opposite direction (the latter can be made easier to accomplish if the order lists, or their subsections can be given names and/or tags). In this way we have mainline locomotives simply moving the trains between stations, the passengers know where everything goes and shunters act as "route descriptors". It would be more intuitive and easier to manage, however, to allow the shunters to couple to consists that are inside the depots, that way we can simply create the locomotive-less consists with their own orders and have shunters pick em up in the depot and execute their first order before decoupling, the consist can memorize which order it's currently on, so the mainline loco can resume it.

The above should also include having shunters and mainline locomotives only count as infrastructure rather then full trains, so we don't get them counted in the performance rating.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [patch] Realistic Train Shunting

Post by Wahazar »

Another, simply idea for cargodist: coaches waiting for coupling would unload all passengers with given destination and keep/load only those with unassigned destination (to any station), because detached coaches have no timetable.
Once locomotive is attached, train know its destination and waiting passengers can be again loaded if their destination match to the train route.
BTW, it would fix current issue discussed above (detached carriages are loaded only before detaching but not after attaching).
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: [patch] Realistic Train Shunting

Post by Eddi »

cargodist is based on orders, so what you need to make cargodist work with detached wagon groups is to have them also have orders (like "wait for attachment from <engine group>"). any randomness like "attach to any wagon group that happens to be nearby" will kill cargodist.

another possible way is to have each wagon collect implicit orders individually
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: [patch] Realistic Train Shunting

Post by supermop »

FWIW,

Cargodist seems to be handling my cargo by just falling back to 'to any station' which is more or less fine for raw materials. I still am unclear about the orders of trains or groups of wagons that are 'waiting for couple' - these seem to have their own orders, but they do not seem to be persistent, that is they seem to disappear once that consist gets swallowed by another train/locomotive.


It is also kind of awkward at the moment to compose a train of two or more smaller trains. Maybe a low speed pushing option would solve this.


I am also puzzled when in the attached case, the locomotive won't pass the PBS to go get the waiting wagons unless told to SPAD... this happens whether the signal is one way or two way.
shunt.PNG
(356.27 KiB) Not downloaded yet
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: [patch] Realistic Train Shunting

Post by Eddi »

supermop wrote: Cargodist seems to be handling my cargo by just falling back to 'to any station'
really, that is the exact opposite of "working"
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot] and 15 guests