Dynamic train composition? (Decoupling/Shunting/etc..)

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

User avatar
jfs
Director
Director
Posts: 578
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by jfs » 05 Jun 2018 19:40

Two ideas for handling NewGRF problems, they might not cover all required cases:

1) Introduce a new flag/callback (?) for wagons, "soft coupled", returns whether the front and/or the back of the wagon can only be attached/detached in the workshop (depot). The opposite (hard coupled) means the wagon-wagon bond can never be broken by orders, and when the train is running a series of hard coupled wagons count as a single unit. Only the player can break hard wagon-wagon bonds, and only on trains stopped inside a depot. A NewGRF that doesn't support the callback is assumed to not know about dynamic consists and the wagons are considered all hard coupled.

2) The result of every callback for every wagon is frozen when a train is started inside a depot. Even if the engine is decoupled and a different engine is attached, all wagons still behave as if it was the original consist. Even if the train visits a depot as part of the orders, if it doesn't stop there (and wait for the player to start it again) the values remain frozen.

The soft/hard coupling flag would let you still build MU consists inside a depot, and would allow you to have two short MU consists couple to a single longer consist, but each MU can't be broken up.

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 698
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Gwyd » 05 Jun 2018 19:55

jfs wrote:Introduce a new flag/callback (?) for wagons, "soft coupled"
Very good idea, which I think could fix a lot of problems bought up
jfs wrote:A NewGRF that doesn't support the callback is assumed to not know about dynamic consists and the wagons are considered all hard coupled.
Even better
jfs wrote:The result of every callback for every wagon is frozen when a train is started inside a depot.
Less good. Some callbacks rely on dynamic things, such as speed or age or the current age or if the vehicle is reversed.

User avatar
andythenorth
Tycoon
Tycoon
Posts: 4967
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by andythenorth » 05 Jun 2018 19:55

Gwyd wrote:What about livery overrides?
Livery over-rides are daft anyway :)
in particular a change in capacity may occur.
NewGRF shouldn't be changing capacity based on lead engine, that's silly :)

I basically agree though that this needs a lot of care. Neat feature though, the video in previous page shows it off well :)

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 698
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Gwyd » 05 Jun 2018 20:13

