old LTN discussion thread

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Locked
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.6

Post by Anson »

Optera wrote:I confused myself since it defaults to comparator = >.
:D :oops: :mrgreen:

:geek: easy fix : no fix and no update needed because of the default.
:ugeek: but it should be adjusted anyway for the next version since they might someday decide to change the default ...

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

Re: [Mod 0.14] Logistic Train Network 0.5.6

Post by Optera »

Anson wrote:
Optera wrote:I confused myself since it defaults to comparator = >.
:D :oops: :mrgreen:

:geek: easy fix : no fix and no update needed because of the default.
:ugeek: but it should be adjusted anyway for the next version since they might someday decide to change the default ...
Done already.
Let me know how well 0.6 holds up in your usage scenarios.

Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.6

Post by Anson »

Optera wrote:Let me know how well 0.6 holds up in your usage scenarios.
just tested on my old request-testmap, and it worked pretty well, doing proper round robin.
debugging my setup
all this was not about the mod,
but about my setup that shall avoid low amounts of delivery while besteffort is true.

-----
now something about the mod:
to get more info, i used the new option to increase the protocol level in the config (very nice), but was immediately flooded with two messages per second that there was no station supplying iron and copper. although i wanted more info, this was a bit too much too often, and also too loud (one beep per second while i tried to concentrate on debugging my setup). i also needed to pause the game to read the important messages between those spammed lines. at least those lines provided me with some timing, that everything between them happened during the same second :-)
would it be possible to somehow suppress such duplicate warnings (at least for some time like 30 seconds), either at loglevel 3 or by introducing a loglevel 2.5 ?
-----
to remove some ugly paint from my wagons, i had picked them up and set them down again, and thus they were unregistered trains for this mod. maybe a warning should be included somewhere, eg on the OP of this thread, that every new train must be sent to the depot, even if it is already waiting at the depot and only unregistered because the wagons have changed, and it is good enough to click on "send to station (depot)" even when the train doesn't move.
-----
because of this problem i had only one registered train,
and i finally got some useful info from loglevel 3,
and that looks like a real bug (or some really strange internals),
but the following probably is a bit too long, difficult, and uninteresting to the "general public",
thus hidden in a spoiler :-)
lots of detail

doe
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Jul 17, 2016 4:26 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.6.0

Post by doe »

How do i stop my trains going to a provider station below what the minimum pickup is? for example i got -8k as min amount, and it send like 5-6 trains to get varied low amounts even though the prov does not have 8k yet. they go to get like 260 / 100 / 190 / 240 etc etc

i done something wrong with setup or i need to do something to stop this happening?

any help appreciated.

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

Re: [Mod 0.14] Logistic Train Network 0.6.0

Post by Optera »

doe wrote:How do i stop my trains going to a provider station below what the minimum pickup is? for example i got -8k as min amount, and it send like 5-6 trains to get varied low amounts even though the prov does not have 8k yet. they go to get like 260 / 100 / 190 / 240 etc etc

i done something wrong with setup or i need to do something to stop this happening?

any help appreciated.
use_Best_Effort = false
Anson wrote:...
Thanks for testing. Next time please include the logfile at loglevel 4, so i can see in detail what each station has in stock and calculates.

Why is the math off?
When a train is parked at a station it changes calculating item count from value stored in delivery to train inventory. I probably should get rid of that old fluff as well, use the constant delivery amount and update that once a train left a provider.

At debug level 3 and 4 I run into a limitation of the console where it only prints x messages per tick and randomly swallows some.
Using log_output = "log" doesn't seem to have that limit.
That's info normal users don't need, so in order to not overwhelm them I never said anything about it.

Why are orders generated when there are no trains available?
In short I only know how long the train should be once i have a provider.
Logic goes like this
Changing parked trains
Factorio has the nasty habit of recreating the whole train when carriages are added/removed without firing an event. The newly created trains used to be parked at a station in automatic mode, but as there's no event the station never recognized them.
My fix for that makes trains to switch to manual mode whenever you change them. Seems like I forgot to mention this in OP.

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

