old LTN discussion thread

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by steinio »

WEll ok i watched the demo save and blueprinted some stations for my world.

I'm just wondering why this station don't work in the demo or is it intended to put circuits in the inbox?
I thought finish loading clears the output of all inserters.
ltn demo.png
ltn demo.png (1.2 MiB) Viewed 9257 times
Greetings, steinio.
Image

Transport Belt Repair Man

View unread Posts
nagapito
Filter Inserter
Filter Inserter
Posts: 362
Joined: Fri Jul 29, 2016 12:18 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by nagapito »

steinio wrote: That works for all goods not only for unloading liquids.
Why do youmake your mod these uneccessary complicated?
It worked super fine in 0.14 with Rail tanker and without finish loading.
Can't follow your thoughts anymore.

Greetings, steinio.
If my understanding of the issue is correct (devs did not deny or confirm on my bug report), this is due to rounding errors. The rounding errors already existed in 0.14 but since fluids values were between 0 and 10 it was a lot harder for it to happen. Like filling a tank to 1499.94 when rounded to 0 decimal digits it was 1500.

Now, its all 10 times more so the 1499.94 becomes 14999.4 and when rounded it is still 14999 but it cant accept a full fluid item since it only has space for 0.6 so it fails to load. That is why there are so much issues with fluids on some situations.

My suggestion, make so the signals dont let the tanks to be totally full. Tank accepts 150K, configure the signals so LTN tries to keep tank at 149 or 145. That way, there is always free space to get the extra fluid from the rounding error and pumps will be able to totally empty the wagon.
Last edited by nagapito on Mon May 22, 2017 6:18 pm, edited 1 time in total.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by Optera »

steinio wrote:WEll ok i watched the demo save and blueprinted some stations for my world.

I'm just wondering why this station don't work in the demo or is it intended to put circuits in the inbox?
I thought finish loading clears the output of all inserters.
ltn demo.png
Greetings, steinio.
Well that stop still has timing issues. I still haven't perfected the delay required for the inventory.
Currently a train enters and the unload inserters can work for 1-2 ticks before the expected inventory signal is sent out and negated.
I'd either have to add 2 or 3 nop combinators or use the composition signal to enable inventory to the inserters.

I'll probably go for the 2nd option using the control from the provider&Requester next to the depot.

nagapito wrote: If my understanding of the issue is correct (devs did not deny or confirm on my bug report), this is due to rounding errors. The rounding errors already existed in 0.14 but since fluids values were between 0 and 10 it was a lot harder for it to happen. Like filling a tank to 1499.94 when rounded to 0 decimal digits it was 1500.

Now, its all 10 times more so the 1499.94 becomes 14999.4 and when rounded it is still 14999 but it cant accept a full fluid item since it only has space for 0.6 so it fails to load. That is why there are so much issues with fluids on some situations.

My suggestion, make so the signals dont let the tanks to be totally full. Tank accepts 150K, configure the signals so LTN tries to keep tank at 149 or 145. That way, there is always free space to get the extra fluid from the rounding error and pumps will be able to totally empty the wagon.
Unless I'm misreading something we are talking about different issues with fluid handling.

Rounding errors only affect LTN if you turn finish loading off.

In another post devs confirmed 1 and 2 pumps can't reliably drain 100% from fluid wagons due to how fluid mechanics work between those 3 separate tanks.
With finish loading on and 3 pumps i have yet to see a fluid wagon leaving with residue.
DaveSh99
Inserter
Inserter
Posts: 29
Joined: Sat Jan 07, 2017 5:34 pm
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by DaveSh99 »

Out of curiosity, how do you wire up a station that is both a supplier of some things, and a requester of others?
ParkerSelfridge
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 15, 2016 4:49 pm
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by ParkerSelfridge »

Hello,

wonderful mod. But I have a question. In version 1.2.7 the requester station dosen't send the loading/unloading list.
Constant Combinator:
output:

train composition: position of wagons & locomotives in parked train (all stops)
binary encoded signal of train composition up to 31 carriages. More information about binary encoding here
Loading list: Items to load/unload or expected train inventory.

Normal or bug?
Mobius1
Fast Inserter
Fast Inserter
Posts: 191
Joined: Thu Feb 09, 2017 12:05 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by Mobius1 »

