[0.17/0.18] LTN Combinator

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

dockmeister wrote: Thu Apr 11, 2019 5:03 pm
nuhll wrote: Thu Apr 11, 2019 10:53 am Oh thats sad, because thats the most irritating part. Could you add that functionality? Or add another combinator? (best in the world would be one combinator which jsut need to be added with green and red signal)
It is possible to mod one entity with multiple combinators and i actually started the mod with such a feature in mind. I decided later not to implement such a feature.

The main reason for that is increased complexity with a loss of flexibility and very little gain. I might look into that in the future, but there are some hurdles on the form of API limitations on the horizon.
WHat you mean? how can one combinator instead of (out of my mind 4?) combinators be more hard? :D Just standardize it, like left always to inventory and right always to inserters. Or make a dropdown (dont know if that is possible) where u can select "Inserter Cable:" [DROPDOWN] "connected Green Cable, connected Red Cable"
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

I created some artwork to show what i mean. Coolest thing would be a LTN stop which combines the best from your mod (nice UI) and the function of the vanilla LTN stop. So you only would need to wire the Stop with chest and inserters, set options in UI and finish.

Fast and "easy" solution
easiest solution.jpg
easiest solution.jpg (45.53 KiB) Viewed 7792 times
Nice to have UI implementation (select what is connected means pick red or green wire)
nice to have UI.jpg
nice to have UI.jpg (85.8 KiB) Viewed 7792 times
eduran
Filter Inserter
Filter Inserter
Posts: 344
Joined: Fri May 09, 2014 2:52 pm
Contact:

Re: [0.17] LTN Combinator

Post by eduran »

Its a lot more complicated than that. You also need to connect the station itself. That makes two inputs and two outputs. Using a Constant combinator is no longer sufficient. A single entity with four different (and easily to distinguish) connection points is not something that is simple to implement. From a player's point of view I'd like to have all that functionality, but as a modder a can already see a lot of problems.
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

eduran wrote: Fri Apr 12, 2019 1:42 pm Its a lot more complicated than that. You also need to connect the station itself. That makes two inputs and two outputs. Using a Constant combinator is no longer sufficient. A single entity with four different (and easily to distinguish) connection points is not something that is simple to implement. From a player's point of view I'd like to have all that functionality, but as a modder a can already see a lot of problems.
Yes, youre right, i forgot that one cable to LTN output if im correct?

Can u have LTN lamp, inventory and LTN output on one cable?
mrvn
Smart Inserter
Smart Inserter
Posts: 5855
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.17] LTN Combinator

Post by mrvn »

dockmeister wrote: Thu Apr 11, 2019 5:03 pm
nuhll wrote: Thu Apr 11, 2019 10:53 am Oh thats sad, because thats the most irritating part. Could you add that functionality? Or add another combinator? (best in the world would be one combinator which jsut need to be added with green and red signal)
It is possible to mod one entity with multiple combinators and i actually started the mod with such a feature in mind. I decided later not to implement such a feature.

The main reason for that is increased complexity with a loss of flexibility and very little gain. I might look into that in the future, but there are some hurdles on the form of API limitations on the horizon.
I want something like that too but it's realy hard to implement. You can't have a LUA script that reads out signals, computes something and sets a result. While technically possible the CPU overhead brings the game to a standstill. There is no way in LUA to only run the computation if the input signal changes. So you have to run the script for every LTN stop on every tick. That quickly becomes too much overhead. So the only way is to implement this with vanilla combinators and have a dummy entity that construct the combinator network when placed or tears it down when deconstructed. And you see how well that works with preserving the wires to other entitites with LTN stops already. The same problems would arrise with a custom combinator.

One thing I want to have are output signals for how much surplus a provider station has (supply - provider limit) and how much lack a requester station has (request + requester limit). That has to be computed in stacks now so one combinator per item. Only sane way to do that is to add this to something like the LTN Combinator. Every time you change what is provided or requested it would add or remove combinators under the hood. But so far all just ideas.
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

mrvn wrote: Fri Apr 12, 2019 2:16 pm
dockmeister wrote: Thu Apr 11, 2019 5:03 pm
nuhll wrote: Thu Apr 11, 2019 10:53 am Oh thats sad, because thats the most irritating part. Could you add that functionality? Or add another combinator? (best in the world would be one combinator which jsut need to be added with green and red signal)
It is possible to mod one entity with multiple combinators and i actually started the mod with such a feature in mind. I decided later not to implement such a feature.

