Outpost status display

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

Post Reply
Kalanndok
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sat Dec 12, 2015 9:07 am
Contact:

Outpost status display

Post by Kalanndok »

Hi Community,

While designing my base I started running into the problem that I an outpost died of recource depletion and I didn't really notice it until by chance I spotted one of it's trains coming in empty to the unload station. Therefore I build a little status reporter and a status display which is easy to implement to each outpost without a lot of configuration work to be done.

In the case shown here I'm having each outpost report three statuses:
1) Outpost is connected (green signal)
2) Outpost buffer storage has contents (yellow signal)
3) Outpost buffer storage is empty, effectively just the opposite of the second signal right now (red signal)

First of all I had to wire up my whole rail network with green wire to transmit a combined status signal of each outpost back to the main base.

Second I have a status reporter which is located in each outpost:
Status sender
Status sender blueprint string
When setting up an outpost I set blue signal on the combinator to the ID that the outpost is supposed to have. That signal is actually not supposed to leave the outpost. Keep in mind that the Id must be a power of 2. Meaning one of the set of 1, 2, 4, 8, 16, 32, etc up to 2^30.
the decider marked with yellow lines is just a helper so I don't have to touch the walled in set of combinators. It sends A=1 into the local outpost circuit when I want the yellow signal to be true.

The walled in combinators are responsible to to transform the status for transportation into the green wire network connecting everything (the rail-wire).
The ones marked in green there will transform the condition in A into the yellow and red signals respectively.
As the green signal is only used as a connection check I default it to 1 with a constant combinator
The arithmetic combinator muliplies these with the blue signal (the Id) of the outpost.
The set of decider combinators on the left then only makes sure that only the red, green and yellow signals get put onto the rail wire.
By that I can reuse the same blueprint for up to 30 outposts with only configuring two combinators and nothing more.




Now for the display module:
Status display
Status display blueprint string
Status display detail
I'm using a variation of the binary decoder developed by Hanziq and demonstrated by Xeteth in his Name display build.
The rail-wire comes in from the left.
Each line represents an outpost. First line is Id = 1, second line is Id = 2, third line is Id = 4, etc. This is what the combinators on the leftmost column are responsible for. Each combinator takes the result of the previous line and multiplies it by 2, with the exception of the first which gets fixed to 1. All the lines are equal concerning the setup of the combinators.
It might not be noticable in the screenshots but each of the first column combinators is connected with a red wire to the input of the next combinator in the COLUMN and to input of the next combinator in the ROW. However as I've read in the friday facts that's display issue supposed to get fixed.

The second column gets as input the each of it's row's red wire from the first column and the complete green signal from the rail-wire.
Columns 2 to 6 are basically Hanziq's binary decoder with the modification of columns 4 and 6 which are there to equalize the latency times of the signals. In the end the decider combinator normalizes all incoming signals (red, green, yellow in this case) to either 1 or 0.

Connections summed up:
Rail-wire connects to ALL C2-inputs
Column 1 output connects red to Column 2 input in the same row and red to Column 1 in the next row
Column 2 output connects red to Column 4 input and green to Column 3 input
Column 3 output connects red to Column 5 input
Column 4 output connects red to Column 6 input
Column 5 output connects red to decider input
Column 6 output connects red to decider input.

Status sender lamps detail
The lamps simply light up on each decoded signal. The smart chests are just there so that I can see what the outpost is supposed to deliver.
If the first lamp is off that means that outpost is not connected either because it is not built or because the power line to it has been severed. An outpost which has something in it's smart chest without the first lamp on is most likely an issue that needs investigation :)
If the second lamp is off it means that the storage is empty. Unless the outpost is mined out completely it will start flickering between the second and the third lamp.
If the third lamp stays on without flickering from time to time that means the storage in the outpost is empty AND gets no longer filled. Meaning the outpost is dead.