DaveSh99 wrote:Out of curiosity, how do you wire up a station that is both a supplier of some things, and a requester of others?
Picture 1
Wire up the yellow combinator of the LTN station to each inserter,
The loading inserters you put the signal Anything > 0, they will start loading the train whenever a train requests anything on the station (requests are positive by default)
The unloading inserters, you put Anything < 0, the opposite of the loading ones, so they won't unload stuff from the train when you're trying to load it
The 2 combinators near the station are arithmetic combinators.
- the blue one has the signal "each * -1 | each" it is connected to the station through the Red Wire and it'll read the train's cargo content, then multiplies it by -1, essentially inverting the signal
- The green one has the signal "each / 1 | each", it is connected with the blue combinator with a green wire from the output of blue combinator into input of green combinator.
The output of the green combinator is a red wire hooking into each chest on the loading side with the signal "Set Requests".
The station is set to [X] Read Train Contents and [X] Send to train, but this last one is unecessary

In the image below you can see a mining outpost configuration:
Picture 2
That is an example of why you use the green combinator, this time we're setting it to "each / 12 | each".

Now the boring part:
When the train arrives at the station with a "REQUEST SIGNAL" meaning the train wants something, it'll have a negative signal, so since "something is lesser than 0" then the unloading inserters will work and the loading inserters won't.
When the train arrives at the station with a "PROVIDER SIGNAL" meaning he wanna give something to the station, every signal he's sending will be positive, so it'll trigger the "anything > 0" condition and the inserters will start to remove things from the train
If you don't have that blue combinator of picture 1, the inserters will fill the train untill there's nothing left on the chests, since the chests are requesting whenever a train arrives with a signal, it'll keep filling up the train endlessly, but with the combinator, it'll subtract the items already loaded into the train from the work order and the requester will reduce its requesting order untill the train has all the items he wants, avoiding overloading the train.
The Green signal is a work order splitter, its purpose is to get the work order signal and split it amongst the requester chests to enable fast loading of the train and to avoid overloading the chests with resources. Imagine we have 6 chests loading up 2000 iron ore in a train, if each chest requests 2000 iron ore, it'll be 6x2000 ore loaded into the chests when the train only wants 2000, so we'll have 10k spares sitting on the chest and the miners are working in the meantime wasting energy, if its in a base station, the excess item loaded into the chest will end up being on the next train that arrives on that station requesting something filling the train with "junk" for his work order.
When we hook up the Blue combinator with the regulator signal (Inventory Reader) to the green signal, there's some points to consider:
1) if the work order is lower than the number of loading chests in the station, the train won't receive any item, for example if you have 6 chests requesting items and the train has a work order of 5 barrels, he will never receive any barrel as his work order is lower than the "min delivery" of that station
2) if you have a slow filling chest, whenever the remaining items to be loaded fall under the "min delivery" the train will stop receiving items, potentially jamming that loading station, its also an indicator of supply issues.
Requests on that station you just input on the red combinator that you hook up in the lamp with a negative signal and the ammount you want, lets say you want that station to receive and maintain 200 rocket fuel, you input on the constant combinator the signal "-200 rocket fuel" and the LTN system will try to keep that station with at least 200 rocket fuel all the time.

Feel free to ask any questions, this system is what I use in my current 6.4rkt/h save, working on bumping that number to 4rkt/s!!
OppyLock
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Aug 16, 2016 10:00 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by OppyLock »

So, how, in the brave new world of "Stops output expected inventory" do you do a multi-provider/multi-requester setup?
The station output no longer sends a negative inventory that you can use to block off one side by the "Anything < 0" method.
If the train is to unload then only the train configuration is sent.
This makes a separate multi-requester or multi-provider easier to create, but it makes the combination station very difficult.
It'd be nice to have the train provide a signal that it is here to unload :)
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by Optera »

OppyLock wrote:So, how, in the brave new world of "Stops output expected inventory" do you do a multi-provider/multi-requester setup?
The station output no longer sends a negative inventory that you can use to block off one side by the "Anything < 0" method.
If the train is to unload then only the train configuration is sent.
This makes a separate multi-requester or multi-provider easier to create, but it makes the combination station very difficult.
It'd be nice to have the train provide a signal that it is here to unload :)
Without the timing issues I mentioned earlier it'd be very easy. Here's the Logistic Network version I'm using for my outposts. It's down to half the combinators it needed in 0.14.
2017-05-23-09-37-45-1773795.jpg
2017-05-23-09-37-45-1773795.jpg (117.46 KiB) Viewed 9222 times
Blueprint
And here is the version using dumb chests:
It can be enhanced to only work if there's a wagon at a certain position like the Logistic Network version.
2017-05-23-09-44-27-3173806.jpg
2017-05-23-09-44-27-3173806.jpg (251.67 KiB) Viewed 9220 times
Blueprint
OppyLock
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Aug 16, 2016 10:00 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by OppyLock »

