Should I add option to convert trains within depot

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
ttv86
Engineer
Engineer
Posts: 4
Joined: 19 Oct 2019 12:42

Should I add option to convert trains within depot

Post by ttv86 » 19 Oct 2019 12:48

One of major pains in game is to convert from electric to monorail and from monorail to maglev. Is there any technical reason that convert tool can not convert trains within depots? If there isn't any, should I make the change in code and add a PR in GitHub for the game? I've tried to find anything relate to it, but only thing I've found is that people ask is it possible to do in current game, nothing about changing the game code.

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

Re: Should I add option to convert trains within depot

Post by jfs » 19 Oct 2019 14:17

It would probably be somewhat similar to this idea: Template-Based Train Replacement

The major challenge is that there isn't necessarily any direct match between the units available for each railtype, so fully automatic conversion would probably be out.

ttv86
Engineer
Engineer
Posts: 4
Joined: 19 Oct 2019 12:42

Re: Should I add option to convert trains within depot

Post by ttv86 » 19 Oct 2019 15:46

Most of time people would be using this when first monorail or maglev trains become available. Then there is only one engine type available and train cars can be matched by their cargo type.
If tool would be used either to downgrade or used when there are more than 1 engine available, tool would choose best version first by according to is engine 1 or 2 headed and after it according by either fastest or cheapest (maybe an option for this? Open for conversation)

Transportman
Tycoon
Tycoon
Posts: 2697
Joined: 22 Feb 2011 18:34

Re: Should I add option to convert trains within depot

Post by Transportman » 19 Oct 2019 16:44

I think there is an universal track/depot NewGRF that already supports this via autoreplace, and if not, changing autoreplace to make it possible would be the way forward. Then you could also change the converter tool, to execute such an autoreplace when upgrading a depot, if all train parts have a matching replacement set, execute the replaces and convert the depot, else return an error and don't convert anything.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

ttv86
Engineer
Engineer
Posts: 4
Joined: 19 Oct 2019 12:42

Re: Should I add option to convert trains within depot

Post by ttv86 » 19 Oct 2019 19:25

How it would sound if there is only 1 available option for any type of engine/car converter could convert it automatically. For example if there is only 1 monorail coal car, there isn't need for auto-replace to add from target car. Also same when only first monorail or maglev engine is available, converter tool could auto-match any engines with only available engine and cars by cargo type. If there are multiple options for any item type, player must map them in auto-replace window.

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

Re: Should I add option to convert trains within depot

Post by jfs » 19 Oct 2019 21:07

You're speaking from a vanilla-only viewpoint. Remember that playing with different vehicle sets is very common and needs to be supported just as well as vanilla for any new features.

My own solution is to send all trains to depot, convert the network but not the depots, build new depots next to the old, build a new train, set its orders to shared with the old ones still in the old depots, then clone the new train as many times as needed. At the end, sell the old trains and remove the depots.

Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4741
Joined: 09 Sep 2007 05:03
Location: home

Re: Should I add option to convert trains within depot

Post by Alberth » 20 Oct 2019 05:06

Another option is to play with a train set that does not force you to mass-replace everything. I use NUTS for that, but other train sets exist.
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.

ttv86
Engineer
Engineer
Posts: 4
Joined: 19 Oct 2019 12:42

Re: Should I add option to convert trains within depot

Post by ttv86 » 20 Oct 2019 05:13

I don't know every NewGRF set that exists, but at least I think that following auto convert logic should work: If there is one possible engine and only one match for each car by their cargo type, auto convert to it. Otherwise use auto replace tool. I can even live with only replace window mappings, but current way to convert all rails as jfs described is a LOT of work on any extensive rail network. If there is any change it will ever get to the actual game I can even code it myself, but if anyone else doesn't want that I don't even try.

Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 4 guests