old LTN discussion thread

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

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

Re: [Mod 0.14] Logistic Train Network 0.5.0

Post by Optera »

JackTheHat wrote: Ah, I understand why it is the way it is now. Thanks for explaining. I guess my task is designing a depot that can handle all sizes of train. This mod is literally what I have been wanting for a long time as I always liked the idea of having a pool of trains that go where they needed rather than trains specific to each resource type. :D
With the change to train composition output in 0.5.1 it's as simple as having 1 constant combinator and 1 arithmetic combinator to refuel any possible train configuration in the depot. ;)
2016-12-20-17-06-03-3936664.jpg
2016-12-20-17-06-03-3936664.jpg (223.88 KiB) Viewed 8772 times
For more Details, including a bp string refer to the first post under "Train composition"

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.0

Post by Anson »

Optera wrote:I'm using my Inventory Sensor in my test scenario with multiple train sizes. The most simplistic version would switch the fuel inserter on when it detects a locomotive. I've added a check so it wont load fuel above 140 coal so the inserter wont hold coal in its hand.
why 140 ?
because 150-10=140, assuming max 150 coal in engines and a stack bonus of <10 for normal inserters (or not fully researched stack inserters) ?

general hint: never assume that all engines can be loaded with exactly 150 fuel (3 stacks of 50 fuel each).
there are mods that cause engines to have more or less fuel slots (eg 1 fuel slot for cargo engines, or 5 for fast engines), and stack size for fuel is not always 50 (if wood, maybe charcoal, solid fuel, rocket fuel or even artifacts are used as fuel). with the mods that i know of, it can be as low as 10 fuel (1*10) or as high as 2500 fuel (5*500), or even more or less when using mods that change max stack size to 1000 or whatever.

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

Re: [Mod 0.14] Logistic Train Network 0.5.0

Post by Optera »

Anson wrote:
Optera wrote:I'm using my Inventory Sensor in my test scenario with multiple train sizes. The most simplistic version would switch the fuel inserter on when it detects a locomotive. I've added a check so it wont load fuel above 140 coal so the inserter wont hold coal in its hand.
why 140 ?
because 150-10=140, assuming max 150 coal in engines and a stack bonus of <10 for normal inserters (or not fully researched stack inserters) ?

general hint: never assume that all engines can be loaded with exactly 150 fuel (3 stacks of 50 fuel each).
there are mods that cause engines to have more or less fuel slots (eg 1 fuel slot for cargo engines, or 5 for fast engines), and stack size for fuel is not always 50 (if wood, maybe charcoal, solid fuel, rocket fuel or even artifacts are used as fuel). with the mods that i know of, it can be as low as 10 fuel (1*10) or as high as 2500 fuel (5*500), or even more or less when using mods that change max stack size to 1000 or whatever.
I don't assume anything, I know in my test scenario all locomotives hold at least 150 coal and stack bonus of non stack inserters is below 10 making 140 a nice round number.
It should be common sense that you have to tweak those numbers when using different mods.

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

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by Optera »

nosferato wrote:You have my apologies, I guess it would be better just staying and blocking the station, then it'll highlight a problem, i guess there is no real fix for that problem except better rail design
Sorry for taking so long to include a simple config parameter to switch between staying in station forever and moving on after inactivity.
You can now make trains stay forever in a station with stop_timeout = 0

nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by nosferato »

Optera wrote:
nosferato wrote:You have my apologies, I guess it would be better just staying and blocking the station, then it'll highlight a problem, i guess there is no real fix for that problem except better rail design
Sorry for taking so long to include a simple config parameter to switch between staying in station forever and moving on after inactivity.
You can now make trains stay forever in a station with stop_timeout = 0
No probs,
Thank you for making a config option,
I shall give it a go and see
started a new campaign, just got trains up and running, so is perfect timing :D

User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by SHiRKiT »

Hello,

I'm confused on how this work. I have this setup, but the train just doesn't do the delivery. What am I doing wrong here? Thanks for the help!

http://steamcommunity.com/id/shirkit/sc ... crollTop=0

nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by nosferato »

SHiRKiT wrote:Hello,

I'm confused on how this work. I have this setup, but the train just doesn't do the delivery. What am I doing wrong here? Thanks for the help!

