[MOD 0.12.x] Logistic Combinators

Topics and discussion about specific mods
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

[MOD 0.12.x] Logistic Combinators

Post by GopherAtl »

Logistic Combinators

Image

Info:
Adds a variant of the constant combinator; instead of outputing constants you specify, though, it takes the types you specify and gets the values from the local logistics network, allowing you to build combinator and other circuit network systems that use data from the logistics network.
License
Long Description
Pictures
Version history
Config Settings
Use in Mod Packs
post format notes
Last edited by GopherAtl on Mon Apr 04, 2016 3:03 pm, edited 7 times in total.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
User avatar
CrispyOMNOMS
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Aug 01, 2015 1:21 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by CrispyOMNOMS »

This is great for my latest multi-functioning furnace setup, I had to wire every single logic chest to every single smart inserter to every single power pole just to us my own combinatory logic with robots. This will cut down on the fiddly wire placement ten fold!

EDIT: I can't seem to get the download url to work, do I need to do anything more than just click on it?

EDIT 2: Downloaded it from the web link. :)
Last edited by CrispyOMNOMS on Mon Aug 10, 2015 7:22 pm, edited 2 times in total.
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by GopherAtl »

CrispyOMNOMS wrote:This is great for my latest multi-functioning furnace setup, I had to wire every single logic chest to every single smart inserter to every single power pole just to us my own combinatory logic with robots. This will cut down on the fiddly wire placement ten fold!
that's the idea :) You're hardly alone, I see people every day, here and on reddit, surprised and sad to learn they can't use logistic network values directly in combinators, so I made a thing, and now they can (if they install the mod)
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
DOSorDIE
Filter Inserter
Filter Inserter
Posts: 255
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DOSorDIE »

Great MOD!

Is it possible to make one who show in a chest the aktiv robots (flying and that in the Roboport)?
I want to know and controll how many i have.
So i can make a chest with robots and when <100 then put some in the Roboport.
That would be great!
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by GopherAtl »

DOSorDIE wrote:Great MOD!

Is it possible to make one who show in a chest the aktiv robots (flying and that in the Roboport)?
I want to know and controll how many i have.
So i can make a chest with robots and when <100 then put some in the Roboport.
That would be great!

hmm. maybe? it'd be a completely different method under the hood, but I dunno any reason it wouldn't be doable. I will look into it, it is a good thought. I don't think logistics or construction robots are assigned to any roboport when active, only when idle and possibly when charging, so it might be expensive to be doing the checks constantly for how many robot entities are within the entire logistics area, though, particularly with many people's tendency to have thousands of them. So not sure it would be practical, could be a performance hit.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
DOSorDIE
Filter Inserter
Filter Inserter
Posts: 255
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DOSorDIE »

GopherAtl wrote:
DOSorDIE wrote:Great MOD!

Is it possible to make one who show in a chest the aktiv robots (flying and that in the Roboport)?
I want to know and controll how many i have.
So i can make a chest with robots and when <100 then put some in the Roboport.
That would be great!

hmm. maybe? it'd be a completely different method under the hood, but I dunno any reason it wouldn't be doable. I will look into it, it is a good thought. I don't think logistics or construction robots are assigned to any roboport when active, only when idle and possibly when charging, so it might be expensive to be doing the checks constantly for how many robot entities are within the entire logistics area, though, particularly with many people's tendency to have thousands of them. So not sure it would be practical, could be a performance hit.
That would be great when you look at it.
Maybe this helps
https://forums.factorio.com/forum/vie ... 96&t=13855
But i need it only for the aktiv Logistic System ... not all.
For my outposts i make the same and deliver robot when they need.
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by GopherAtl »

DOSorDIE wrote: That would be great when you look at it.
Maybe this helps
https://forums.factorio.com/forum/vie ... 96&t=13855
But i need it only for the aktiv Logistic System ... not all.
For my outposts i make the same and deliver robot when they need.
At a glance, it doesn't so much help as confirm my concerns about the performance! Active ones - ones that are currently flying about - are the expensive ones, it should be fairly cheap to find the count sitting idle in roboports. His is, admittedly, searching the entire world, apparently, but still, he says it takes it several seconds - completely freezing the game - to get the count. Even if I check 1/1000th the area, something that takes just milliseconds is just not something I can be doing in on_tick. An entire game cycle has to run in just 16 milliseconds, after all!
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DaCyclops »

