The game is played in a rectangular board in which each tile is empty, blocked, a departure station, a destination station, or a special tile. Each departure station initially contains a certain number of colored trains (possibly having different colors). Each destination station accepts one or more colored trains. When two trains of different colors meet, their colors are mixed togeter (e.g., if a blue and yellow train meet, they both become green). Additionally, if the position and travel direction of two trains coincide, they merge into a single train.
A special tiles splits any incoming train into two trains of the constituting colors. Another special tile allows trains to be painted of a given color.
The goal is to choose the an appropriate placement of the rail pieces (straight rails, intersection, switches, …) on (a subset of) the empty tiles, so that each train reaches to a suitable destination station (i.e., each destination station receives exactly amount of trains it can hold, with the appropriate colors).
Trains that reach an empty tile, blocked tile, a destination station that cannot hold any more trains of that color, a rail piece that is not properly aligned, or try to traverse a special tile in the wrong direction result in an immediate loss.
See, e.g.,  for a more precise description of the game.
The Trainyard Verification problem asks to decide whether a given placement of the rail pieces is a valid solution to a Trainyard instance and is PSPACE-complete . An simulation of the PSPACE-completeness reduction can be found here.
 M. Almanza, S. Leucci, A. Panconesi, “Trainyard is NP-Hard”, Theoretical Computer Science, 2018.
 M. Almanza, S. Leucci, A. Panconesi, “Tracks from hell - when finding a proof may be easier than checking it”, in FUN 2018.