http://steamcommunity.com/id/shirkit/sc ... crollTop=0
you need 3 stations to make it work,
a supplier: goods in chest waiting to be delivered, wire the chests to the input on the station, so it knows contents

a requester: wire chests to a constant combinator and set the combinator to show how many you want delivered by setting it to negative (i.e 1000 in chest, and you want it to keep 2000, set the combinator to -2000. this will send signal -1000), wire the combinator and chests to the station input

the depot: just send trains here, dont wire to anything

thats a basic setup, no need to worry about the filters unless you want to prevent certain trains to go to stations or set certain limits on amount of goods sent

User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by SHiRKiT »

nosferato wrote:
SHiRKiT wrote:Hello,

I'm confused on how this work. I have this setup, but the train just doesn't do the delivery. What am I doing wrong here? Thanks for the help!

http://steamcommunity.com/id/shirkit/sc ... crollTop=0
you need 3 stations to make it work,
a supplier: goods in chest waiting to be delivered, wire the chests to the input on the station, so it knows contents

a requester: wire chests to a constant combinator and set the combinator to show how many you want delivered by setting it to negative (i.e 1000 in chest, and you want it to keep 2000, set the combinator to -2000. this will send signal -1000), wire the combinator and chests to the station input

the depot: just send trains here, dont wire to anything

thats a basic setup, no need to worry about the filters unless you want to prevent certain trains to go to stations or set certain limits on amount of goods sent
Thanks, now I got it. So basically the Depot is actually a STACKER. It's a TRAIN depot, not an ITEM depot.

nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by nosferato »

SHiRKiT wrote: Thanks, now I got it. So basically the Depot is actually a STACKER. It's a TRAIN depot, not an ITEM depot.
correct :)

nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by nosferato »

all has been working fine until,
I get this Error with version 0.5.0
Error while running event on_tick (ID 0)
__LogisticTrainNetwork__/control.lua:586:
attempt to index field 'station' (a nil value)

after updating to 0.5.3
it now shows
Error while running event on_tick (ID 0)
__LogisticTrainNetwork__/control.lua:493:
attempt to index field 'station' (a nil value)

after removing and replacing the offending stations i still get this error

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

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by Optera »

nosferato wrote:all has been working fine until,
I get this Error with version 0.5.0
Error while running event on_tick (ID 0)
__LogisticTrainNetwork__/control.lua:586:
attempt to index field 'station' (a nil value)

after updating to 0.5.3
it now shows
Error while running event on_tick (ID 0)
__LogisticTrainNetwork__/control.lua:493:
attempt to index field 'station' (a nil value)

after removing and replacing the offending stations i still get this error
Thanks for the report.

0.5.0 control.lua:586:
Seems like you have a wrong line number here. That line has no reference to a variable/table "station". line 493 from 0.5.3 it should be line 546 in 0.5.0.

0.5.3 control.lua:493:
That error is from a train stored as ready for delivery while being no longer parked in the depot. It tries to read the depot's unit_number, but train.station seems to be nil.
Did you change train composition (removed/added carriages) of trains parked in automatic mode in the depot in versions older than 0.5.2?
I'll add a check against that to the next version.

possible fix: Either send the offending train to a depot so it's correctly registered again or remove/pick up the whole train.

nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by nosferato »

Optera wrote: Thanks for the report.

0.5.0 control.lua:586:
Seems like you have a wrong line number here. That line has no reference to a variable/table "station". line 493 from 0.5.3 it should be line 546 in 0.5.0.
probably was, it was very late and stupid power company lost power, so i was scrabbling to get the info down, in order to shut down puter before ups ran out
Optera wrote: 0.5.3 control.lua:493:
That error is from a train stored as ready for delivery while being no longer parked in the depot. It tries to read the depot's unit_number, but train.station seems to be nil.
Did you change train composition (removed/added carriages) of trains parked in automatic mode in the depot in versions older than 0.5.2?
I'll add a check against that to the next version.
i hadn't changed the trains, and they are all sat in the depot as my factory has shut down whilst i get oil up and running, however, i was rebuilding my depot setup and moved the trains into one stack
Optera wrote: possible fix: Either send the offending train to a depot so it's correctly registered again or remove/pick up the whole train.
i shall give it a go

nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.3

Post by nosferato »

