Page 1 of 5

Patch: Partial refit

Posted: 18 Nov 2010 21:35
by Terkhen
This patch allows to select a part of a train or road vehicle at the refit window and to refit only that part.
Trarnton Transport, 2050-04-03.png
Trarnton Transport, 2050-04-03.png (28.73 KiB) Viewed 7669 times
The source code can be found at http://devs.openttd.org/~terkhen/patches/partial_refit/. The patch is in need of testing; any feedback will be appreciated.

Re: Patch: Partial refit

Posted: 18 Nov 2010 21:48
by MagicBuzz
wow, nice patch :)

Re: Patch: Partial refit

Posted: 18 Nov 2010 22:41
by kamnet
:bow:

Re: Patch: Partial refit

Posted: 18 Nov 2010 22:49
by Kogut
Is it possible to allow selecting wagons using ctrl+clicks/click with shift + click methods?
Is it possilble to resize window when there are many cargos possible?

Re: Patch: Partial refit

Posted: 18 Nov 2010 23:00
by Kogut
Tiny bug: create train with refittable wagon and empty engine, select an engine - there are listed cargos and refit is refitting whole train.

Re: Patch: Partial refit

Posted: 19 Nov 2010 00:03
by Eddi
if you have a train with, say, one half open wagons and other half closed wagons, and you select e.g. grain as refit cargo, does it automatically unselect all closed wagons, which cannot be refit to grain?

Re: Patch: Partial refit

Posted: 19 Nov 2010 06:43
by MagicBuzz
IMO, in this case, the patch should disable any cargo than is incompatible with any selected wagon.

Re: Patch: Partial refit

Posted: 19 Nov 2010 07:44
by Terkhen
Kogut wrote:Is it possible to allow selecting wagons using ctrl+clicks/click with shift + click methods?
The Ctrl+click behaviour used in depots could be implemented. I don't know what Shift + click does, though (and I can't found any info about it at the tooltips either). This reminds me that I did not add any tooltips for the new widgets and behaviour.
Is it possilble to resize window when there are many cargos possible?
No, because in some cases it is impossible to display all the cargos at once. For example, check the refit window for the Ishizuchi Industrial Tram (HEQS) running with FIRS:
Suninghall Transport, 2050-01-16.png
(96.04 KiB) Downloaded 1 time
Kogut wrote:Tiny bug: create train with refittable wagon and empty engine, select an engine - there are listed cargos and refit is refitting whole train.
It is probably selecting the whole chain but not displaying the selection. Thank you for the report, I'll check it soon.
Eddi wrote:if you have a train with, say, one half open wagons and other half closed wagons, and you select e.g. grain as refit cargo, does it automatically unselect all closed wagons, which cannot be refit to grain?
In this case, the behaviour is unchanged from vanilla OpenTTD. You can select all options available to the current selection, and if you refit to a cargo option that is not available for all wagons of the selection, only the wagons that are able to refit to that cargo will be refitted. I agree that this is confusing, and because of that I would like to have a well defined behaviour to deal with this issue before implementing it. Have in mind that the creation of refit orders still uses the old method (and it is not the goal of this patch to implement partial refit orders), and both methods should stay as consistent as possible.

Re: Patch: Partial refit

Posted: 19 Nov 2010 08:01
by ColdIce
OMG! :shock:
great great great patch.. very very usefull. thank you :bow:

Re: Patch: Partial refit

Posted: 19 Nov 2010 08:44
by Alberth
Could you please explain for the less advanced players like me, why do you need this capability?
I never have a need for a train with more than one cargo (except passengers/mail but those come conveniently as two different wagons).

Re: Patch: Partial refit

Posted: 19 Nov 2010 09:04
by planetmaker
Take a train set with wagons which have many refit options. Then you might take one wagon type and want to send it e.g. to the FIRS refinery. This example might not fit industries as found 100%, but just for the illustation: There you want half the wagons to pickup fuel oil and the other half to pickup goods (instead of the default milk).

Or a very good excample are the MU wagons of the 2cctrainset: PAX, mail and valuables. You want a mixed train. Currently not easy to assemble that train (not too difficult either, though)