Ahhh ... I was missing the "Each * -2 -> Each" on the unloader. That's very clever! It allows for a reasonable overfill on loading to not cause an unloading loop.

I've made up some logic diagrams for increasingly complex stations.
Green / Red arrows are circuit cabling.
Black arrows are to show the role of inserters where it might be unclear.
These are all for use with the "Stops output expected inventory" option.
Simple Provider-Requester
Provider-Requester with train encoding
Provider-Requester with train encoding and logistics
DaveSh99
Inserter
Inserter
Posts: 29
Joined: Sat Jan 07, 2017 5:34 pm
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by DaveSh99 »

Thanks Mobius and OppyLock, i'll have a go at building that in my layout. Very nice explanation for stations that both provide and need. :D
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by Optera »

OppyLock wrote:Ahhh ... I was missing the "Each * -2 -> Each" on the unloader. That's very clever! It allows for a reasonable overfill on loading to not cause an unloading loop.

I've made up some logic diagrams for increasingly complex stations.
Green / Red arrows are circuit cabling.
Black arrows are to show the role of inserters where it might be unclear.
These are all for use with the "Stops output expected inventory" option.
These diagrams make the logic look almost too simple. :D
Simple Provider-Requester
This suffers from timing issues. You need a 2-3 tick nop operator between read inventory and unloading inserters or it will do one unload cycle for items to be loaded.
In my templates I used the encoding instead, same cost and it can be easily enhanced.
Provider-Requester with train encoding
Why didn't you use the encoded positions for loading as well?
Provider-Requester with train encoding and logistics
You have an excess filter inserter in unloading. It should go from each* -2 =each to the anything >0 = everything input and then to the inserters.
PirateAE
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Feb 18, 2017 6:12 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by PirateAE »

encountering an issue, LTN is ignoring min transport or signal min delivery size, as if the setting use best effort was on but its not. :/ its sending requests for 2-500 iron plates when teh min delivery size is set to 3200 (4 cars)... breaking and replacing both stations didnt fix, rechecked even mod setting for min delivery size, its at 2500. not sure whats going on, was working fine for us before we updated to current 1.2.7 (was 1.2.2). can try to post logs or such if you need.
Mobius1
Fast Inserter
Fast Inserter
Posts: 191
Joined: Thu Feb 09, 2017 12:05 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by Mobius1 »

PirateAE wrote:encountering an issue, LTN is ignoring min transport or signal min delivery size, as if the setting use best effort was on but its not. :/ its sending requests for 2-500 iron plates when teh min delivery size is set to 3200 (4 cars)... breaking and replacing both stations didnt fix, rechecked even mod setting for min delivery size, its at 2500. not sure whats going on, was working fine for us before we updated to current 1.2.7 (was 1.2.2). can try to post logs or such if you need.
check if you have a requester station with the signal "ignore min delivery" or if you have a "delivery size" signal lesser than 3200 on any requester station, that usually causes these type of issues.
PirateAE
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Feb 18, 2017 6:12 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.7

Post by PirateAE »