andythenorth wrote: Livery over-rides are daft anyway...
NewGRF shouldn't be changing capacity based on lead engine
Well RUKTS used the first one to cause the second for every MU :-(

User avatar
ANIKHTOS
Engineer
Engineer
Posts: 120
Joined: 17 Jan 2013 05:13

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by ANIKHTOS » 05 Jun 2018 23:14

can i ask a question?

apart that this feature is used in real life

in what scenario it will actual be of any use in the game??

spiting a train into 2 and then merge it again?

apart from a perfect timing if the time is off then it will cause mroe wait?/

and if this happens in the platforms then you will loose that platform for long
better is it is done only in depot??


the only thing that could make any sense in the game as it is
it the ability to sell and buy wagons in the roders

i load the coal i move it to the power factory i unload it i sell the wagons sent back the engine buy wagons load and repeat.

but if we gone have this feature lets take it one step more

sell teh whole train and the engines and then buy it again at the mine

no need for return rail, all engines will be max re ability everything perfect lol

but is anyone of you really need this feature and having it will make sense??

User avatar
Drury
Tycoon
Tycoon
Posts: 2151
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Drury » 06 Jun 2018 01:54

ANIKHTOS wrote:can i ask a question?

apart that this feature is used in real life

in what scenario it will actual be of any use in the game??

spiting a train into 2 and then merge it again?

apart from a perfect timing if the time is off then it will cause mroe wait?/

and if this happens in the platforms then you will loose that platform for long
better is it is done only in depot??


the only thing that could make any sense in the game as it is
it the ability to sell and buy wagons in the roders

i load the coal i move it to the power factory i unload it i sell the wagons sent back the engine buy wagons load and repeat.

but if we gone have this feature lets take it one step more

sell teh whole train and the engines and then buy it again at the mine

no need for return rail, all engines will be max re ability everything perfect lol

but is anyone of you really need this feature and having it will make sense??
yeah while we're at it we can just sell the coal at the mine and buy it at the power plant

why even run any kind of transport service when we can just teleport stuff with money
Image

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

User avatar
ANIKHTOS
Engineer
Engineer
Posts: 120
Joined: 17 Jan 2013 05:13

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by ANIKHTOS » 06 Jun 2018 02:30

Drury wrote:
ANIKHTOS wrote:can i ask a question?

apart that this feature is used in real life

in what scenario it will actual be of any use in the game??

spiting a train into 2 and then merge it again?

apart from a perfect timing if the time is off then it will cause mroe wait?/

and if this happens in the platforms then you will loose that platform for long
better is it is done only in depot??


the only thing that could make any sense in the game as it is
it the ability to sell and buy wagons in the roders

i load the coal i move it to the power factory i unload it i sell the wagons sent back the engine buy wagons load and repeat.

but if we gone have this feature lets take it one step more

sell teh whole train and the engines and then buy it again at the mine

no need for return rail, all engines will be max re ability everything perfect lol

but is anyone of you really need this feature and having it will make sense??
yeah while we're at it we can just sell the coal at the mine and buy it at the power plant

why even run any kind of transport service when we can just teleport stuff with money
well teleport is a form of transportation :p
cheers

Karn
Engineer
Engineer
Posts: 127
Joined: 02 Oct 2011 18:56

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Karn » 06 Jun 2018 05:12

ANIKHTOS wrote:can i ask a question?

apart that this feature is used in real life

in what scenario it will actual be of any use in the game??

spiting a train into 2 and then merge it again?

apart from a perfect timing if the time is off then it will cause mroe wait?/

and if this happens in the platforms then you will loose that platform for long
better is it is done only in depot??


the only thing that could make any sense in the game as it is
it the ability to sell and buy wagons in the roders

i load the coal i move it to the power factory i unload it i sell the wagons sent back the engine buy wagons load and repeat.

but if we gone have this feature lets take it one step more

sell teh whole train and the engines and then buy it again at the mine

no need for return rail, all engines will be max re ability everything perfect lol

but is anyone of you really need this feature and having it will make sense??
You can make more money in early game, if you put more effort in it. It's the part of game, when you actually need the money.

You need one less locomotive for a route, because you can let load wagons without it, while the expensive locomotive is moving all the time and making money. For routes, where you can use only 2 trains, you save 50% money on locomotives so you can have more trains for less money.

SkullKrixzz
Engineer
Engineer
Posts: 25
Joined: 31 Oct 2014 18:24
Location: London, Ontario

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by SkullKrixzz » 06 Jun 2018 07:01

Finally! my dream of Dynamic trains is possibly coming true, and soon i could make massive yards to hold all my rolling stock and have a truly realistic north american setup!

SkullKrixzz
Engineer
Engineer
Posts: 25
Joined: 31 Oct 2014 18:24
Location: London, Ontario

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by SkullKrixzz » 06 Jun 2018 07:15

ANIKHTOS wrote:can i ask a question?

apart that this feature is used in real life

in what scenario it will actual be of any use in the game??

spiting a train into 2 and then merge it again?

apart from a perfect timing if the time is off then it will cause mroe wait?/

and if this happens in the platforms then you will loose that platform for long
better is it is done only in depot??


the only thing that could make any sense in the game as it is
it the ability to sell and buy wagons in the roders

i load the coal i move it to the power factory i unload it i sell the wagons sent back the engine buy wagons load and repeat.

but if we gone have this feature lets take it one step more

sell teh whole train and the engines and then buy it again at the mine

no need for return rail, all engines will be max re ability everything perfect lol

but is anyone of you really need this feature and having it will make sense??

actaully, this has plenty of use in game for me at least, since if i have multiple types of freight headed in the same relative direction, i just slap it all on one train to take it down then separate to smaller trains/trucks to finish the trip, but with the ability to decouple the train, i can break it up and have those smaller trains come right off hte big one without having to buy more freight cars, all i would need is new locomotives, then the locomotives that came down with the big haul, can take go back with a big haul of different freight that came from a few other small trains getting put together, and before you say anything about having to haul a full empty train back, just stage how you move the cars, take few empties on a big haul with mostly full cars, such as is done IRL, and thus making even more of a "realistic" train configuration. basically you just have to make sure you are getting your locomotives around well really, also gives more reason to have a power move to. and can give old locomotives a reason to stick around on your lines as they could just be used as help for heavier consists.

i am still so grateful to those who work on this, its something hte game has needed and i have been wanting for a long time. :bow:

User avatar
ANIKHTOS
Engineer
Engineer
Posts: 120
Joined: 17 Jan 2013 05:13

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by ANIKHTOS » 06 Jun 2018 08:23

Karn wrote:
You can make more money in early game, if you put more effort in it. It's the part of game, when you actually need the money.

You need one less locomotive for a route, because you can let load wagons without it, while the expensive locomotive is moving all the time and making money. For routes, where you can use only 2 trains, you save 50% money on locomotives so you can have more trains for less money.

okey so it is for early game
and maybe later on for new routes with industries producing too little

the engine will all the time going up and down the map, but every trip it will change wagons

so the engine will not wait in the station

can i ask something?
how it will choose the wagons??
it will take the ones that are loaded the more??

because me even early in the game i try to make the biggest run possible with the money at hand
so putting 2-4 trains is not that far fetch since the trains will spent lot of time travelling


not perfect so my question is if the engine can choose 2 waiting wagons will be therea choice to choose the most loaded one??

McZapkie
Tycoon
Tycoon
Posts: 1176
Joined: 18 Jan 2014 18:10

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by McZapkie » 06 Jun 2018 08:29

ANIKHTOS wrote: apart that this feature is used in real life
in what scenario it will actual be of any use in the game??
...
the only thing that could make any sense in the game as it is
it the ability to sell and buy wagons in the roders
This patch is completely unrelated to selling/buying wagons via orders, IMHO.
There is many ways to utilise dynamic train composition, of course in case in regular openttd game, which is fast and easy in term of money making, such micromanagement can be a waste of time, but in case of daylenght patch+hard economy setting,
such patch can be very useful, if it would allow to attach helper locomotives for uphill route, or switch steam/diesel to electric as shown on TV (YT ;) - it makes sense in case of infrastructure maintenance cost turned on.
Another uses: leave wagons for loading, pick other groups of wagons which are already loaded - no pay for locomotive waiting.
Or last but not least - possibility of cargo distribution - one train can supply many stations.

About late train: if I understand correctly, locomotive can pick any waiting train, so it will not stuck forever in case of train desynchronisation.
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, V4 CEE train set.
Addicted to freeciv longturn.

User avatar
FulliAutomatix
Engineer
Engineer
Posts: 104
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by FulliAutomatix » 06 Jun 2018 10:42

ANIKHTOS wrote:can i ask a question?

apart that this feature is used in real life

in what scenario it will actual be of any use in the game??
I'd say the main use of this patch is realism (as I demonstrated in the posted video).
Some of us (me as an example) play this game to simulate a real life network. The ability to move around rolling stock and locomotives gives a massive advantage.
Finally I'll be able to fill up my yards (that albeit are just decoration) with something useful, like coaches that are waiting for their next working, stored freight wagons that are waiting for their next loads, locomotives in for maintenance etc.

To the logistical player that builds this game for functionality, I it may not be the best (although the example of saving money on locomotives early game is also a great mechanic).
TLDR; For the eyecandy player like me, this is absolutely perfect to simulate real life better.

User avatar
jfs
Director
Director
Posts: 578
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by jfs » 06 Jun 2018 16:48

Gwyd wrote:
jfs wrote:The result of every callback for every wagon is frozen when a train is started inside a depot.
Less good. Some callbacks rely on dynamic things, such as speed or age or the current age or if the vehicle is reversed.
However those that can change dynamically while the train is running shouldn't be changing any wagon length properties anyway, it would cause exactly the same problems, right? Perhaps more correct would be to keep a whitelist of callbacks allowed when the train is running?

I have no experience building NewGRFs, only some basis technical knowledge from reading about it and following the original development of it for TTDPatch back then, so I hope someone else can use this to build on :)

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by peter1138 » 06 Jun 2018 22:34