Re: [Mod 0.14] Logistic Train Network 0.6.2

Post by Optera »

0.6.1/0.6.2: Fixed 2 bugs with how provided item reservations are updated.
- during loading reserved amounts are updated with train inventory
- after leaving the provider the requester gets the actual inventory added
- reservations of a delivery no longer exist once a train finished loading

Some of the odd behavior reported in earlier posts, like trains not seeing items available in the provider, was probably related to these two bugs.

doe
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Jul 17, 2016 4:26 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.6.2

Post by doe »

Installed your latest release, put a train down and sent to depot, when it reached depot i get this error:
Error while running event on_tick (ID 0)
__LogisticTrainNetwork__/control.lua:224: attempt to concatenate field 'from' (a nil value)
Then game crashed, happened 2 times now.

Only thing i did was change best effort from true to false.

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

Re: [Mod 0.14] Logistic Train Network 0.6.3

Post by Optera »

doe wrote:Installed your latest release, put a train down and sent to depot, when it reached depot i get this error:
Error while running event on_tick (ID 0)
__LogisticTrainNetwork__/control.lua:224: attempt to concatenate field 'from' (a nil value)
Then game crashed, happened 2 times now.

Only thing i did was change best effort from true to false.
Thanks for reporting.
I really should stop coding when tired... Those "brilliant" ideas I get when tired always come back to bite me. :roll:

doe
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Jul 17, 2016 4:26 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.6.3

Post by doe »

Optera wrote:
doe wrote:Installed your latest release, put a train down and sent to depot, when it reached depot i get this error:
Error while running event on_tick (ID 0)
__LogisticTrainNetwork__/control.lua:224: attempt to concatenate field 'from' (a nil value)
Then game crashed, happened 2 times now.

Only thing i did was change best effort from true to false.
Thanks for reporting.
I really should stop coding when tired... Those "brilliant" ideas I get when tired always come back to bite me. :roll:
I seen that you released another version. Unfortunately i got exact same error and crash.

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

Re: [Mod 0.14] Logistic Train Network 0.6.3

Post by Optera »

doe wrote:I seen that you released another version. Unfortunately i got exact same error and crash.
You could either stop all trains and pick them up or wait until the faulty deliveries time out.
Loading to before any train left a provider under 0.6.2 would also work.

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

Re: [Mod 0.14] Logistic Train Network 0.7.0

Post by Optera »

Spread stop updates over update_interval. With this change Micro stutters when using several hundred LTN-stops should be gone now.

JREwing
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Feb 02, 2017 7:02 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.7.0

Post by JREwing »

Hello, thank you for a really useful mod.

I have a tip for using and a Nice to have wish.

Iam feeding station with requests generated by circuit with histeresis. Some stations are not reading chests at all. I feed signal from Roboport to hysteresis circuit, and if comodity is below limit (eg. less then 10k of iron plates), it sends a signal (-6k of iron plates) to the station. With Station Minimum delivery size at 2k. And keep sending this signal until amount in network reach higher limit (eg. 30k of iron plates). Then stop sending at all. It always hauling full trains (or maximum what sending station can provide, but not less than 2k).

And Nice-to-have feature would be a Strict size of train signal. I have infrastrucure designed for one size of trains but I would like to use service delivery trains (with one cargo wagon) to haul amunition, repair kits, logistic and repair bots etc. But I want use those small trains for only this job and no other, even if minimum delivery size is lower then capacity of this train. Because loading station could have that amount on position different from the first wagon. Or some requsting station could empty the second locomotive (reverse) fuel, if match with hauling cargo.
I would like to have strict orders for trains, which stations are for 5 cart trains only (and no longer or shorter are allowed), which stations are for 10 cart trains only (and no longer or shorter are allowed) and which stations are for 3 cart trains only (and no longer or shorter are allowed).

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

