OpenTTD-patches icon indicating copy to clipboard operation
OpenTTD-patches copied to clipboard

[Suggestion] Condition "does the train have goods via station X"

Open smurfix opened this issue 1 year ago • 2 comments

Consider a distribution center. One train goes out, collects goods, and unloads-for-transfer at a distribution station. Another train loads up at the distributor and goes to each destinations.

Now, the first train can easily be told to skip a station. There's a condition for it ("Go to X when goods at next station via DistributionCenter is zero"). However, there is no corresponding "… when goods on this train via station X is zero" condition.

While I've found a way to work around this (using slots and programmable signals), that's a lot of busy-work to set up, and far from intuitive. Thus I submit this additional condition for consideration.

smurfix avatar Apr 02 '23 16:04 smurfix

The condition would need to be along the lines of: "when the cargo on this train via station X when calling at station Y is zero". This is because the next station probability distribution is a property of the station which the vehicle calls at, given the cargo origin.

At the moment the next station predictor and the link capacity estimator are not able to work out that conditional orders are being used to try to implement a request stop type pattern. So for a route A - B - C, where A is the source and B and C are sinks, with conditional orders that may skip B, will result in links from A to C, A to B and B to C. At A the vehicle will load anything allocated to the flow shares associated with the A to C and A to B links, because B and C are both considered next stations. Cargo from A to C may be allocated on the A - C link, or the A - B and B - C links. If you haven't already you should turn on the link graph overlay for the cargo in question.

I'm a bit reluctant to add conditional orders which are difficult to use correctly (admittedly this is already a lost battle). I have looked previously at trying to improve skip-stop service patterns with cargodist and did not have much success. Possibly this is better implemented as some order flag which is interpreted by the various destination prediction mechanisms as not actually conditional for the purposes of cargo routing, but this is also non-trivial.

JGRennison avatar Apr 03 '23 22:04 JGRennison

OK. Fair enough.

Another workable solution to my cargo distribution problem would be partial unload orders, i.e. being able to drop off a given fraction of the load. Even better would be the ability to do this based on a counter, i.e. when the counter is three I would unload a third of the train's contents.

smurfix avatar Apr 04 '23 07:04 smurfix