When you load a savegame, most trains are not in a depot. The callbacks MUST return the same value whether the vehicle is in the depot or not, which it won't be able to do if they're split up. Splitting vehicles up without changing how callbacks operate will not work.
He's like, some kind of OpenTTD developer.

Karn
Engineer
Engineer
Posts: 127
Joined: 02 Oct 2011 18:56

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Karn » 07 Jun 2018 18:18

Version 0.3
This should be more stable, but there are still bugs present.
Feature - coupling train depending on full/empty and cargotype of wagons.
Also I decided to remove experiment with reversing because I think it deserve separate patch. As result, articulated vehicles bug is fixed now.

Edit: 0.3 is replaced with 0.4 in the future post
Last edited by Karn on 10 Jun 2018 15:05, edited 1 time in total.

Eddi
Tycoon
Tycoon
Posts: 7414
Joined: 17 Jan 2007 00:14

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Eddi » 08 Jun 2018 18:32

jfs wrote: A NewGRF that doesn't support the callback is assumed to not know about dynamic consists and the wagons are considered all hard coupled.
that is a possiblility, but that effectively disables the shunting feature for all existing NewGRFs, which is a rather harsh limitation. so we should try to explore less harsh solutions, before considering this.
andythenorth wrote:NewGRF shouldn't be changing capacity based on lead engine, that's silly :)
while that is probably true, just saying "don't do that" is not going to solve any problems.
You might not exactly be interested in Ferion, but if you are, have fun :)

Karn
Engineer
Engineer
Posts: 127
Joined: 02 Oct 2011 18:56

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Karn » 08 Jun 2018 21:19

Maybe we just overcomplicate things and nothing special is needed. Maybe all we need is the current depot check and as a bonus check, if length of vehicle(s) changed. (Or capacity too, if any NewGRF does it without changing length)

User avatar
Drury
Tycoon
Tycoon
Posts: 2151
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Drury » 09 Jun 2018 00:42

I got the patch crashing a bit (both trains and the game itself) but in the end I figured out what I was supposed to do - not overcomplicate things with waypoints and just trust the train to figure out who to couple to.

https://gfycat.com/WatchfulAmpleHammerheadbird

Honestly this patch is quite impressive, I like how simple to use it turned out to be. Good job.
Image

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

User avatar
Snail
Tycoon
Tycoon
Posts: 1226
Joined: 28 Apr 2003 18:52
Contact:

Re: Dynamic train composition? (Decoupling/Shunting/etc..)

Post by Snail » 09 Jun 2018 01:25

andythenorth wrote:NewGRF shouldn't be changing capacity based on lead engine, that's silly :)
Whoever says this is silly himself :P The alternative to that is having an endless purchase list with lots of similar wagons (some of which could probably only be attached to certain locomotives).
The French Narrow Gauge Train Set is now released! Get it here

Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 5 guests