Re: [Mod 0.14] Logistic Train Network 0.7.1

Post by Optera »

JREwing wrote:Hello, thank you for a really useful mod.

I have a tip for using and a Nice to have wish.

Iam feeding station with requests generated by circuit with histeresis. Some stations are not reading chests at all. I feed signal from Roboport to hysteresis circuit, and if comodity is below limit (eg. less then 10k of iron plates), it sends a signal (-6k of iron plates) to the station. With Station Minimum delivery size at 2k. And keep sending this signal until amount in network reach higher limit (eg. 30k of iron plates). Then stop sending at all. It always hauling full trains (or maximum what sending station can provide, but not less than 2k).
You know you could simply turn off best effort?
And Nice-to-have feature would be a Strict size of train signal. I have infrastrucure designed for one size of trains but I would like to use service delivery trains (with one cargo wagon) to haul amunition, repair kits, logistic and repair bots etc. But I want use those small trains for only this job and no other, even if minimum delivery size is lower then capacity of this train. Because loading station could have that amount on position different from the first wagon. Or some requsting station could empty the second locomotive (reverse) fuel, if match with hauling cargo.
I would like to have strict orders for trains, which stations are for 5 cart trains only (and no longer or shorter are allowed), which stations are for 10 cart trains only (and no longer or shorter are allowed) and which stations are for 3 cart trains only (and no longer or shorter are allowed).
I probably will add a minimum train length signal for convenience. You can get your exact 10 carriages by setting min and max to 10.

JREwing
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Feb 02, 2017 7:02 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.7.1

Post by JREwing »

Optera wrote: You know you could simply turn off best effort?
Yes, I know. Iam using only that option. But I like hysteresis idea. Start hauling under 10k, and stops after reachin 30k. When Iam feeding the content (chest or logisting network) directly to the station, mod substract amount in chests from needed amount. So some trains may not be full. In my situation, trains are always full :-).
Optera wrote: I probably will add a minimum train length signal for convenience. You can get your exact 10 carriages by setting min and max to 10.
That would be really nice feature.

Once again, very usefull mod.

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

Re: [Mod 0.14] Logistic Train Network 0.7.1

Post by Optera »

JREwing wrote:
Optera wrote: You know you could simply turn off best effort?
Yes, I know. Iam using only that option. But I like hysteresis idea. Start hauling under 10k, and stops after reachin 30k. When Iam feeding the content (chest or logisting network) directly to the station, mod substract amount in chests from needed amount. So some trains may not be full. In my situation, trains are always full :-).
Any requester can be set to minimum shipment size >= train inventory size to achieve the same effect of your hysteresis.

With Best Effort on if your provider doesn't have enough to fill a train it will ship what's available. A hysteresis at the requester does nothing to prevent that, you would need to have it at the providers.

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

Re: [Mod 0.14] Logistic Train Network 0.7.1

Post by Optera »

Updated the demo map in OP with stations showcasing a Provider & Requester using a smart loader with counter and a station for iron/copper loading able to unload items inserters held on to.

Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.7.1

Post by Anson »

Optera wrote:Any requester can be set to minimum shipment size >= train inventory size to achieve the same effect of your hysteresis.
how would that be done ?
can you please give us the values for signals at provider and requester to achieve this:
- no transports until requester has less than 10k ore
- when transports start, they are done with 2k delivery size
- transports continue until there are 30k ore
- transports don't stop when (after a few transports) the amount is back between 10k and 30k

although i probably would prefer a more steady flow (instead of peaks which might cause jams when several trains want to load and unload at the same time), i like the idea of setting up additional circuits to tend to special requirements (eg smelting batches of lots of copper and then lots of iron, instead of switching between the two all the time).

the min train length and max train length will be really nice.
(i had suggested that already myself :-)
an alternative could be to specify exact patterns (bitmasks) for engines and wagons, but that would probably be much too complicated to implement, to understand, and to use, and still not include all details that might be useful, eg not knowing the direction of the engines. parameters for min and max length together with specific lengths of trains should achieve good results already.
suggestion - refueling stations and stackers in front of depots
suggestion - LTN already before blue science

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

