A Guide to Patterns and Forms in Trainyard

Axiom #1

Once you’ve learned the basics of Trainyard, there are only two principles you need to know to become an expert. In the same way that every aspect of Euclid’s geometry can be built from a handful of axioms, you can create track structures to deal with almost any situation by applying only these two rules.

Axiom #1: The path length of any car can only be increased or decreased by multiples of two.

Take a look at the solution below. After the red car leaves its home, it passes through exactly three squares before arriving at the station.

Suppose you wanted to delay the red car - in order to meet up with or avoid another car, for example. The simplest way to do this would be to curve the track up one square, as in the solution below.

Now the red car passes through five squares before reaching the station. We could try other ways to end up with a path length of only four squares, but they'll all result in a five-square path length.

In some ways, these tracks are equivalent to each other. Each has the same path length, and the same amount of track as well. It doesn't matter where the track bends up or down - if it only moves one row away from the shortest path, it will produce the same result.

The reason for this rule comes from the game's geometry. In order to get a path length of four instead of five or three, the car would have to pass through (for example) only the four squares shown in the image below.

But following this path would require moving diagonally from square 2 to square 3, which is impossible. Any other imagined path that would add only one square to the total path length would require a similar diagonal move, skipping a square, or something else not allowed by the game.

We can add four squares to the path length by diverging from the shortest path by two rows (instead of only one), as in the example below.

For simple paths, diverging by one row or column in any direction will always add two squares to the length of the next shortest path.

Loops are the exception to this rule, since they cause the car to pass over certain squares more than once. In the examples below, the first loop adds four squares to the path length, while the second adds six. (As we'll see in the section on minimizing track, loops are much more efficient ways to delay cars.)

You can try all kinds of variations to these tracks, but no matter what you change, you'll always find that you can only increase or decrease the path length by two squares.

Next: Axiom #2