Optera wrote: possible fix: Either send the offending train to a depot so it's correctly registered again or remove/pick up the whole train.
sent all trains off to factory (unload) to return to the depot, no luck there, so i remove them all, that worked, i then started to remove them all one by one, to find the offending train, which i did find, though i didn't find anything out of the ordinary from it, it wasn't even parked at the depot, but at a signal on it's way to the depot :/
its fixed now so thank you for pointing me in the right direction, just got no idea how it broke

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

Re: [Mod 0.14] Logistic Train Network 0.5.4

Post by Optera »

Here's a release with 2 features I wanted to include for a while, but didn't have time until the holidays.
  • Depots use a signal to flag them as such
    Now you can have multiple depots in one network with different names, trains will always return the depot they where originally sent.
  • Stop's Input and Output are included in blueprints
    Circuit connections can finally be saved in blueprints. (Sometimes they need to be pasted a second time after spawning the entities)
I also updated the BP string in OP to include depot signal and circuit connections.

User avatar
Ragnaman
Inserter
Inserter
Posts: 47
Joined: Sun Apr 10, 2016 10:06 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.4

Post by Ragnaman »

In the image example you have wired inserters, but instructions tell only to wire chests.
The wiring in images is a bit confusing.


This mod is something i had in mind, im awed that someone figured out how to do it and implemented the logic. Trying to wrap my head around instructions.


I got it to working state. Biggest confusion was that the DEFAULT_MINIMUM_DELIVERY_SIZE = 1000
Suggestions:
1) I would recommend setting it to 0, so that new users of mod are less confused, and if they would want to optimise their LTN then they would set such default minimum.
(Just my observation, i was thinking that my wiring is wrong, but once i set default delivery as 1, train started working.)
2) Add point by point instructions to the technology description, so folks are not so lost when they have the tech.


Its pure magic, awesome work. Now it is a must-have mod.
|
| Mods: Greenhouse with modules
| Hobby artist (CAD) | Hobby coder | Lead Software Engineer | Employed
|

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

Re: [Mod 0.14] Logistic Train Network 0.5.4

Post by Optera »

Ragnaman wrote:In the image example you have wired inserters, but instructions tell only to wire chests.
The wiring in images is a bit confusing.


This mod is something i had in mind, im awed that someone figured out how to do it and implemented the logic. Trying to wrap my head around instructions.


I got it to working state. Biggest confusion was that the DEFAULT_MINIMUM_DELIVERY_SIZE = 1000
Suggestions:
1) I would recommend setting it to 0, so that new users of mod are less confused, and if they would want to optimise their LTN then they would set such default minimum.
(Just my observation, i was thinking that my wiring is wrong, but once i set default delivery as 1, train started working.)
2) Add point by point instructions to the technology description, so folks are not so lost when they have the tech.


Its pure magic, awesome work. Now it is a must-have mod.
Thank you. Please be more precise what instructions in the OP are unclear. As the one developing the whole thing it's hard to see where others might struggle to follow. ;)

The default 1k size is there to have the system work as intended out of the box. If setting up a logistic network for the first time and trains start rushing off delivering 5 iron ore here and 10 plates there it's not only highly inefficient, but would also make players try to add more trains to the system for the wrong reasons.
You never even have to touch the default as you can override it to be 1 item per station with signals.

I don't know if i can fit the whole OP in the tech description.

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.4

Post by Anson »

Optera wrote:Please be more precise what instructions in the OP are unclear.
As the one developing the whole thing it's hard to see where others might struggle to follow.
I like taking things to the extreme, and i also like unusual setups. thus a lot of what i do and write here are only my own observations and probably won't apply to most people who start using the mod with a simple vanilla train network.

now i am following the OP, read everything, but on the practical side wanted to know first about which signals are available and thus started building with the chapter on train composition ...

with some background in IT, the binary decoders were easy to understand, but implementing them in factorio is a good example for some kind of Columbus' Egg :-)

it was really nice to have a picture and also a blueprint so that i could skip calculating the powers of 2 myself. but when i put down the blueprint, it didn't work :-(
the blueprint was already adjusted for the newest version that requires a "this is a depot" signal (by having that signal on the combinator), but the input and output of the station were not connected to the rest of the blueprint. i needed to place down the blueprint a second time to finish the connections. afaik, this can happen when mods exchange some items for others on placement, but it can be confusing at first.

