[AAI mod] - scanning through multiple zones with one scanner

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Post Reply
User avatar
derpumu
Inserter
Inserter
Posts: 27
Joined: Sun Mar 19, 2017 12:51 pm
Contact:

[AAI mod] - scanning through multiple zones with one scanner

Post by derpumu »

After a comment from Nilaus on his current Season, I experimented with using a single zone scanner to loop through all tiles of multiple different zones in a row. Here's what I came up with:
This is my first setup that goes beyond 2 combinators so I welcome constructive feedback.

Image
Blueprint String
And here's how it works.
Part A picks the zone type.:
- 1 Is a common Counter, i.e. a Decider looped to itself, if P < 5 output P = input (5 is the number of zone signals I use), i.e. it loops from 0 to 4
The counter counts one up whenever it gets a pulse P over the green wires on the poles
- 2 checks if each of the inputs equals P and outputs that signal as 1, i.e. one of the zone signals and P
- 3 is a constant combinator, providing the zone signals with values 1 through 5 (green = 1, blue = 2 and so on), and adds 1 to the P we get from the counter, so the P input to 2 loops from 1 through 5
- 4 is a constant combinator with P = -1 to cancel out the P output from 2

B cleans up the output of the zone scanner:
I want to discard the X and Y coordinate outputs and keep only the zone tile quantity and zone signal itself.
- 5 routes through every signal > 0 (each > 0 output each with input value)
- 6 is a constant combinator that adds -100k to the coordinate signals, so they are always filtered out by 5

C loops back the zone signal to the scanner input. Together with the 1 for the zone signal provided by combinator 2 in section A this makes the increasing signal counter for said zone.
Since we might have switched to another zone signal we do not want the original signal looped back but only its value.
- 7 inclues the condition that the zone singal must be smaller than the zone tile count and returns the zone signal value as Z
- 8 takes Z and multiplies it with the 1 of the input zone signal from secition A, returning the result as the value of whatever signal A currently shows

D is one of the two conditions that trigger the transition to the next zone: If the tile count for the current zone is zero, then
- 9 ouputs signal 0 with value 1
- 10 is a normal counter that results in a small delay. I set it to signal-0 < 30, i.e. it will take half a second to loop
- 11 ouputs P=1 when signal-0 reaches 27, i.e. just below the max value (29 gave me some signal interferences) That way, a single P is sent for one tick, switching section A to the next zone.

E is the other condition: if the tile count is not zero, then this section triggers when the zone signal reaches the tile count
- 12 checks if any input equals the tile count and returns those signals as value 1. This will always return the tile count signal.
- 13 therefore adds tile count -1 to the input of 14 to cancel that one out
- 14 therefore gets a single zone signal with value 1 when the zone signal loop at the scanner has reached the tile count. It then ouputs N=1
- 15 is a normal counter for N<4, because 14 will send a signal N for exactly 4 ticks (signal delay from the zone scanner or something like that, I didn't look into it)
- 16 triggers a single P when N hits 4, switching section A to the net zone.
Last edited by derpumu on Sun Apr 30, 2017 3:37 pm, edited 3 times in total.

Nilaus
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Sat Aug 13, 2016 11:26 am
Contact:

Re: [AAI mod] - scanning through multiple zones with one scanner

Post by Nilaus »

Wow. This is really impressive. I still think this falls under the category of "I don't think I could figure this out" :)
I've been experimenting with some counters that run sequentially through each type of ore, while this seems to go through each simultaneously for each value (of am I getting that wrong?).
Wont this be inefficient when you for example have 5000 Wood and maybe 100 Coal? Will it then try Coal = 101 -> 5000?

Right now 0.15 is really fresh and Vanilla is the flavour of the week. I am waiting for Bobs+Angels+AAI to be updated before I can continue my S8. When that happens I will definitely try to this this up.
Thanks for the input and solution :)

User avatar
derpumu
Inserter
Inserter
Posts: 27
Joined: Sun Mar 19, 2017 12:51 pm
Contact:

Re: [AAI mod] - scanning through multiple zones with one scanner

Post by derpumu »

No, this won't go through the zones simultaneously, but sequentially, i.e. in your example it would do wood from 1 to 5000, then coal from 1 to 100, then Saphirite - oops nothing there, next zone in the list, and in the end back to wood and repeat.

I have not tested it too much yet, but my idea is that probably I'd built a separate scanner for areas that I have marked as wood (e.g. dashed green area) and that then transforms the spots with actual trees on it into green crosses. That way the general loop does not become too large and the miners don't stand around on empty spots for too long.
One could think about leaving wood out of that loop and treat is differently altogether. This setup is probably better suited for the other resources because they are easier to mark without too many empty spots and not as volatile, so it does not matter if it takes a minute or five to come back to coal.

PS: You can now find the blueprint string above.

Post Reply

Return to “Combinator Creations”