Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer and Take Cargo fix #4154

Closed
DorpsGek opened this issue Oct 7, 2010 · 13 comments
Closed

Transfer and Take Cargo fix #4154

DorpsGek opened this issue Oct 7, 2010 · 13 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Oct 7, 2010

TruePikachu opened the ticket and wrote:

Okay, I know that lots of people have been complaining about how, if they transfer cargo to a station and then load, the cargo just gets picked up again. I have a solution for it, which will patch the functionality: The vehicle should only pick up the cargo if it is not from the next station the train will go to. There are a couple reasons for this particular direction:

  1. If there are only 2 orders (like transferring passengers to a huge station and taking passengers back), this will have the effect of not loading passengers who would be going back to their originating location
  2. In a transfer loop (3+ stations in a loop with transfer at each - theoretical idea), cargo might be dropped off and then picked up again, but the farthest it can go is just before the original station, therefore making there be a definite flow

I will research into how exactly to impliment it, and might eventually have a patch.

Reported version: Version?
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/4154
@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 7, 2010

TruePikachu wrote:

Ummm...reduce priority to "Low" please


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment8872

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 7, 2010

SmatZ wrote:

Priority set to Low as requested.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment8873

@DorpsGek
Copy link
Member Author

Kogut wrote:

I think the ticket can be fixed via partial of cargodist inclusion
- cargo is in packets
- packets have sources
+ algorithm "is it allowed to load the packet of cargo on the station to the vehicle with orders"


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment9133

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

Actually you'd need almost all of cargodist for that. The functionality you're looking for is provided in the branch "cargomap" and that requires the branches capacities, components, demands, mcf, flowmapping-core, multimap, selfaware-stationcargo, texteff, moving-average and reservation as precondition. That is, if you don't want to see what's going on. Otherwise you'll have to merge at least one of the GUI patches, too.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment9134

@DorpsGek
Copy link
Member Author

lecerf wrote:

Hello.

I have ever think about this features when I play OTTD. Indeed, the main problem of transfer is the vehicle in question is not able to do the travel back with a cargo without get back a cargo which has the same source/destination.

I have ever modified in the source code 1.1.0 (just for me, I have to make a trunk no ?) to keep from this situation.

1 - Considering the loading in a station of a "cargopacket", if its source is in the destination of the vehicle -> the "cargopacket" is not loaded.
2 - This induces a problem : when the order is "Transfer and Load" (and not waiting for full loading) one should count the waiting packet considering the destination of the vehicle.
And NOT waiting for others cargo loading whereas the cargo in station as the same source/destination -> the vehicle can go away.

In order to do that, the vehicle variable must be added in parameters of function "MoveTo". And default value is NULL when the "MoveTo" destination is a station.
In the LoadUnloadStation function, skip when there is no more cargo to add then :

if (!ge->cargo.Empty() && cap_left > 0) ........

become

if (!ge->cargo.Empty() && (cap_left > 0) && (none_recursive_count >0) ) ........

Where "none_recursive_count" is the amount of cargo which will NOT be delivered to the source station.

I don't know if I can modified and update the repository. Someone can help me about that.

The modification is not very important by I have not debug enough to ensure that there is no more default by using this way.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment9942

@DorpsGek
Copy link
Member Author

thehog wrote:

Hi,
I managed to patch this with Lecerf's input.
It checks if the cargo that is being moved isn't from a station that is in the orderlist from the vehicle which is receiving the cargo. Also in economy.cpp it counts the total cargo that is available in that case so we don't wait at the station when there is still cargo from the vehicle's station order list.

The test savefile has two remote busstation delivering passengers to a transferium. The busses only pick passengers from that transferium which is not destinated for it's own path (order list).

Please have a look at the patch. Maybe there is some normalisation to do. This is my first time changing code in openttd.

regards, Igor

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment10258

@DorpsGek
Copy link
Member Author

thehog wrote:

Here is a new patch. The first was wrong with trains and as a result trains not picking up cargo. I noticed that trains consists of multiple vehicles and only the first one has the order list (and more variable). So I had to insert some First()'s. See this new GOOD patch.

Owh btw,.. it is patched on 1.1.2

regards, Igor

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment10262

@DorpsGek
Copy link
Member Author

thehog wrote:

Note however this will not fix a three-stage (or more) feeder.

In this case (for example 'bus <-> remote airport <-> remote airport <-> bus') the cargo is being constantly begin transported between both airports (if not already pickuped by a bus). That is because the planes do not have the busses stations, and so the source of the cargo, in their order list so their behaviour is not changed by this patch.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment10266

@DorpsGek
Copy link
Member Author

thehog wrote:

Hi,
This new patch now also works for multi-stage feeders (like a bus->airport->bus). It now utilizes 'transfer_at_xy' to check if a cargopacket has already been on the route the loading vehicle is about to take (and then don't load it).
It also creates the condition that loaded cargo can not be unloaded (by force unload or transfer) at the station it just has been pickuped from. This one was there already for final-delivery but not for unload or transfer.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment10267

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 1, 2011

thehog wrote:

new patch.. much better.. patch on top of current trunk and fixes all issues (hopefully)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment10284

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 1, 2011

thehog wrote:

Ok this is now hopefully the last patch (on top of the current trunk). It fixes 2 way feeding all the way to 3 stage feeding. 4 stage feeding and more would also work unless you circle cargo back in the center of the feeding process. For example 3 airports with planes only flying on 2 airports. The solution would be to circle the planes on all three airports instead of only two.

But then again,.. who uses more than 3 stage feeding :)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment10285

@DorpsGek
Copy link
Member Author

andythenorth wrote:

This is moot, CargoDist solves the problem differently ;) Should be closed.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154#comment14338

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 5, 2017

andythenorth closed the ticket.

Reason for closing: Won't implement

Superseded by cargodist ;)


This comment was imported from FlySpray: https://bugs.openttd.org/task/4154

@DorpsGek DorpsGek closed this as completed Aug 5, 2017
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant