old LTN discussion thread

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Locked
ganlhi
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 19, 2017 5:53 am
Contact:

Re: [Mod 0.14] Logistic Train Network 1.1.0

Post by ganlhi » Sun Apr 23, 2017 5:43 am

Hello ! I just noticed a bug in the last release : the 2 seconds inactivity condition is set with AND instead of OR, so my trains actually wait to be full before departing.

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

Re: [Mod 0.14] Logistic Train Network 1.1.0

Post by Optera » Sun Apr 23, 2017 6:37 am

ganlhi wrote:Hello ! I just noticed a bug in the last release : the 2 seconds inactivity condition is set with AND instead of OR, so my trains actually wait to be full before departing.
That's intended.
I got really annoyed by trains leaving stations before my smart loaders had a chance to properly reset so I added a 2s inactivity condition to every station. If you want the old behavior you can set finish_loading to false in the config.
Either disable finish_loading (not recommended) or adapt your loading station design (builds counting inserted items can be found in this thread and in the demo)

ganlhi
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 19, 2017 5:53 am
Contact:

Re: [Mod 0.14] Logistic Train Network 1.1.0

Post by ganlhi » Sun Apr 23, 2017 8:43 am

Optera wrote:That's intended.
I'm confused :?

Right now, my LTN requests 1000 iron plates for the factory, so a train with 1 wagon goes to my smelting area, to get these. Its schedule for this stations is :

Code: Select all

Cargo (Iron plate): 1000
AND Inactivity 2s
OR Elapsed time 300s
So, the station holding more than 20000 iron plates, the train is never inactive until its full. That way, instead of departing with the 1000 plates it requested, it takes a full wagon.

EDIT: I didn't understood the last part of your message. OK, but why ? The old behaviour allowed to not worry about counting, which seems to be one of the advantages of this mod. I feel this is a regression in the useability of the LTN. I don't criticize for nothing, I'm eager to know the reason behind this choice, but right now, I don't understand :)

Zanostra
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Mon Apr 03, 2017 8:03 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 1.1.0

Post by Zanostra » Sun Apr 23, 2017 2:49 pm

I have the same problem.
Then I wanted to turn it off, because I also don't want to make a counting station at every stop.
But I can't find the config.
I downloaded the LTN-mod inside the factorio game, and not from the forums.
But my factorio folder has tons of .LUA or config files, all with almoast the same name.
How do I find the config file of the LTN-mod?

P.S.
a thought came to mind of what I think might be a solution.
the LTN stop sends out logistic signals so that inserters can use them to load the requested items.
is it an option to stop sending out these signals when the cargo-conditions are met?
this way the inserters get no signals anymore, they drop what the're still holding and the 2 secs of inactivity takes place.

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

Re: [Mod 0.14] Logistic Train Network 1.1.0

Post by Optera » Sun Apr 23, 2017 6:24 pm

ganlhi wrote: EDIT: I didn't understood the last part of your message. OK, but why ? The old behaviour allowed to not worry about counting, which seems to be one of the advantages of this mod. I feel this is a regression in the useability of the LTN. I don't criticize for nothing, I'm eager to know the reason behind this choice, but right now, I don't understand :)
Well the reason is in the quote. I rather have slightly more complex loading station for single items than overly complicated contraptions for multi item stations that never quite worked.
Stations providing multiple items needed overly complex logic to work properly. Having trains wait for inserters to finish loading prevents inserters getting stuck and potentially load the wrong item in the next train.
2 combinators (1 combinator with 0.15) hardly qualifies as effort let alone regression.
Zanostra wrote:I have the same problem.
Then I wanted to turn it off, because I also don't want to make a counting station at every stop.
But I can't find the config.
I downloaded the LTN-mod inside the factorio game, and not from the forums.
But my factorio folder has tons of .LUA or config files, all with almoast the same name.
How do I find the config file of the LTN-mod?
you have to unpack the mod and edit config.lua
P.S.
a thought came to mind of what I think might be a solution.
the LTN stop sends out logistic signals so that inserters can use them to load the requested items.
is it an option to stop sending out these signals when the cargo-conditions are met?
this way the inserters get no signals anymore, they drop what the're still holding and the 2 secs of inactivity takes place.
Really does noone read my posts or Friday Facts!?
0.15 will have stops reporting train inventories.

kleopi
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sun Apr 23, 2017 9:01 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 1.1.0

Post by kleopi » Sun Apr 23, 2017 9:08 pm

[BUG]
In Multiplayer my friend and I encountered several bugs.

We updated the Mod from the previous version and loaded our save we did with it.
Trains suddenly got stuck in the Depots, unable to receive tasks anymore.

Also there was (and still is) one train station which seems to be bugged out. Its lamp can be mined and upon mining or destroying the train station a crash follows.

As a coder i can say the crash refers to this script:

Code: Select all

script.on_event(defines.events.on_preplayer_mined_item, function(event)
  local entity = event.entity
  if entity.name == "logistic-train-stop" then
    RemoveStop(entity)
    return
  end

  -- handle removing carriages from parked trains
  if entity.type == "locomotive" or entity.type == "cargo-wagon" then
    entity.train.manual_mode = true
    UpdateStopParkedTrain(entity.train)
    --entity.train.manual_mode = false
    return
  end
end)
script: control.lua
line: 886
Error: attempt to index local 'stop' (a nil value)

Would be nice to see this fixed asap, as these bugs make the game unplayable and removing the mod would be a hassle as we work with a megabase.

Thank you!

~kleopi
Creator of the [TKN] Mods.
Check out our Discord for further information:
http://discord.gg/G9QwJWA

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

Re: [Mod 0.14] Logistic Train Network 1.1.0

Post by Optera » Mon Apr 24, 2017 6:51 am

kleopi wrote:[BUG]
In Multiplayer my friend and I encountered several bugs.

We updated the Mod from the previous version and loaded our save we did with it.
Trains suddenly got stuck in the Depots, unable to receive tasks anymore.

Also there was (and still is) one train station which seems to be bugged out. Its lamp can be mined and upon mining or destroying the train station a crash follows.
Sounds like you had/have another mod placing entities outside my scripts. Older versions of CreativeMode used to do that. If you figure out which mod caused this I'll add an incompatibility warning to the OP.
Until I add removal of broken stops you can use console commands to remove them manually with surface.find_entities and entity.destroy().
script: control.lua
line: 886
Error: attempt to index local 'stop' (a nil value)

As a coder i can say the crash refers to this script:
Posting snippets is utterly pointless when complete error messages contain exact line number and error description.
Having a list of used mods and a loglevel 4 logfile would have helped more.

Edit:
I don't support forks like Grey Goo by Nilaus or Modpacks changing anything except config.lua.
Updating from any of these will break everything if they changed the namespace and you will have to do a clean install.

ray4ever
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Sun Jan 12, 2014 9:22 am
Contact:

Re: [Mod 0.14] Logistic Train Network 1.1.1

Post by ray4ever » Mon Apr 24, 2017 4:10 pm

I just wanted to jump in and say "thank you" for your great mod! Looking forward to your 0.15 release!

tuttifrectte
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Apr 24, 2017 5:13 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 1.1.1

Post by tuttifrectte » Mon Apr 24, 2017 5:27 pm

Hi Optera,

I have not seen any discussion on this. Can you let several stations to have the same name? It would enable LTN to combine with station stacker (http://y2u.be/RDtW6iLR9V0). It could be as simple as this:
- Stations with the same name share their delivery or supply train queue
- Stations with the same name share all their input signals
- Players need to prevent train going into the unintended station (e.g. when one station is already full for deliveries).

Also another suggestion, is it possible to make that trains when finishing their deliveries, check if there is another delivery to do without going back to a depot?

maxtim
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Apr 24, 2017 5:41 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 1.1.1

Post by maxtim » Mon Apr 24, 2017 7:39 pm

ray4ever wrote:I just wanted to jump in and say "thank you" for your great mod! Looking forward to your 0.15 release!
Me Too! I straight up can't play (don't want to play) without this mod. It's so flippin helpful!

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

Re: [Mod 0.14] Logistic Train Network 1.1.1

Post by Optera » Tue Apr 25, 2017 10:46 am

I've started updating my simpler mods first.
More Locomotives, Storage Tank Mk2 and Inventory Sensor are done. I'll probably get to work on LTN tomorrow.

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

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

Post by Optera » Tue Apr 25, 2017 8:20 pm

Here's a quick patch making LTN run with 0.15.
None of the features of 0.15 like fluid wagons, new events, smarter short circuit detection, asf are implemented yet. I originally didn't plan releasing this quick fix, but it seems like RailTanker will not be continued so you will need a way to transition to fluid wagon with LTN.

User avatar
SphynxLoL
Inserter
Inserter
Posts: 21
Joined: Tue Apr 25, 2017 3:32 am
Contact:

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

Post by SphynxLoL » Tue Apr 25, 2017 8:50 pm

Optera wrote:Here's a quick patch making LTN run with 0.15.
None of the features of 0.15 like fluid wagons, new events, smarter short circuit detection, asf are implemented yet. I originally didn't plan releasing this quick fix, but it seems like RailTanker will not be continued so you will need a way to transition to fluid wagon with LTN.
Thanks for the update! Love this mod!

User avatar
Zerogoki1983
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Dec 28, 2014 5:19 pm
Contact:

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

Post by Zerogoki1983 » Wed Apr 26, 2017 2:41 am

I am trying to wrap my head around the coding for the train compisition signals.