Re: [Mod 0.14] Logistic Train Network 0.7.1

Post by Optera »

Anson wrote:
Optera wrote:Any requester can be set to minimum shipment size >= train inventory size to achieve the same effect of your hysteresis.
how would that be done ?
can you please give us the values for signals at provider and requester to achieve this:
- no transports until requester has less than 10k ore
- when transports start, they are done with 2k delivery size
- transports continue until there are 30k ore
- transports don't stop when (after a few transports) the amount is back between 10k and 30k

although i probably would prefer a more steady flow (instead of peaks which might cause jams when several trains want to load and unload at the same time), i like the idea of setting up additional circuits to tend to special requirements (eg smelting batches of lots of copper and then lots of iron, instead of switching between the two all the time).
best effort = true
item = -30k
min shipment size = 20k

Will start a 20k order when item is lower than 10k. Best Effort will split the order in multiple shipments filling up all but the last train.
the min train length and max train length will be really nice.
(i had suggested that already myself :-)
an alternative could be to specify exact patterns (bitmasks) for engines and wagons, but that would probably be much too complicated to implement, to understand, and to use, and still not include all details that might be useful, eg not knowing the direction of the engines. parameters for min and max length together with specific lengths of trains should achieve good results already.
An encoded signal for valid train compositions. I like that, but I wonder who even makes use of the current encoded composition signal?
Players seem to struggle coming up with stations that don't lock themselves with inserters holding on to items they couldn't insert. Feeding a binary encoded signal for valid trains is way above the combinator knowledge of most players.
suggestion - refueling stations and stackers in front of depots
By outputing the encoded train composition LTN already allows for a more versatile and complex refueling system than smart trains.
I can see how a single refueling station would be less effort than having one at every depot.
My reasoning against dedicated refueling is this. Most networks need to remove left over items from trains somewhere. Best place to do that is the depot as all trains will go there. That means you end up with a unloading mechanism at every depot so it's just a matter of adding some more inserters and chests to add a refueling system.

Having dedicated refueling station(s) begs a lot of questions:
  • Is this even a feature that will be used by a majority of players?
  • Is it really less effort to ensure all possible stations and depots are reachable from the refueling station than stamping down some chests and inserters in existing depots?
  • How would LTN ever know which refueling station to use?
  • Are we back to using backer names and allow only one specific naming scheme for for refueling across all possible forces?
Why build a stacker in front of the depot? Just plant a LTN-stop at every stacker rail. :roll:
suggestion - LTN already before blue science
Thanks for reminding me. I think I said I'd move it to a pure red/green tech, but somehow forgot about that. It will use a lot of red/greens and while at it i might also add some of bobs science requirements if you use that. :twisted:

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

Re: [Mod 0.14] Logistic Train Network 0.8.0

Post by Optera »

As requested 0.8.0 has Minimum Train length added as signal.
Be careful to not lock a station down by having impossible Minimum Train Length, Maximum Train Length, Minimum Delivery Size combinations :!:
I also changed the tech to need 300 red/green sci packs instead of 150 red/green/blue.

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

Re: [Mod 0.14] Logistic Train Network 0.8.0

Post by steinio »

Hello,

as i was one of the people who burned for this mod instead of some combinator contraptions i now tried to play with it and setted up a simple coal delivery route.
It works plently.

Now i want to set up a liquid route for Py's Creosote.
My depot has two logistic stops called Depot for solids and Depot for liquids and i scheduled the trains for each station.

How can i different if the provider/requester station needs a liquid or a solid train?

Greetings steinio
Attachments
logistic train network.png
logistic train network.png (738.52 KiB) Viewed 6468 times
Image

Transport Belt Repair Man

View unread Posts

Locked

Return to “Logistic Train Network”