What each signal means can be defined by each outpost itself. You are not even limited to those three signals, you simply could add more without changing anything to the decoder logic (what I'm looking for is a reliable detector for the information "train is in station").
Another thing I'd like to fix is the flickering if the outpost is not dead but dieing. I'd build a timer into the sender module but that's not yet completed.

As I said beforehand one set of signals can support up to 30 outposts however you can also have several outposts with the same Ids provided they DO NOT share the same status signals.

PS:
While analyzing that build to bring it to here I even noticed that the decider in Column 7 is not actually necessary since I could just combine the outputs of C5 and C6 into the lamps directly, however the decider gives me a mouse-hover-point where I can check the intermediate results of the calculation which the lamps don't. Therefore I decided to leave it in.

PPS:
Even though the blueprint still has 31 lines I'm not sure if the calculations in the 31st line can be performed correctly in the display module, actually I'm even expecting problems because of the datatype (signed Int32). Therefore I've been referring to a maximum of 30 outposts that can be serviced.

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Outpost status display

Post by XKnight »

Kalanndok wrote: When setting up an outpost I set blue signal on the combinator to the ID that the outpost is supposed to have. That signal is actually not supposed to leave the outpost. Keep in mind that the Id must be a power of 2. Meaning one of the set of 1, 2, 4, 8, 16, 32, etc up to 2^30.
the decider marked with yellow lines is just a helper so I don't have to touch the walled in set of combinators. It sends A=1 into the local outpost circuit when I want the yellow signal to be true.
Mixing signals from different outposts is very painful and has many disadvantages...
Another approach is to use regular number to represent outpost's ID and a little bit complicated protocol:
1) base send 38 Blue
2) outpost compare Blue signal with its ID
3) outpost send its storage
4) base receive information about storage and do whatever you want
5) base send 39 Blue
As a result you will spend 1 tick per outpost.

Kalanndok
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sat Dec 12, 2015 9:07 am
Contact:

Re: Outpost status display

Post by Kalanndok »

Thanks for the commend.
It also sounds nice and I might try that out in a revision, but that would not be a push-protocol anymore.
The base would need to actively pull a status from a specific outpost.

Another problem I see is where to stop the loop iterating through the Ids. I. e. you have outposts 1 to 10 and because it's dead you deconstructed #5.

One problem I see with that approach is that the update time for the display increases with the number of outposts (with 30 outposts already 1 game second, since request and receive are already at least 2 ticks) while in my design the update time is independent from the amount of outposts.
What are those many disadvantages of my binary encoded constant signal?

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Outpost status display

Post by XKnight »

Kalanndok wrote: while in my design the update time is independent from the amount of outposts
Indeed, but the amount of outpost is strictly limited.
Kalanndok wrote:What are those many disadvantages of my binary encoded constant signal?
Using this design it is unable to receive outpost storage, because you are using only one bit per signal.
Also, it is very hard to send an order to the outpost because you will need to install a decoder in each outpost .
(orders example: to decrease production rate because base-storage is almost full; to disable beacons because we will run out of energy).
Limited amount of outposts also is not an advantage:)
Last but not least, encoding/decoding information from bits requires additional combinators and makes your design more complex.
Kalanndok wrote: Another problem I see is where to stop the loop iterating through the Ids. I. e. you have outposts 1 to 10 and because it's dead you deconstructed #5.
This is not a problem, because you can remove "dead" outpost after first missed signal-answer.
In my base, I am manually enable specific mode to remove "dead" outposts.

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Outpost status display

Post by ratchetfreak »

Kalanndok wrote: One problem I see with that approach is that the update time for the display increases with the number of outposts (with 30 outposts already 1 game second, since request and receive are already at least 2 ticks) while in my design the update time is independent from the amount of outposts.
How often do you need real time information about your outpost. It's often better to show some value aggregated over time (average amount of resources in the train station buffers over the last minute) as then it won't fluctuate as much

hyarion
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Mar 17, 2016 8:29 am
Contact:

Re: Outpost status display

Post by hyarion »

I just want to say thank you for this, I implemented it on my map last night and it works amazingly! I love it :D

It did take me a while to figure out where to hook up the green wire on the outpost side though, could perhaps be good to explain in the original post. For anyone else having trouble you need to hook the green wire from your rail network onto the left side of the left-most combinators in the outpost.

In terms of the feedback most have given, sure there could be improvements or changes, but I would say for the majority of people this fits needs perfectly. I havn't used combinators until now, and this taught me a lot in how they work. It also serves a nice starting point, giving a functional feature without being too complicated.

xyeet
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Mar 13, 2016 10:59 am
Contact:

Re: Outpost status display

Post by xyeet »

This inspired me to think of a simple star topology "router", but despite it being simplistic I still find it way too bothersome to implement it in Factorio. It would work like this:
router
If someone can recommend a good diagramming tool it would help me implement this :D My proposal here has lots of weaknesses, but it would be amazing if people came to agree on standard networking protocols and we could build a library of blueprints around them.

Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: Outpost status display

