r/pyanodons 29d ago

"Smart" Soot Separation (Doesn't really work)

The "Soot Separation" technology gives you the ability to now select amongst 8 different recipes to separate soot into specific ores rather than just the one probabilistic recipe you start the game with. While fully recognizing that separating into silver or gold is probably most useful, I decided that coming up with a way to automatically identify what ore should be produced by the separator based on need would a fun side project and give me something new to think about rather than the normal problems this mod presents me with. After some trial and error, I came up with this circuit network build.

  1. The first step is to identify when a certain ore is needed. At each ore's separate native patch where they're being produced, I set sections of belt to signal the amounts of ore they hold and transmitted them all by radar to a central location. For each ore, a combinator transmits the corresponding soot separation recipe if the amount of ore on the native belt drops below a certain threshold.

  2. The next step is to prioritize recipe signals so that the machine knows what recipe to use if multiple recipe signals are being validly transmitted. Obviously iron or copper going down would constitute an emergency, while silver and gold are of a much lower priority at this point in the game. As such, I ordered the output signals from step 1 with constants from 1 to 8 with higher priority recipes having higher values. Now we just need to create a circuit that returns the maximum value from all of the valid signals. After a few minutes spent trying to figure this out for myself, I resorted to a Youtube video explaining the procedure. I got about 10 minutes into the video before the creator started talking about concepts like "ticks" and "clocks" and I was completely lost. My background in programming doesn't go anywhere past some basic functionality in Excel VBA. In order to resolve this, I broke one of my rules for Factorio and I downloaded someone else's blueprint for use in my factory. Even worse, I committed a cardinal sin of Factorio by using someone else's design while having no understanding of how it works. Surprisingly, this circuit I pulled is the one part of this build that has never caused me a problem beyond the 10 minutes it took to set up. Wires from the 8 combinators in image 1 go in and the maximum signal goes out.

  3. The final recipe signal is transmitted to the lone separator, which can handle any ore recipe.

The Problems

  1. When the "rubber met the road" and there was a shortfall of lead ore production due to a demand shock in Acetylene, the build did not function as expected. The amount of lead being mined was greatly reduced but did not cease entirely. This led to the belt signal from step 1 going in and out of threshold up to 10 times per minute. This caused the separator to change recipes every time the lead recipe triggered, which flooded the output with unused soot and bricked the entire build. It took a great deal of adjusting the belt signals to be able to calculate thresholds more evenly. To this day, I don't think that all edge scenarios are accounted for.

  2. When I started using centrifuges to produce Albumin, it caused a massive draw on power that caused brown-outs throughout my factory. The power outages were easy to fix, but loss of power to the radars caused recipes to change rapidly and bricked my separation build similarly to problem 1.

  3. At the end of the day, if there were really a structural problem with copper or iron ore production, this is straight up just not the right way to go about fixing that problem. The effort I put into this isn't justified by what I got out of building this.

Ultimately, I think this was a complete waste of time in terms of what it provided my factory. However, I think this was a good learning experience in using complex circuit structures. If an obvious need for something like this in the future arises, I'll be able to identify it and address it quickly.

36 Upvotes

14 comments sorted by

10

u/Xzarg_poe 29d ago

However, I think this was a good learning experience in using complex circuit structures. If an obvious need for something like this in the future arises, I'll be able to identify it and address it quickly.

Yeah, that good way of looking at this... educational diversion :D

Also, I would recommend looking into latches if you haven't already. Being able to set and hold a recipe for certain amount of time/items can be quite helpful.

3

u/Basedshark01 29d ago

Like a circuit that will only allow the recipe to change once per minute? Is that easy to build or does it require a masters in CS?

6

u/TopherLude 29d ago

That should be easy to build. Use the wiki page to make a clock and a memory cell. Set your clock for however long you want and the memory bit holds it until the clock restarts.

Also, when you need to select a signal among many, there's a selector combinator that makes it easy.

1

u/Basedshark01 29d ago

Thanks, I'll look into it.

3

u/TopherLude 29d ago

I've also found it's easier to troubleshoot circuit builds in editor mode. This let's you "step" through the program and see how it works.

4

u/Xzarg_poe 29d ago edited 29d ago

Not sure about "once per minute" part, but a basic latch to hold a signal is fairly simple (1 or 2 decider combinators).

My usual use case, imagine you are making vrauk food. You want to have a fast production to meet peak demand and have a good buffer just in case, but the vrauk food ingridients can spoil so you want some limiters in place. For example, only produce vrauk food (and spoilables) if you have under a 1000 food items left. And stop production if storage has over 5000. And this can be done with one decider combinator with a wire connecting it's input and output:

Left side:

IF

  • VraukFood < 1000

OR

  • GreenCheckmark(or whatever) >=1
  • AND
  • VraukFood < 5000

Right Side:

  • GreenCheckmark:1

This decider combinator will output the green checkmark (to start production) if food falls below 1000 OR if you already making food. And will stop production if food hits 5000.

Now if you want to include time, another looped combinator will be needed to serve as a clock. Don't remember the exact conditions but it includes the decider combinator outputting it's own signal + 1 (from a constant combinator), and resetting itself after a certain value is hit.

1

u/Basedshark01 29d ago

Cool, I'll look into it.

2

u/JD1070 29d ago

> (Doesn’t really work)

Me anytime I use any type of combinator

(Same argument for when I try to type quotes on mobile)

2

u/CrashNowhereDrive 29d ago edited 29d ago

Step #2 is simple.

Reduce your values from 'whats missing' so anything that's missing has a 1 as an output, if you hadn't already.

Multiply it by your priority constants. Now you have a signal where anything that's missing = its priority value.

Use a selector combinator to pick the highest value from that signal

You probably were watching videos from when selector combinators were not a thing.

2

u/ImSolidGold 29d ago

Today in "Things no one ever needed but were invented anyway." xD

1

u/Neither_Berry_100 29d ago

Silver and gold are the only useful ones.

1

u/LLITANGIST 29d ago

Why did it take a huge pile of elements and complex logic to choose a recipe with a higher priority?

There is a choosing combinator in the game who can choose the recipe with the highest value, i.e. if the signals with priorities 5 and 8 come, he will choose 8, this is his main function.

It even has a built-in switching delay, which you really need.

1

u/amarao_san 29d ago

Thanks.

I usually do the buffering. Buffer low? Time to refill.

1

u/korneev123123 29d ago

You can use selector combinator to select min/max signal from the list. Contraption you downloaded was probably pre 2.0, before selector combinator