also, the items in the blueprint are nicely and very compactly placed next to each other. in a real setup that would be best, but in a test/demo setup, it might be better to have small gaps between items so that it is easier to see all connections and understand which items need to be wired to which other items.

the description said "Example: A depot able to service any train composition of length 4 or lower.", and it even had the constants in the combinator for doing length up to 10. maybe on the next update this should be reduced to the required signals 0-3 only, or extended to have all signals for the max train length with signals up to V so that people can easily expand the layout to any possible length.
here is a simple blueprint with three combinators to hold all 32 values from 2^0 to 2^31 :

Code: Select all

H4sIAAAAAAAA/7WVSY+kIBzFv4rxbCXsYDoeZt/35VqxlZohsaBCUT3dMX73xhkF+zAJJDM3o/AL7+97j94Ug+naodg3o+qMPjfjqHQvbxtYndUP3Q7N6O5O
simVk8ey0u3RP88LXavdrjPHa6VbZ2w5TVMltVNOyRny94XVyZz9KqOb8bbZwequAVPVKyu73y9Z5Tc5a4b9tfzZ3ihjm/GgBiftjH14phtl3aUd1mP9+bgD
5eQZF+2aHYKEE4EZEdWiaqqSGDAwIOCYEygQWRAoEYECgmImOKghWgg4kYADATFBMCWULQSSSCBRBiYIco7WQdBEAg0ExiEQgq1jYIkAFgAYU0oIXqfAEwE8
amDcK4DrEEQiQASAwF4AWEdQJ+6vw34Ca4LBOgEIEgGP4n8ENYd0nQBMdePjjRuJoHydAEz14pPoRUSQCGlIdeLTjRN9psIEUn34bONDH6gwADrNtZFaFv+h
K75FYZkN8T1KCsWQIwb8ezHPY1ap75xMQS9iUBFnIrPtXm5SigXJbLpXMaKwRpkl9zrmE9Qss9/ebLIZbonUbnu7yWW4H1J77V3MZLgZUivtfTx1uBNS6+xD
PHS4DZKr7GO0GMltsU8bg+UW2OeNvXLL60s0V25vfY3WelBZ07LsZH75eBbmUKDiYGwxJ93eFb3sTO8/lNOVle5idbG/krq/B7c0ag5tCQAA
but when i sent a train to that depot, it still didn't work since i was not using vanilla diesel engines and vanilla wagons, and thus it doesn't work for all train compositions :-)

instead of having one signal for the number and position of all engines in the train, the mod gives different signals for "number and position of diesel engines", "number and position of FARL engines", "number and position of junk engines", etc. as result, my engines were not recognized as engines by that blueprint.
by having combinators that convert all those signals to one signal, i could achieve the desired effect of making it work for all my trains (although it might be questionable whether i should have different engines and different trains on one network and one depot), but it still is another Columbus' egg for me to do it nicely with as few combinators as possible.
it would be nice if the mod itself could provide an additional general signal for "number and position of ANY engines".
similar applies also to the signals for wagons ("number and position of vanilla wagons", "... of stainless steel wagons", etc, and a combined signal "... of ANY wagons").

finally, i noticed two more problems when taking the "able to service any train composition" too literally.

the layout has conditional unloaders to active provider chests (unload when it is no engine) for wagons at positions 1 to 3, but no unloader for "push wagons" in front of the first engine at position 0 :-)

the other problem is that i didn't understand at first why you have unloaders in a depot at all. it only dawned on me that that is yet another Columbus' egg you invented, after i wrote the following paragraph ...

more serious problem : the fuel inserters only work reliably when you don't have a stack bonus yet. as soon as inserters get a stack bonus, most of the time they will stop loading fuel and still have some fuel in their hands. if the next train has another composition with wagons at the same positions where the first train had engines, those remaining fuel will be dropped into the wagons even when the fuel inserters are disabled. this results in wagons having a partial stack of fuel, not being able to be fully loaded later, etc.
solving this problem is not easy. for loading wagons without any rest remaining in the hands of inserters, loading can be aborted before the wagon is full. for loading fuel, the task is quite difficult.


and this is the Columbus' egg: you simply let the fuel be put in the wagons, but then use the unloader to take it out again, and everything is fine. and that is also the reason why you have unloaders at a depot at all.