The main reason for that is increased complexity with a loss of flexibility and very little gain. I might look into that in the future, but there are some hurdles on the form of API limitations on the horizon.
I want something like that too but it's realy hard to implement. You can't have a LUA script that reads out signals, computes something and sets a result. While technically possible the CPU overhead brings the game to a standstill. There is no way in LUA to only run the computation if the input signal changes. So you have to run the script for every LTN stop on every tick. That quickly becomes too much overhead. So the only way is to implement this with vanilla combinators and have a dummy entity that construct the combinator network when placed or tears it down when deconstructed. And you see how well that works with preserving the wires to other entitites with LTN stops already. The same problems would arrise with a custom combinator.

One thing I want to have are output signals for how much surplus a provider station has (supply - provider limit) and how much lack a requester station has (request + requester limit). That has to be computed in stacks now so one combinator per item. Only sane way to do that is to add this to something like the LTN Combinator. Every time you change what is provided or requested it would add or remove combinators under the hood. But so far all just ideas.
I cant say anything to the technical solution for this, as i have 0 programming knowledge. If u need more functionallity to make this work, request it from the devs... :)

First thing that comes in my mind is a random check only every "what ever" till "what ever" ticks. So not all stops would work at the same time.

From user perspective the best solution would be a 1 entity with GUI. Next would be 3 (LTN stop, your combinator, another of your combinators for inserters, chests).
dockmeister
Inserter
Inserter
Posts: 48
Joined: Tue Feb 26, 2019 5:49 pm
Contact:

Re: [0.17] LTN Combinator

Post by dockmeister »

eduran is right.
It is possible to modify a combinator to serve as constant and arithmetic combinator. But it would need 4 wires and that is hard to implement intuitively for the user.

There would be a way around that, but there is no event being raised by factorio whenever an entity is dis-/connected to a circuit network.

I don't see a way to implement such a feature, in a way that would be an improvement over current solutions.
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

What is missing? Maybe we can request it?
dockmeister
Inserter
Inserter
Posts: 48
Joined: Tue Feb 26, 2019 5:49 pm
Contact:

Re: [0.17] LTN Combinator

Post by dockmeister »

Factorio currently does not notify mods if and when the user connects or disconnects an entity to a circuit network.
With such an event i could reduce the needed connections to two outputs:
1 output for the LTN Station
1 output for inserters

That would make this feature feasible.

There are already several interface requests like that. I will bump one those later. But don't get your hopes up - one of the requests is from 2017 and WUBE is currently not focused on implementing interface requests.
mrvn
Smart Inserter
Smart Inserter
Posts: 5855
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.17] LTN Combinator

Post by mrvn »

nuhll wrote: Sat Apr 13, 2019 8:29 am What is missing? Maybe we can request it?
Combinators are really limited for modders.

1) Lamps let you read out signals.
2) Constant combinator lets you set a limited amount of signals.
3) Other combinators have hardcoded functions.

Any per-tick updates are out of the question performance wise. And inserters need the correct item counts per tick.

So there really is no way around of using the vanilla combinators, program them and wire them up to the train stop as you would do manually. This can happen in LUA. So my approach would be to extend the LTN stop to include the vanilla combinators and programing. So you only have to place one entity.

The problem remains though. The wires to the outside are flakey at the moment for some reason. So in a BP you might still end up with no wire from the train stop to the inserters.
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

Maybe dont use combinators then? Couldnt this be more efficient done via other modder methods?
mrvn
Smart Inserter
Smart Inserter
Posts: 5855
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.17] LTN Combinator

Post by mrvn »

nuhll wrote: Sat Apr 20, 2019 8:36 am Maybe dont use combinators then? Couldnt this be more efficient done via other modder methods?
It's the same for all entities. Constant combinator and Lamp are just the go-to entity because all they have is a wire connetion and no overhead. Working with signals in LUA is very slow. It's a bad API interface.
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

and theres no other way to give ltn the correct commands?
mrvn
Smart Inserter
Smart Inserter
Posts: 5855
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Can't switch from a provider+requester mode to just provider or requester

Post by mrvn »

After using an LTN combinator to be both provider and requester it is impossible to turn on of the options off again. The combinator remembers the signals being set from the combined mode so next time the GUI is opened it shows up as provider+requester again. Disabling provider or requester and exiting the GUI should remove the respective signals and return the combinator to single mode again.
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

Lets Brainstorm.

On the one hand we have a user which want to have everythign as easy as possible. Best for this would be one entity, max 2, connected with cables accordingly.

On the other side we have factorio with LTN, LTN works via vanilla combinators and arithmetic and so on.

The question is now, can we give/read the correct commands from LTN in a more efficient way (userfriendly) then its currently. Without thinking at the current limitations from the game (these we could maybe change if we ask)
eduran
Filter Inserter
Filter Inserter
Posts: 344
Joined: Fri May 09, 2014 2:52 pm
Contact:

Re: [0.17] LTN Combinator

