A Guide to Patterns and Forms in Trainyard
The Phase Filter
I've already used this form in a couple of my examples, but it deserves a bit more discussion. The Phase Filter is really just a switch; however, when it's placed in front of a multi-car station, it divides all of the cars into two sets of in-phase cars. The 'active' direction of the switch will receive all odd-numbered cars, while the even-numbered ones will head in the other direction:
That may seem a bit obvious, but it's a useful thing to consider when approaching a new puzzle. When I see a multi-car station, I don't see it as one group of cars; instead, I see two groups of in-phase cars, which I'll split up using a Phase Filter.
The more interesting thing to talk about is using combinations of switches to select specific cars. Since the cars will be split into two groups - 1,3,5,7,9 and 2,4,6,8 - we can use switches in series to single out any car we'd like. For example, in the puzzle below we need to isolate only the green car.
To do this, we need to begin with a Phase Filter that seems a bit pointless. The green car is the sixth to exit, so I'll keep the 'up' direction as the active one, which sends the even-numbered cars through the lower path:
Notice how four cars pass through the lower path: purple, purple, green, purple. If we now think of that lower path as a new set of cars, then green becomes number three. We can add another switch on that section, keeping 'down' as the active direction so that the odd-numbered cars pass through the new lower path:
We're much closer: now we have only two cars passing through the lowest path - purple and green. We just need one more switch to send the purple one to the right and the green one downwards.
This kind of logic can be used to pick out any car from a series, and the compact design will save space and track.
So far, we've looked at either merging or splitting cars. The next form, the Crasher, will be useful when you need to cross cars together.
Next: The Crasher