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

Loading of mixed cattle and grain (absolute tarpit issue) #6530

Closed
DorpsGek opened this issue Dec 15, 2016 · 15 comments
Closed

Loading of mixed cattle and grain (absolute tarpit issue) #6530

DorpsGek opened this issue Dec 15, 2016 · 15 comments
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) stale Stale issues

Comments

@DorpsGek
Copy link
Member

HGA opened the ticket and wrote:

I have a station (Neu Würzburg Höhe) for loading cattles and grain from a farm.
The trains have 5 cars for cattles and 5 for grain.
On the station there a thousends of cattles and tons of grain available.
If a empty train arraives the station, the loading starts immediatly in 9% steps. After the first loading (cattles or grain) are completed, the löading stops for a while. Than loading starts again with the second good, but only in 2% steps. Therefore the complete loading takes very long.

For testing I have biuld a new train with only one kind of good. This loading happens in 20% steps and is very quick.

I have attached the game.

Attachments

Reported version: 1.6.1
Operating system: Windows


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

adf88 wrote:

There's no "Neu Würzburg Höhe" in your savegame...


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14308

@DorpsGek
Copy link
Member Author

frosch wrote:

It is at tile 1049, 964. (scrollto 0x1e2419)
The "Höhe" part is translated and says "Heights" if OTTD is set to english.

Another hint: If you do not have matching NewGRF, it is a good idea to pause after loading the game, stop all road vehicles, and then unpause again.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14313

@DorpsGek
Copy link
Member Author

HGA wrote:

Here is a new File. The specific station is on the fromt.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14318

@DorpsGek
Copy link
Member Author

adf88 wrote:

Everything perfectly normal here. Cargo gets loaded almost instantly. Why in 2% steps? Because the farm doesn't keep up with grain production. If you pause a train and wait until few hundreds of tones of grain gathered, you will see that loading is faster again.

"Tones" is not that much. One tone is the smallest unit, 30 tones fits into single wagon, 5 wagons will hold 150 tones.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14319

@DorpsGek
Copy link
Member Author

frosch wrote:

I think the observation refers to how the vehicles reserve cargo.

If there is not enough cargo waiting at the station to fill all vehicles, then the wagons reserve cargo starting from the front, while the wagons in the back do not reserve any cargo. Thus the wagons do not load in parallel, and total loading takes longer.
That is, the current algorithm prefers to load the 1st wagon to 100% while keeping the other wagons empty.

In the past this worked differently, all wagons always loaded in parallel.

The loading was changed to the current algorithm because of refit-in-station with "any cargo type". Wagons can only refit while they have no cargo loaded.
However, it is only supposed to work that way, if the order actually says "refit to any cargo".

The bug seems to be, that the loading always behaves like there is a "refit to any cargo" order.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14321

@DorpsGek
Copy link
Member Author

adf88 wrote:

You are talking about totally different thing. The author of this ticket was complaining that "complete loading takes very long".


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14322

@DorpsGek
Copy link
Member Author

adf88 wrote:

Your observation seems invalid too. Wagons do load in parallel even if there is a cargo shortage.

From what I observed, grain is being loaded in 5t pieces. If you have 10 tones on a station, 2 wagons will load in parallel.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14323

@DorpsGek
Copy link
Member Author

frosch wrote:

The next train that arrives at the station is train 14.
While there are about 30t of grain waiting, only the first grain wagon is being loaded.
See screenshot.

This is also the reason why loading takes so long. To load 5 grain wagons it takes 30 instead of 6 loading steps due to sequential loading.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14325

@DorpsGek
Copy link
Member Author

adf88 wrote:

It's hard to notice but you are right about "sequential" loading. Loading will happen in parallel only if there is enough cargo waiting on the station.

You are wrong about total loading time, it cannot be faster. No matter whether train loads sequentially or in parallel, it will always have to wait until cargo "appears" on the station.

This behavior has lesser impact on total loading time. We observe these effects only if there is cargo shortage - when train have to wait anyway. Only loading of the last wagon will cause a bit of a slowdown.

I'm not saying it's not a bug. I'm saying that it's not what this ticket is about.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14326

@DorpsGek
Copy link
Member Author

adf88 wrote:

I'm currently investigating the "improved_load" case. I'll let you know what are my findings.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14327

@DorpsGek
Copy link
Member Author

adf88 wrote:

OK, I have a clue. I tested few revisions. Always same conditions:
- vanilla trunk
- starting new game (never loading a savegame)
- clean config file
- always coal and only coal
- 9 wagons attached to Ginzu A4, "full load any"
- coal mine production increased to about 300t/month (cheat)

In all these revisions:
* r26856
* r26857 -Fix [#6110]: Reserve cargo after refitting and only if necessary.
* r26916
* r26917 -Revert (r26857): It broke improved loading.

loading behaves the same:
* When 'improve_load' is OFF, wagons load in PARALLEL.
* When 'improve_load' is ON, wagons load GRADUALLY.

In revisions:
* r26918 -Fix [#6110]: Reserve cargo only after unloading finished or if the vehicle has the desired cargo already
* current trunk
wagons always load GRADUALLY, no matter what the 'improved_load' is set to.

So what is "improved_load" supposed to do then? It seems that the behavior was reversed before and now is broken.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14328

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 3, 2017

frosch wrote:

There are two settings, they are supposed to do these two things:
* gradual_loading: Vehicle load in steps, instead of all at once.
* improved_load: When multiple vehicles are loading at a station: The second vehicle only starts loading, if there is enough cargo to full-load the first one.

Improved loading gets more complicated, if cargodist is enabled and the two vehicles have different destinations.

So, is the issue that improved_loading now treats "multiple wagons" like "multiple vehicles"?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14347

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 3, 2017

adf88 wrote:

Sorry for using word "gradual", I wasn't referring to "gradual_loading". Typing "gradual" I meant behavior of "improved_loading".

In revisions r26856, r26857, r26916, r26917 improved_load works - if turned OFF all wagons always load equally, when turned ON next wagon starts loading only if there is enough cargo to fill previous wagon. But since r26918 the loading is always "improved" even if "improved_load" is turned OFF.

I was testing ONLY the condition that I described - other settings set to their defaults, coal train, full load etc.
I wasn't testing "refit at station" nor cdist.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14348

@DorpsGek
Copy link
Member Author

andythenorth wrote:

Seems like a tarpit. Even discussing it means understanding the combinatorial settings correctly.

Can we improve that by removing the gradual and improved settings (defaulting to 'on' in both cases), and consolidating to one mechanic for loading vehicles?

I'm aware that will break some eggs, but eh, that's how we get a nice omelette.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6530#comment14663

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
@frosch123 frosch123 removed the Core label Apr 14, 2018
@andythenorth andythenorth added the stale Stale issues label Jan 5, 2019
@andythenorth andythenorth changed the title loading of mixed cattle and grain Loading of mixed cattle and grain (absolute tarpit issue) Jan 5, 2019
@andythenorth
Copy link
Contributor

Thanks for this. There's been no activity on this for some time, and as it stands, it doesn't look likely that it will go any further. I'm closing it as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun. Feel free to discuss in irc or request re-opening if you disagree. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) stale Stale issues
Projects
None yet
Development

No branches or pull requests

4 participants