[1.16.6] Warnings for missing items if item station is currently occupied

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
smallfly
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Oct 23, 2019 5:16 pm
Contact:

[1.16.6] Warnings for missing items if item station is currently occupied

Post by smallfly »

Hey Optera,

first of all thank you very much for your very cool mod! LTN really helps me organizing my base. LTN is the backbone of my whole base. Thanks for all your efforts!

Now to the actual topic: My plan is to optimize my base in a way that LTN does not show any warnings anymore. I don't mean by switching off warnings but by making warnings obsolete due to well base design. There is one type of warning that is disturbing me. The warning message tells me that a certain item is missing in the network. Lets say "iron plate" for example. I get the warning and think to myself: Missing? I have so many!! When looking at the (single) station where "iron plate" is provided, I see that the problem is, that a train is currently being loaded. Thus the warning message that "iron plate" is missing is wrong. It should say "item iron plate is not missing but all stations providing this item are occupied at the moment". And this warning message type should be optional, since I personally dont need that irritating message, since for me it is totally fine if the next train starts his "iron plate" journey as soon as single "iron plate" providing station is free again. I want to focus on items that are REALLY missing in the network.

I hope you get my point.

Best regards,
smallfly

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2846
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [1.16.6] Warnings for missing items if item station is currently occupied

Post by Optera »

LTN reserves deliveries from providers until a train leaves the provider.
It makes no difference if the item is not physically in storage or reserved by a delivery, either way there's not enough supply.

smallfly
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Oct 23, 2019 5:16 pm
Contact:

Re: [1.16.6] Warnings for missing items if item station is currently occupied

Post by smallfly »

Thank you for your fast answer. If the first train reserves so much that there is not enough for the second train anymore, THEN I get your point.

But while I am writing this post I see a train arriving at a copper plate station with more than enough copper plates (20k). The first train wants to pick up 3k. No problem. The second train would need 2k, which would also be no problem. He just has to wait a few seconds until the first train leaves the provider station, which then would still carry 17k.

Do LTN trains reserves the WHOLE station content?! Not only the amount they need?

robot256
Filter Inserter
Filter Inserter
Posts: 436
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.16.6] Warnings for missing items if item station is currently occupied

Post by robot256 »

Is there a train limit on the stop preventing additional trains from queueing up at the station?

It may be that LTN reserves a whole train load of each item for each train, even when only partial loads are requested. I find that LTN functions best if your base is designed to request and transfer only whole train loads of items between buffer chests. You can have shorter trains in the network, and specify max train length at the stops, for items with slower throughput.

There will always be some warnings unless you have many loading stations or large loading buffers and train limits at fewer stations (i.e. 12 chests per wagon).

smallfly
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Oct 23, 2019 5:16 pm
Contact:

Re: [1.16.6] Warnings for missing items if item station is currently occupied

Post by smallfly »

robot256 wrote:
Sun Jan 02, 2022 11:02 pm
Is there a train limit on the stop preventing additional trains from queueing up at the station?
Yes. I allow max 1 train per station since I do not use terminus stations. See base design screenshot here: https://steamcommunity.com/sharedfiles/ ... 2706113468

Here is a screenshot of a single loading station and its configuration: https://steamcommunity.com/sharedfiles/ ... 2706114686
robot256 wrote:
Sun Jan 02, 2022 11:02 pm
It may be that LTN reserves a whole train load of each item for each train, even when only partial loads are requested.
This is exactly the question directed to Optera. Optera, can you clearify this point?
robot256 wrote:
Sun Jan 02, 2022 11:02 pm
There will always be some warnings unless you have many loading stations
A compact base does not allow multiple loading station for one item. My base only has one provider station per item. (with some exceptions I have to admit i.e. mining ressources). I do not want to have wrong warnings. I only want correct warning so that I can optimize my base according to the shown (in future hopefully correct) LTN warnings.

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 440
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: [1.16.6] Warnings for missing items if item station is currently occupied

Post by GrumpyJoe »

It's a throughput issue.

Trains have high throughput, compared to belt/bot, yes. But the more stations request a given item, the more you need to produce and provide because you can not easily prevent all requester to request at the same time.

While you may have plenty time to resupply a requester even if it's train has to wait for an open destination (due to high train throughput), you still have "too many" requests at that point, because your high throughput is basicly "blocked" entirely until the station becomes open again. It's essentially a turned off belt, or a randomly prioritized splitter.


For high demand items, you'd need to either devide it into more loading stations, or a small stacker and increased train limit. Be aware of loading speed and LTN timeout settings.

That being said, I don't play with those warnings for this reason, they are only helpful if you make mistakes, for a base that is running as I intended, they are distracting at best

smallfly
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Oct 23, 2019 5:16 pm
Contact:

Re: [1.16.6] Warnings for missing items if item station is currently occupied

Post by smallfly »

GrumpyJoe wrote:
Mon Jan 03, 2022 11:41 am
For high demand items, you'd need (...) a small stacker and increased train limit. Be aware of loading speed and LTN timeout settings.
Thanks for the tip! A small stacker with increased train limit would of course make the warnings more seldom. But this does not solve the issue, that the LTN warning text is wrong. There needs to be a separate warning texts for cases where there is enough supply but no free station.
GrumpyJoe wrote:
Mon Jan 03, 2022 11:41 am
That being said, I don't play with those warnings for this reason, they are only helpful if you make mistakes, for a base that is running as I intended, they are distracting at best
I really like the warning messages since they help me to find problematic stations. Thus I won't turn them off. And I guess that there are more people not being able to built perfectly from scratch. If so, you could even play with activated warnings and would not see them due to your base with no problems/warnings ;-)

I checked the LTN source code now, more specifically the file "dispatcher.lua".

Code: Select all

local providers = getProviders(requestStation, item, count, min_carriages, max_carriages)
if not providers or #providers < 1 then
if requestStation.no_warnings == false and message_level >= 1 then printmsg({"ltn-message.no-provider-found", to_gps, localname, to_network_id_string}, requestForce, true) end
The getProviders function contains the line

Code: Select all

if activeDeliveryCount and (stop.max_trains == 0 or activeDeliveryCount < stop.max_trains) then
For my base with all stations having a max train limit of 1 per station, this means, that there is always a warning message when two trains want to access one provider station at the same time. And this is totally fine. BUT the warning message should be different when the only problem is a busy station compared to having empty stations missing the needed item.

Why? Totally different solution required. If its only a busy station, I don't care. The dispatcher will be successful a minute later when the station is not busy anymore. But if the provider station has no enough items that rings my alarm bell, since I have to change the factory to get more items in that station.

I suggest to change the code as follows:

Code: Select all

local providers = getProviders(requestStation, item, count, min_carriages, max_carriages)
local providersIncludingBusyStations = getProviders(requestStation, item, count, min_carriages, max_carriages, includeBusyStations)
if not providersIncludingBusyStations or #providersIncludingBusyStations  < 1 then
if requestStation.no_warnings == false and message_level >= 1 then printmsg({"ltn-message.no-provider-found", to_gps, localname, to_network_id_string}, requestForce, true) end
And the function getProviders could be changed to

Code: Select all

local function getProviders(requestStation, item, req_count, min_length, max_length, includeBusyStations)
(...)
if activeDeliveryCount and (stop.max_trains == 0 or activeDeliveryCount < stop.max_trains or includeBusyStations) then

Post Reply

Return to “Logistic Train Network”