Re: Patch: Partial refit

Posted: 19 Nov 2010 09:11
by Terkhen
It's only useful for mixed trains. Personally I don't use them much either (except for farms with very small production). It is already possible to do partial refits without the patch, but you need to move the wagons you don't want to refit outside the train, refit the rest, and join them back again. The patch aims to provide a GUI for doing an otherwise tedious task.

Re: Patch: Partial refit

Posted: 19 Nov 2010 12:57
by blitzkrieg
Great patch!! :D
Hope it makes to trunk.

Re: Patch: Partial refit

Posted: 19 Nov 2010 17:01
by cmoiromain
Terkhen explains it exactly how I see it. This gives you control over individual wagons, whereas OpenTTD currently only allows to globally control the whole train, which is annoying in some cases.

Re: Patch: Partial refit

Posted: 19 Nov 2010 17:11
by michael blunck
cmoiromain wrote: This gives you control over individual wagons, whereas OpenTTD currently only allows to globally control the whole train, which is annoying in some cases.
In principal, thereĀ“s a comparable number of mouse actions needed as before (i.e., detaching wagons). And I could easily construct cases where the current method needs less actions.

Other than that, an interesting approach, but in need of further discussion.

regards
Michael

Re: Patch: Partial refit

Posted: 19 Nov 2010 19:14
by Kogut
michael blunck wrote:. And I could easily construct cases where the current method needs less actions.
For example...

Re: Patch: Partial refit

Posted: 19 Nov 2010 21:23
by ChillCore
I have not yet tested but I have been in a few situations where I wished something like this existed. eg. Delivering food and goods to towns by means of one train, combining iron ore and coal for steel mills, picking up/delivering supplies in FIRS, etc, etc, etc.
The way trunk is now you need an extra loc for refitting wagons or move a lot of wagons back in and out of the consist as wagons can not be refitted when not attached to an engine.

Very nice idea Terkhen.
Hope it makes trunk someday soon. :)

/ChillCore wonders if this can be extended to refitting specific wagons in the depot by means of the order list. :twisted:

Re: Patch: Partial refit

Posted: 19 Nov 2010 21:38
by Terkhen
ChillCore wrote:Very nice idea Terkhen.
Hope it makes trunk someday soon. :)
It needs testing before I consider that :)
ChillCore wrote:/ChillCore wonders if this can be extended to refitting specific wagons in the depot by means of the order list. :twisted:
There are many problems of concept with that idea. For example, two trains that have a completely different combination of wagons can share orders. What should the partial refit order do then?. Other issues were discussed on IRC a few weeks ago, but I don't remember the most complicated one right now.

Besides that, there are also many implementation issues (IIRC there was not enough free space in one of the order data structures). This is why I said that partial refit orders are outside of the scope of this patch.

Re: Patch: Partial refit

Posted: 19 Nov 2010 21:55
by ChillCore
Terkhen wrote:
ChillCore wrote: Very nice idea Terkhen.
Hope it makes trunk someday soon. :)
It needs testing before I consider that :)
Going to download the patch right now and have a looksie at the code.
And test ofcourse. ;)
Terkhen wrote:
ChillCore wrote: /ChillCore wonders if this can be extended to refitting specific wagons in the depot by means of the order list. :twisted:
There are many problems of concept with that idea. For example, two trains that have a completely different combination of wagons can share orders. What should the partial refit order do then?. Other issues were discussed on IRC a few weeks ago, but I don't remember the most complicated one right now.
Hmm ... yes I did not think of that.
Linkie to the IRC-log would be apreciated, if someone remembers when the conversation took place that is. :)
Terkhen wrote: Besides that, there are also many implementation issues (IIRC there was not enough free space in one of the order data structures). This is why I said that partial refit orders are outside of the scope of this patch.
I have re-read the topic and I had missed that line before ... sorry.

Re: Patch: Partial refit

Posted: 19 Nov 2010 22:30
by Terkhen
Don't bother much with the code for now; I still have to clean up many inconsistencies. I also have to figure out if the vehicle image should be displayed for all vehicle types, as it does not serve an actual purpose for them.

The discussion started at this time, but I don't know when the issues were discussed.