@optera: "Attention! genius at work" ... may i call you Columbus now ? :-)


edit: PS: when i was done with my tests on the depot, i deleted the entire test setup and built a nice depot. i did it exactly as before, but: when i connected a constant combinator that had the signal "stop is a depot" to one stop it lit up green (OK) and a second stop with the same name was pink (duplicate name only for depots). now the problem/bug : as soon as i chained that signal to the second stop, both lit up green for a second and then turned red (error).
after some experimenting i found the reason: on my test setup i had used red wires, and on the final setup i had used green wires instead ... is this really intended ?
in the blueprint, you use green wires too, but you only connect the constant combinator to one stop. as soon as you build another stop on the blueprint layout and chain the green wire from the first to the second stop, both stops first light up green for a second and then red.

User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.5.4

Post by SHiRKiT »

Now that I started using this mod, I can't play without it, as my setups are 300% more efficient IMO. Thanks for the mod!

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

Re: [Mod 0.14] Logistic Train Network 0.5.4

Post by Optera »

Anson wrote: with some background in IT, the binary decoders were easy to understand, but implementing them in factorio is a good example for some kind of Columbus' Egg :-)

it was really nice to have a picture and also a blueprint so that i could skip calculating the powers of 2 myself. but when i put down the blueprint, it didn't work :-(
the blueprint was already adjusted for the newest version that requires a "this is a depot" signal (by having that signal on the combinator), but the input and output of the station were not connected to the rest of the blueprint. i needed to place down the blueprint a second time to finish the connections. afaik, this can happen when mods exchange some items for others on placement, but it can be confusing at first.
Sadly I can't take credit for coming up with that single combinator decoder. It's a XKnight design I struggled to understand for an hour myself, which is why I added the BP String, so those who don't know about binary representation can start using it.
the description said "Example: A depot able to service any train composition of length 4 or lower.", and it even had the constants in the combinator for doing length up to 10. maybe on the next update this should be reduced to the required signals 0-3 only, or extended to have all signals for the max train length with signals up to V so that people can easily expand the layout to any possible length.

instead of having one signal for the number and position of all engines in the train, the mod gives different signals for "number and position of diesel engines", "number and position of FARL engines", "number and position of junk engines", etc. as result, my engines were not recognized as engines by that blueprint.
by having combinators that convert all those signals to one signal, i could achieve the desired effect of making it work for all my trains (although it might be questionable whether i should have different engines and different trains on one network and one depot), but it still is another Columbus' egg for me to do it nicely with as few combinators as possible.
it would be nice if the mod itself could provide an additional general signal for "number and position of ANY engines".
similar applies also to the signals for wagons ("number and position of vanilla wagons", "... of stainless steel wagons", etc, and a combined signal "... of ANY wagons").
I kept presets for up to 10 carriages to make expanding a bit easier on players.

I guess I'm guilty of using marketing speech when declaring it "A depot able to service any train composition of length 4 or lower". The correct description "a depot able to service any L-x composition with base locomotives" doesn't sound nearly as nice :D

Adding general locomotive and wagon detected signals is easily done, but I refrained from adding any more signals as they add up quite fast. They might also be useless when used with mods like Junk Train or Yuoki Rails. Those have different carriage lengths than base, so you will need to use setups that can not only service any order but also account for different length.
What I do when servicing multiple locomotives with only base cargo wagon and rail tanker is I switch the logic from locomotive signal to cargo wagon signal and use an arithmetic combinator with "cargo wagon + rail tanker = cargo wagon".
finally, i noticed two more problems when taking the "able to service any train composition" too literally.

the layout has conditional unloaders to active provider chests (unload when it is no engine) for wagons at positions 1 to 3, but no unloader for "push wagons" in front of the first engine at position 0 :-)

the other problem is that i didn't understand at first why you have unloaders in a depot at all. it only dawned on me that that is yet another Columbus' egg you invented, after i wrote the following paragraph ...

more serious problem : the fuel inserters only work reliably when you don't have a stack bonus yet. as soon as inserters get a stack bonus, most of the time they will stop loading fuel and still have some fuel in their hands. if the next train has another composition with wagons at the same positions where the first train had engines, those remaining fuel will be dropped into the wagons even when the fuel inserters are disabled. this results in wagons having a partial stack of fuel, not being able to be fully loaded later, etc.
solving this problem is not easy. for loading wagons without any rest remaining in the hands of inserters, loading can be aborted before the wagon is full. for loading fuel, the task is quite difficult.