the requester end, (just one station requesting) is train limit 5, size is min/max 5 (running 1/4's) min delivery 32000 . request is for a total of 1.2 M. (8 more less full wharehouses.) there is just one supply end, no signal mods other than train limit to 4.

Edit must a missed a 0 earlier its 32000 (32k) or 4 full wagons

Further edit, Screenshot of request end, http://steamcommunity.com/sharedfiles/f ... =931799400 , supply end is actually just fed to input no mod signals
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.8

Post by Optera »

1.2.8 released:
  • added german locale
    as native German speaker some of the descriptions feel cringe worthy to me, let me know if you have better ideas.
  • fixed a bug in chinese
  • overloaded trains no longer cause requesters to flip to providers during delivery
    Sorry I neglected this bug for a while.
  • set expected train inventory to default to active
    Changed this to enabled to be in line with the builds presented in opening posts description.
nagapito
Filter Inserter
Filter Inserter
Posts: 362
Joined: Fri Jul 29, 2016 12:18 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.8

Post by nagapito »

Optera wrote: overloaded trains no longer cause requesters to flip to providers during delivery
Sorry I neglected this bug for a while.
Could you explain better what is happening now?
The train has more then requested so the station ends with a positive amount of items. Who is it preventing it from becoming a provider? Or is it that while there is a train unloading it ignores the new provider status and only actually becomes a provider when the train leaves?
Optera wrote: [*]set expected train inventory to default to active
Changed this to enabled to be in line with the builds presented in opening posts description.
Does this means the output combinator outputs what the train is expected to have when it finish filling it?
I ask because all my stations are designed with the previous signal. But now that I think about it, isnt items to load the same as expected train inventory?
PirateAE
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Feb 18, 2017 6:12 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.8

Post by PirateAE »

that patch didnt solve my bug of it not respecting both mod option min delivery size OR station set min Delivery size...

hell its not even respecting default min delivery size. (the 1000 min delivery size to prevent trains running wild) its sending requests the second a trains able to be qued be it 900 or 25 plates. if needed i can provide acess to a save
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.8

Post by Optera »

nagapito wrote:Could you explain better what is happening now?
The train has more then requested so the station ends with a positive amount of items. Who is it preventing it from becoming a provider? Or is it that while there is a train unloading it ignores the new provider status and only actually becomes a provider when the train leaves?
There was a bug where dumb providers overloading trains in conjecture with requesters set to small amounts could flip the requester to a provider during delivery.
Once it's unloaded at the requester it will flip if you don't use combinator logic though.
For details see Github Bugtracker: https://github.com/Yousei9/Factorio-Log ... /issues/33
Does this means the output combinator outputs what the train is expected to have when it finish filling it?
Yes.
I ask because all my stations are designed with the previous signal. But now that I think about it, isnt items to load the same as expected train inventory?
Only for provider loading into empty trains.
PirateAE wrote:that patch didnt solve my bug of it not respecting both mod option min delivery size OR station set min Delivery size...

hell its not even respecting default min delivery size. (the 1000 min delivery size to prevent trains running wild) its sending requests the second a trains able to be qued be it 900 or 25 plates. if needed i can provide acess to a save
Check your mod settings if best effort is active or your stations are set to ignore min delivery size.
PirateAE
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Feb 18, 2017 6:12 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.8

Post by PirateAE »

both aren't; http://steamcommunity.com/sharedfiles/f ... =931799400 Screenshot there shows the receiving end, no ignore, mod settings use best effort is unchecked

Config.lua

Code: Select all

-- set notification level
-- 4: everything, 3: scheduler messages, 2: basic messages (default), 1 errors only, 0: off
--log_level = 2

-- set notification target
-- console: in game console, log: logfile in factorio root directory, both: default
--log_output = "both"

-- message age in ticks before filtered messages are shown again
-- default 18000 = 5min
--message_filter_age = 18000

-- update interval in ticks
-- default 60
dispatcher_update_interval = 60

-- min amount of items/fluids to trigger a delivery, can be overridden individually with min delivery size for each requesting stop
-- default 1000
--min_delivery_size = 1000

-- Prevent trains from leaving while inserters are working by adding 2s inactivity to all (un-)loading stations.
-- default true
--finish_loading = true

-- duration in ticks of inactivity before leaving (un-)loading stations (timeout)
-- default 7200 = 2min
-- off 0: trains will wait forever to (un-)load
--stop_timeout = 7200

-- duration in ticks deliveries can take before assuming the train was lost
-- default 18000 = 5min
--delivery_timeout = 64000

-- when false provider stations holding less than request stations min_delivery_size are ignored
-- default false
--use_Best_Effort = false
Last edited by PirateAE on Wed May 24, 2017 2:58 pm, edited 2 times in total.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14/0.15] Logistic Train Network 1.2.8

Post by Optera »

PirateAE wrote:both aren't; http://steamcommunity.com/sharedfiles/f ... =931799400 Screenshot there shows the receiving end, no ignore, mod settings use best effort is unchecked

Config.lua
config.lua is only used for update interval. LTN's mod settings are under options-mods-map
Also use spoiler= instead of spoiler for dropdown.
Locked

Return to “Logistic Train Network”