DOSorDIE wrote: That would be great when you look at it.
Maybe this helps
https://forums.factorio.com/forum/vie ... 96&t=13855
But i need it only for the aktiv Logistic System ... not all.
For my outposts i make the same and deliver robot when they need.
Well how about that, your asking the exact same things I was asking Gopher :D

From what Gopher confirms, the LUA just doesnt have a way of reading the current robot status from a logistics network (and from what my investigation has revealed, there is no LUA scripting access to Logistics Networks as a whole....). so to even calculate it, would require calculating the robots around each roboport and inside each roboport. which would be inaccurate the moment two roboports are placed within 50 squares of each other....

Im having some thoughts on if its possible to approximate the figure for the current Logi network, without killing the game every second.
Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by Neotix »

If we put 2 or more Logistic Combinators in the same Logistic Network, and we connect them together, we will get multiplied values? Or there is some code to detect how many Logistic Combinators is in network and always show proper values?
DOSorDIE
Filter Inserter
Filter Inserter
Posts: 255
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DOSorDIE »

GopherAtl wrote: At a glance, it doesn't so much help as confirm my concerns about the performance! Active ones - ones that are currently flying about - are the expensive ones, it should be fairly cheap to find the count sitting idle in roboports. His is, admittedly, searching the entire world, apparently, but still, he says it takes it several seconds - completely freezing the game - to get the count. Even if I check 1/1000th the area, something that takes just milliseconds is just not something I can be doing in on_tick. An entire game cycle has to run in just 16 milliseconds, after all!
Why we do split the script that it need longer ... it dont need a update each seconds.
Make a internal database where the roboports are so we dont need to search each time.
The distance to search the next roboport is fixed but we need only all from the same logisic system.
So its easy to search from the exists roboport for new ones.

Ask all roboport (we known now its position) so its easy do a script.
And its enough to do this all x seconds todo not makeing heavy load.

EDIT:
Plan B:
Make a "Marker chest" who is need next to all Roboport i want to control (So searching for all/new Roboports is not needed)
All Marker Chest make a query of the roboport next to it (flying and in the Roboport)
and that is show in the "Output chest" like the Logistic Combinator.
For the outpost make a "Outpost chest" that only count the Roboport next to it.
Last edited by DOSorDIE on Tue Aug 11, 2015 10:36 am, edited 1 time in total.
User avatar
vampiricdust
Filter Inserter
Filter Inserter
Posts: 317
Joined: Wed Jan 14, 2015 1:31 am
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by vampiricdust »

Absolutely fantastic mod! GopherAtl you are awesome. This is a huge leap for circuit networks, finally we can use circuit logic with logistic values. I can't tell you how many times I have been playing with combinators and wished I could do this.

I'm so going to a lot of time getting to know your creation & how to abuse it.
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by GopherAtl »

DOSorDIE wrote:All Marker Chest make a query of the roboport next to it (flying and in the Roboport)
and that is show in the "Output chest" like the Logistic Combinator.
For the outpost make a "Outpost chest" that only count the Roboport next to it.

The flying ones are the problem. If the roboport even has this information, it doesn't seem to make it available in any way, so knowing where the roboports are only lets me determine the area to be searched for all entities of the type "robot." Have you seen how many roboports people use? dozens, hundreds, all overlapping, with thousands and thousands of robots? That is the problem. I could probably put something together that wouldn't be too bad if used with moderation in worlds with smaller roboport setups, but I have no control over how people use my mod, and the people with the most heavy logistics robot use would be the people who most want this kind of functionality!