and this is the Columbus' egg: you simply let the fuel be put in the wagons, but then use the unloader to take it out again, and everything is fine. and that is also the reason why you have unloaders at a depot at all.

@optera: "Attention! genius at work" ... may i call you Columbus now ? :-)
I never thought anyone would be pushing cargo wagons.Are you running a CC-LL-CC setup or something similar? If so what are the benefits to a L-CCCC-L composition?

Thanks for the flower.
The depot unloaders where originally added to clean out cargo wagons of items getting stuck in them by stupid inserters at stations providing multiple items. Cleaning out stuck fuel is the bonus.
edit: PS: when i was done with my tests on the depot, i deleted the entire test setup and built a nice depot. i did it exactly as before, but: when i connected a constant combinator that had the signal "stop is a depot" to one stop it lit up green (OK) and a second stop with the same name was pink (duplicate name only for depots). now the problem/bug : as soon as i chained that signal to the second stop, both lit up green for a second and then turned red (error).
after some experimenting i found the reason: on my test setup i had used red wires, and on the final setup i had used green wires instead ... is this really intended ?
in the blueprint, you use green wires too, but you only connect the constant combinator to one stop. as soon as you build another stop on the blueprint layout and chain the green wire from the first to the second stop, both stops first light up green for a second and then red.
Connecting lamps of different stops is not intended. ;)
Short Circuit detection checks if a lamp always receives only one color signal. Since the hidden combinator, providing the lamp color signal, is connected by green wire those add up when connecting lamps with green wires triggering the detection.
I felt like I had to add some protection against short circuiting input and output, but I may remove it or change the detection logic when stops start outputting train inventories in 0.15.
SHiRKiT wrote:Now that I started using this mod, I can't play without it, as my setups are 300% more efficient IMO. Thanks for the mod!
Glad to hear you got it running that well.

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.4

Post by Anson »

Optera wrote:Sadly I can't take credit for coming up with that single combinator decoder. It's a XKnight design I struggled to understand for an hour myself, which is why I added the BP String, so those who don't know about binary representation can start using it.
even though you might not have invented that decoder, you have added the binary encoded signals, and thus made it possible to use the decoder in stations etc.

today, people grow up with computers and are only using programs, and many don't know a bit (pun intended) about bits, bytes and logic. although it is not necessary to know such details when using an Xbox or a smartphone, it's always good to have at least a basic understanding of the basics. when i got in contact with computers for the first time, it was a teaching program for boolean logic on a typewriter terminal of a PDP-11 (probably a PDP-11/20) :-)
Optera wrote:I guess I'm guilty of using marketing speech ...
"a depot able to service any L-x composition with base locomotives" doesn't sound nearly as nice :D
:-)
just add the unloader for the first position and you can almost keep the original description
"A depot able to service any vanilla train composition of length 4 or lower"
Optera wrote:
Anson wrote:it would be nice if the mod itself could provide an additional general signal for "number and position of ANY engines" (or wagons).
Adding general locomotive and wagon detected signals is easily done, but I refrained from adding any more signals as they add up quite fast. They might also be useless when used with mods like Junk Train or Yuoki Rails. Those have different carriage lengths than base, so you will need to use setups that can not only service any order but also account for different length.
What I do when servicing multiple locomotives with only base cargo wagon and rail tanker is I switch the logic from locomotive signal to cargo wagon signal and use an arithmetic combinator with "cargo wagon + rail tanker = cargo wagon".
in my test setup, i currently have 6 such engine signals, 6 such wagons signals, and 4 other signals from your mod. when i reenable other mods and get things like wagon MK2 and MK3, electric engines, etc, that will add up quickly on the number of signals, but combined signals will only be just one more signal for engines and wagons, no matter how many different units i add.
the length of junk train units seems to be only a bug in that mod and not intended, caused by bad conversion from the old system of having different lengths for horizontal and vertical stations. and mixing of engines and wagons with different length is no good idea anyway.