Post by eduran »

nuhll wrote: Wed Apr 24, 2019 9:17 am The question is now, can we give/read the correct commands from LTN in a more efficient way (userfriendly) then its currently. Without thinking at the current limitations from the game (these we could change if we ask)
It would be possible to make such a combinator. But coding an UI and properly working multi-piece entities is not easy. For a sense of scale: LTN-C has ~1700 lines of code, LTN-T has ~4200. Nothing wrong with figuring out how it could work and would ideally look. But you still need to find someone who is willing to put quite a bit of effort into making it a thing.
nuhll
Filter Inserter
Filter Inserter
Posts: 942
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: [0.17] LTN Combinator

Post by nuhll »

eduran wrote: Wed Apr 24, 2019 9:36 am
nuhll wrote: Wed Apr 24, 2019 9:17 am The question is now, can we give/read the correct commands from LTN in a more efficient way (userfriendly) then its currently. Without thinking at the current limitations from the game (these we could change if we ask)
It would be possible to make such a combinator. But coding an UI and properly working multi-piece entities is not easy. For a sense of scale: LTN-C has ~1700 lines of code, LTN-T has ~4200. Nothing wrong with figuring out how it could work and would ideally look. But you still need to find someone who is willing to put quite a bit of effort into making it a thing.
Maybe if we find a good way to imrpove LTN a programer has some pity for us non programmers and make it... :)
Blokus
Fast Inserter
Fast Inserter
Posts: 246
Joined: Tue Mar 05, 2019 2:49 pm
Contact:

Re: [0.17] LTN Combinator

Post by Blokus »

nuhll wrote: Thu Apr 11, 2019 12:32 pm
mrvn wrote: Thu Apr 11, 2019 11:15 am
nuhll wrote: Thu Apr 11, 2019 10:53 am
dockmeister wrote: Thu Apr 11, 2019 7:05 am
nuhll wrote: Wed Apr 10, 2019 9:13 pm Do i still need these "* -1" and arithemtic "yellow * yellow"? Or does that he automatic?
Hi,

LTN-Combinator is just a replacement for a constant combinator. You have to connect a LTN-C to a LTN Input Lamp.
If you want to control inserters, you still have to use an arithmetic combinator.

cheers
Oh thats sad, because thats the most irritating part. Could you add that functionality? Or add another combinator? (best in the world would be one combinator which jsut need to be added with green and red signal)
Just make yourself a blueprint with the arithmetic combinator and LTN stop in it. That way you also get the wires too.

Blueprints of full stations with all the inserters and signals is also useful.
Yeah, ive used to do this.

But its bugged since 0.17. cables disappear... or poles cant be upgraded (i use bobs and angels and many many other mods)

I would even pay if you could do this.

like one combinator for everything.

green cable (from ltn lamp) to your connector -> to chest
red wire from ltn stop to your connector -> to inserters
If you want a mega-combinator, the Advanced Combinator mod may be helpful to you. Unfortunately I have found it a bit deficient for some things that seem like they should be reasonable. Also, to avoid UPS hell even when your base is small, you wind up needing to lower the tick rate, which means you need to take the tick rate into account in your designs.
nuhll wrote: Fri Apr 12, 2019 1:58 pm
eduran wrote: Fri Apr 12, 2019 1:42 pm Its a lot more complicated than that. You also need to connect the station itself. That makes two inputs and two outputs. Using a Constant combinator is no longer sufficient. A single entity with four different (and easily to distinguish) connection points is not something that is simple to implement. From a player's point of view I'd like to have all that functionality, but as a modder a can already see a lot of problems.
Yes, youre right, i forgot that one cable to LTN output if im correct?

Can u have LTN lamp, inventory and LTN output on one cable?
Usually not, because usually you're only isolating multiple signals of the same type (e.g. the actual inventory vs. the inventory with the request target subtracted off) by putting them into different circuit networks. In my builds this leads to "identity combinators" (like "each * 1 output each" or "each != 0 output each as input count") that just serve to send a signal only one way.
Saucy
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Apr 28, 2019 9:17 am
Contact:

Re: [0.17] LTN Combinator

Post by Saucy »

Hi. I noticed some problems with the mod. Let me show you:
Image
dockmeister
Inserter
Inserter
Posts: 48
Joined: Tue Feb 26, 2019 5:49 pm
Contact:

Re: [0.17] LTN Combinator

Post by dockmeister »

Saucy wrote: Sun Apr 28, 2019 9:24 am Hi. I noticed some problems with the mod. Let me show you:
hi,

thanks for the report. I uploaded a fix with the following changes:
- Depot is never visible
- 50M provide threshold will be reset upon enabling provider

cheers
Post Reply

Return to “Logistic Train Network”