Eddi wrote:
it's technically not a bug, but a missing feature.
Ah I see. No much point in digging the patchpack code then.
the only way it can occur in trunk is if cargo is being routed through oil rigs, so it is such a marginal case that it's not deemed worth fixing. infrastructure sharing then fails to implement it.
With IS it goes for all station so the problem is bigger.
CargoDist does not seem to mind IS as it is station based. When a vehicle stops at a station CargoDist will route the cargo towards possible destinations based on vehicle orders. When looking at the station gui, while testing a bit, the source was company 1's station, the destination company 2's station, transfer station was in the middle of nowhere. Passengers were routed as expected from town A to town B. Nothing to fix there, lucky me.

The only "problem" I saw is that the linkgraphs are drawn on a company base -> when playing with company 1 you do not see the part of the other company. It would be nice,
but not needed per se, if I could find where I can enable drawing linkgrahs for all companies at the same time if IS is on.
IS is nowhere near ready for trunk but CargoDist seems to be getting there piece by piece judging from recent commits ... as the behaviour also shows with oilrigs in clean trunk a solution may have to be found at some point (*)?
(*) Hopefully soon. Go go fonso!
the problem is the way which it should be implemented. every cargo packet needs not only remember the transfer credit, but must provide a mapping to remember transfer credit for each company, i.e. every cargo package needs 16 times the current memory in a naive implementation.
Hmm memory usage might become too much if 16 times more yes.
How about:
If cargo is transfered to a station that does not belong to the own company (using IS or transfering passengers to an oilrig in clean trunk) do the payment as if it was a final payment but still transfer the goods while adding this final payment to the transfer share amount. Then company 2 can pick them up and gets the payment as normal when delivered to the final destination or the process can be repeated if transfered to a third company.
JGR wrote:
Well, at first instinct the easy solution would just be to transfer the feeder income from the company receiving the packet to the company that brought the packet so far, on transfer of the packet between the companies' vehicles/stations/whatever. The company receiving the packet can then "reclaim" this as part of the acceptance income.
The issue would then be if that was easily abusable.
I think that it could be abused, yes.
eg. Final payment being negative when transfer share was too high.
If company 1 sets the transfer share in such a way that he gets overpaid for his trip he earns too much while company 2 loses money. With only one company in the game it is not a problem that the last vehicle loses money as payment goes to the same account anyway.
eyeMWing wrote:
I did a source dig myself to see what was going on and have a general outline of a solution. This can also be easily extended for more equitable sharing between transfer legs, and more accurate per-vehicle profit tracking.
Come to think of it, this is probably a candidate for a new patch and sounds increasingly like that excuse I've been looking for to get some practical C++ experience.
If you want to have a go at writing a patch for trunk.
There is the case with the oilrigs. Company 1 can transfer cargo to them and company 2 can pick them up from there.
It is the only case in trunk where there is a usable station that does not belong to a company. (Not counting GRFs that include a station tile)
I have not yet tested this in clean trunk myself to see what happens to the transfer money but judging from Eddi's reply it is the same.
Good luck and have fun.
Looking forward to read about what exactly you have in mind.