Post by Neotix »

This decoder can be more compact. We need only 3 column of combinators.
Only problem with 3 columns is unstable signal for 1 tick when input signal is changed. Thats why i'm using additional column to delay signal.

It's work like that (in every sec. signal zero is incremented by 1)
Image

Functionality test. O left is outposts signals simulation and on right decoder. All works fine.
Image

Only limitation is 30 channels per signal but we can transmit as many signals as available items to choose :D

I had idea. With SmartTrain mod we can send train depend on signal.
So we can build defense outpost with robot network to reload guns, repair walls etc. When outpost need resupply, it send signal to "Military network". Decoder calculate which outpost need resupply and sent signal to train. Train go to that outpost and back to loading station where wait for another signal.

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Outpost status display

Post by XKnight »

Neotix wrote:This decoder can be more compact. We need only 3 column of combinators.
Only problem with 3 columns is unstable signal for 1 tick when input signal is changed. Thats why i'm using additional column to delay signal.
Ok, if you want to share bits inside each signal you can do it at least effectively:
viewtopic.php?p=127288#p127288

User avatar
Evan_
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Sun Mar 13, 2016 9:24 am
Contact:

Re: Outpost status display

Post by Evan_ »

[quote="Kalanndok"](what I'm looking for is a reliable detector for the information "train is in station").

Usually trains are better fuelled at home, rather than on outposts, but for this I'd use a chest with coal (or whatever the trains run on). If the chest's content drops below maximum, that means the locomotive arrived. It can start a timer that's set for as long as the train should stay in the outpost. It won't detect a broken rail-line in itself, but it should do for a tested path.

User avatar
Evan_
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Sun Mar 13, 2016 9:24 am
Contact:

Re: Outpost status display

Post by Evan_ »

Evan_ wrote:
Kalanndok wrote:(what I'm looking for is a reliable detector for the information "train is in station").
Usually trains are better fuelled at home, rather than on outposts, but for this I'd use a chest with coal (or whatever the trains run on). If the chest's content drops below maximum, that means the locomotive arrived. It can start a timer that's set for as long as the train should stay in the outpost. It won't detect a broken rail-line in itself, but it should do for a tested path.

Pandamonium
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon Jan 20, 2014 7:51 am
Contact:

Re: Outpost status display

Post by Pandamonium »

XKnight wrote:Ok, if you want to share bits inside each signal you can do it at least effectively:
viewtopic.php?p=127288#p127288
That method only works for a single signal though right?
or can it work to power lights like the original post?

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Outpost status display

Post by siggboy »

Pandamonium wrote:
XKnight wrote:Ok, if you want to share bits inside each signal you can do it at least effectively:
viewtopic.php?p=127288#p127288
That method only works for a single signal though right?
or can it work to power lights like the original post?
The method allows you to split any number into its binary digits. Your result signal will be a set of signals that are present only if the corresponding binary digit in the source signal is "1".

For example, the source signal might be the number "11" on the "red" signal. If you run that through the binary decoder you get signals "1", "2" and "8" (because "11" is "1011" in binary). You also have the information that the origin signal was "red", so you effectively encoded multiple flags (one-bit values) into the "red" signal, up to 32 are possible.

So the method works for more than a single signal, you can store up to 32 binary values (flags, on-off signals) inside a single signal, of which there are many.

I personally like the method of using one bit for each outpost, because it's really easy to transmit (no polling of all outposts necessary), and you can have all outposts put their signal on the wire all the time (which will add up all the signals). Adding the signals together is fine, in fact it might even be what you want, because the result will be a consolidated signal of all the outposts' flags.

Unless you need to transmit an actual number (something like "1.2k coal in the chest") but only a TRUE/FALSE statement (such as "my buffer chests are full" or "train waiting here"), one bit is exactly what you need. Being able to put 32 of them into any signal is a big advantage of the decoder. It also means that as long as you don't have more than 32 outposts you actually cover ALL OF THEM in one single signal (well, one signal per "fact" that you want to broadcast).

The workings of the binary decoder are actually rather arcane, especially if you don't know how signed integer values are stored in CPU registers and aren't aware of the fact that Factorio exposes this in the game.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Post Reply

Return to “Show your Creations”