If I understand this right it is calculated like this. Starting with 1 for the front each following unit is assigned a vallue double that of the previos position. Like this: 1, 2, 4, 8, 16, 32, 64, 128...
Then each the vallue for possition you have a loko added together witch give me the number I have to put in for the loko signal.

A LL-CCCC-LL would be loko signal 195
L-CC-L -> 9
LL-CCCCCCC -> 3

So if I where to put a signal of 9 into the constand combinator linked to the station it would only akcept L-CC-L trains.
Now would this station also take L-C or L-CC trains? As long as the frist and fourth possition have either a loko or are empty. And the min-max length settings allow it.

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

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

Post by Optera » Wed Apr 26, 2017 6:05 am

Zerogoki1983 wrote:I am trying to wrap my head around the coding for the train compisition signals.

If I understand this right it is calculated like this. Starting with 1 for the front each following unit is assigned a vallue double that of the previos position. Like this: 1, 2, 4, 8, 16, 32, 64, 128...
Then each the vallue for possition you have a loko added together witch give me the number I have to put in for the loko signal.

A LL-CCCC-LL would be loko signal 195
L-CC-L -> 9
LL-CCCCCCC -> 3

So if I where to put a signal of 9 into the constand combinator linked to the station it would only akcept L-CC-L trains.
Now would this station also take L-C or L-CC trains? As long as the frist and fourth possition have either a loko or are empty. And the min-max length settings allow it.
Train composition is a binary signal with the lsb being the position closest to the stop. Factorio only displays it decimal.
Your examples are correct:
LL-CCCC-LL -> Loco b11000011 = 195 and wagon b00111100 = 60
L-CC-L -> Loco b1001 = 9 and wagon b0110 = 6
LL-CCCCCCC -> Loco b000000011 = 3 and wagon b111111100 = 508 (assuming the locos are in front and not pushing the train)

The yellow combinator is read only.
Making only specific compositions allowed at certain stations could be a new feature. So far I didn't get the impression many would understand binary well enough to make use of those signals.

XOffshore
Inserter
Inserter
Posts: 27
Joined: Tue Jul 19, 2016 9:38 pm
Contact:

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

Post by XOffshore » Wed Apr 26, 2017 7:44 am

Optera wrote:Making only specific compositions allowed at certain stations could be a new feature. So far I didn't get the impression many would understand binary well enough to make use of those signals.
Every time Optera thinks about not to introduce cool features for programmers, Donald Knuth drops another one manly tear.

Wondering that binary logic is so complicated for average people.

Image

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

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

Post by Optera » Wed Apr 26, 2017 8:43 am

XOffshore wrote:Image
Some "bug reports" really feel like this.
Wondering that binary logic is so complicated for average people.
There are 10 different kinds of people in the world. Those who understand binary and those who don't. :lol:

User avatar
Zerogoki1983
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Dec 28, 2014 5:19 pm
Contact:

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

Post by Zerogoki1983 » Wed Apr 26, 2017 1:17 pm

Some "bug reports" really feel like this.
Wondering that binary logic is so complicated for average people.
There are 10 different kinds of people in the world. Those who understand binary and those who don't. :lol:
The binary stuff I learned 15 years ago in proffesional school and haven't used it since.

Most poeple who can handle the basics of circuits should be able to do it. All you need is a youtuber who can make a good tutorial vid that shows how it works on a pracktial example in game.

I mean all I needed was someone to walk me through some setups step by step and explain what's happening once to get it.

So right now I can not send a compisition signal into the station lamp like I would with requested item or leght restricktions and so on.
Btw would it be possible to get a signal with the current colour of the station lamp, maybe together with an unique station ID. This could allow for some remote monitoring of the stations in your network

maxtim
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Apr 24, 2017 5:41 pm
Contact:

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

Post by maxtim » Wed Apr 26, 2017 3:16 pm

Make it hexadecimal and really throw the pleebs lol. Personally, I would love the ability to assign train compositions to stations.

User avatar
SphynxLoL
Inserter
Inserter
Posts: 21
Joined: Tue Apr 25, 2017 3:32 am
Contact:

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

Post by SphynxLoL » Wed Apr 26, 2017 6:57 pm

Playing around with the new "Read Train Contents" feature. I have come up with this design/formula.

(Requested amount*-1) + Train Contents = Yellow
(Each *-1) = Green ------ (Each*1) = Red
Green + Red = Yellow
Inserters only active when yellow < 0

Here is the issue I have ran into. Since the inserters are now on "Enable/Disable" mode. Is it even possible to get them to also run on "Set Filter" mode. At the moment this setup will only work with single items. The only work-around I could see is being able to set cargo filters when the schedule is created.

Anyways, here is the setup, pictured below. Works like a charm for single item deliveries.
0.15 Exact Delivery Setup

Locked

Return to “Logistic Train Network”

Who is online

Users browsing this forum: No registered users