I won't be distributing a mod that I wouldn't recommend people use, and unless some fundamentally different way to determine the active bot count is found, this falls firmly in that set. Sorry :(



Thanks to everyone for the interest and feedback. Please share any contraptions you make with these, as that's the best part of making mods in the first place!
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
DOSorDIE
Filter Inserter
Filter Inserter
Posts: 255
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DOSorDIE »

GopherAtl wrote:I won't be distributing a mod that I wouldn't recommend people use, and unless some fundamentally different way to determine the active bot count is found, this falls firmly in that set. Sorry
But is it possible to make the "Outpost Chest"?
I need to check the robots of my outposts ... so it mostly only 1 Roboport for me.
That would help a lot.
Please :roll:
When i know how i write it by myself ... but im not a Master in LUA.
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DaCyclops »

DOSorDIE wrote:
GopherAtl wrote:I won't be distributing a mod that I wouldn't recommend people use, and unless some fundamentally different way to determine the active bot count is found, this falls firmly in that set. Sorry
But is it possible to make the "Outpost Chest"?
I need to check the robots of my outposts ... so it mostly only 1 Roboport for me.
That would help a lot.
Please :roll:
When i know how i write it by myself ... but im not a Master in LUA.
im gonna have a play with having it recursive read the roboports into an array when placed, and then monitor the array's inventory contents (adding new roboports when placed near an existing array). Idle count is better than no count. May also have it give an "average" over the last half a minute or so, as a "Estimated Total".

My plan was always reading all those into their own unique Signals, Idle Construction, Idle Logistics, Total Construction, Total Logistics (the count for Totals being tagged with "Estimate" unless we can get a better figure through an LUA interface). Might get laggy on ultra-big builds (heres looking at you DemonEngineer) but may be 'light' enough not to bog down the tickrate on normal builds, especially if it is working from a list as opposed to checking for roboports every time (might also make it only do its maths every 5 seconds.)
DOSorDIE
Filter Inserter
Filter Inserter
Posts: 255
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DOSorDIE »

Found a bug
When i choose Oil, Heavy Oil, Light Oil, Petroleum, Acid, ... he always write 2147483647
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by GopherAtl »

DOSorDIE wrote:Found a bug
When i choose Oil, Heavy Oil, Light Oil, Petroleum, Acid, ... he always write 2147483647
Really? Thanks for reporting. I've got a meeting this morning for work, but I'll look into this and see about getting a fix out after lunch. Off the top of my head, I have no idea what might be causing this...
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
DOSorDIE
Filter Inserter
Filter Inserter
Posts: 255
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by DOSorDIE »

GopherAtl wrote:
DOSorDIE wrote:Found a bug
When i choose Oil, Heavy Oil, Light Oil, Petroleum, Acid, ... he always write 2147483647
Really? Thanks for reporting. I've got a meeting this morning for work, but I'll look into this and see about getting a fix out after lunch. Off the top of my head, I have no idea what might be causing this...
No need to hurry ... found a workaround.
I connected the Tank directy and then it worked.

Because the Roboport:
A friend of mine make for me the Outpost Chest.
So no need to make one ...
But you can look if the for the logistic system get to run (if you want).
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by GopherAtl »

just did a test setup and it seems like this isn't my mod; smart inserters with a logistics condition involving crude oil don't function at all, the condition is apparently always false - tested with crude oil <, =, and > 0, and in all cases the inserter did nothing. Other fluids are likely the same. circuit network conditions work, as you found hooking directly to the tanks, but at present it seems the logistic network either doesn't track fluids, or doesn't test them properly in conditions.

:edit: passed this bug up, since it's if anything an inconsistent, or at least unexpected, behavior of the conditions on the logistics network - though not entirely inconsistent really (see my bug report post for details) Depending on the response there, I may update in the next version to just ignore, effectively outputting 0, for all signals of type "fluid."
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: [Mod 0.12.x] Logistic Combinators

Post by GopherAtl »

Release 0.1.1 out now (link)

Only one minor bug fix, signal types that are, for the logistics network, currently invalid (fluids and abstracts) no longer output MAX_INT, instead they output 0, and without all that time wasted trying to get their actual value (which does not exist)
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
User avatar
vampiricdust
Filter Inserter
Filter Inserter
Posts: 317
Joined: Wed Jan 14, 2015 1:31 am
Contact:

Re: [MOD 0.12.x] Logistic Combinators

Post by vampiricdust »

One thing to be mindful is negative numbers. Since the logistic bots will try to carry max load, this does cause the numbers to spike into negatives. If you're doing any arithmetic on the data, it can cause unintended behaviors. A simple decider combinator to ensure a non negative number can filter them.

Really love your mod sir. I find it more useful every night I play now.
Post Reply

Return to “Mods”