i converted the signals similarly to what you suggest. but i let the addition be done by just connecting combinators in parallel, chaining the station's output to all their inputs and chaining all their outputs to the final decoder combinator. this way more "converters" can easily be added for other engine or wagon types, and the signal propagation time is always a constant 1 (or 2 including the decoder).
The problem with this setup is that i need to do this work for each single depot station, in my case for a total of 20*6=120 combinators on my 20 slot stacker. doing it for wagons instead of engines would be the same since i also have 6 wagon types (some of them nort used, but i probably won't remember that when adding more wagons someday). a combined signal from the mod would greatly reduce work and space to set this up.
edit: on reading what i just wrote, i got an idea to halve the number of combinators. instead of "engine1 * 1 = diesel engine", etc six times, i can simply do "engine1 + engine2 = diesel engine", etc three times (connecting all three outputs just like i did before with six outputs). any ideas for reducing that even more ?
Optera wrote:I never thought anyone would be pushing cargo wagons.
Are you running a CC-LL-CC setup or something similar?
If so what are the benefits to a L-CCCC-L composition?
it's much simpler than that :-)
on some maps, i use "oneway trains" (anything from L-C to LLL-CCCCCC) setups. when i need more wagons or more engines, i can easily add them to the respective end of the train. if i only need more engines I also can add them to the end to help by pushing the train and thus don't need to adjust all loading and unloading stations.
on other maps i use "twoway trains" like L(forward)-C-L(backward), sometimes even with different numbers of engines for the two directions (depending on whether the train only goes backwards for leaving a terminus station and then turns around again, or whether it always goes forward when fully loaded and backward when empty) and it is only easy to add more engines to these trains for either direction, but not wagons. this also includes simple cases like using a LL setup for "personal transport" to get around quickly and adding a wagon to either end of it for transporting some items eg when i have harvested too much wood or artifacts.
if i temporarily add a wagon to such LCL trains, i end up with LCLC or CLCL and want to be prepared for such cases. in general, i prefer building "defensively", to always be prepared and not get surprising problems much later when i already have almost forgotten about the restrictions of depots that i built days before.

anyway, when there is almost no cost in adding a simple inserter with chest to position 0, why make it differently than for all other positions ? :-)
Optera wrote:Connecting lamps of different stops is not intended. ;)
Short Circuit detection checks if a lamp always receives only one color signal. Since the hidden combinator, providing the lamp color signal, is connected by green wire those add up when connecting lamps with green wires triggering the detection.
that makes sense, but as unsuspecting user, i wanted to save on setting up a separate constant combinator with the "stop is depot" and all the power-of-2 signals for each of 20 depot stops. i was a bit confused at first when i saw you inputting additional signals to the station, but after thinking for a moment, i saw that those signals were not for real items, but only for signals 0-9. thus it was too tempting to directly chain the signals from one combinator to all those stations ...

btw: i also chained one constant combinator to all requester chests and set all requester chests to "Mode of Operation: set requests". by only changing the value in that single constant combinator, i now can reprogram the whole system to fuel trains with one or more other types of fuel, eg when i have too much wood, or when i start working with oil, using solid fuel or rocket fuel, or with some mods even burning alien artifacts. the only problem i noticed when changing the fuel type is on trains that have only one fuel slot or that useup all their fuel slots for long roundtrips since they start refueling with the new type only when the last unit of the old fuel is used up, and that almost always isn't good enough to go back to the depot in time (worst when switching from wood and/or for longer distances)
Optera wrote:I felt like I had to add some protection against short circuiting input and output,
until now, i never had problems accidentally connecting input and output. but a few times, i misclicked and connected wires to the station itself instead of the input or output because the station partially overlaps input and output.
btw: really nice that you gave proper names to those components, eg "Logistic Train Stop Input" instead of "Lamp" :-)
SHiRKiT wrote:Now that I started using this mod, I can't play without it, as my setups are 300% more efficient IMO.
it takes a bit away from the challenge of managing everything yourself and setting up huge contraptions with hundreds of combinators. but i won't miss that challenge and instead keep on watching other people who do that (there is a thread about this).
I might try to do some other challenges instead, maybe a megafactory with almost no belts (at least no mainbus) and no robots (at least reducing robot range to single roboports, one for each station), and for any transport using only trains with this mod :-)

Locked

Return to “Logistic Train Network”