Note: This entry is cross-posted from my blog at greeneyedgames.ca. As such, it's written for a general audience, but I'd be more than happy to get into a more technical discussion.
This is the first in a short series of posts about designing the puzzles in Last Train to Timbuktu!. Actually, as you'll soon see, it's about designing a puzzle designer, because I didn't really design the puzzles at all.
In many puzzle games, once you've beaten all the levels, the game is done. I guess you could start the game over to see how much easier it is, but it wouldn't be as much fun. Other games, like Tetris and Bejeweled don't have set levels at all. You just sit down and play, and do as well as you can with the pieces you get. The game is never really done because you're never solving the same puzzle twice.
I wanted Last Train to Timbuktu! be like Tetris in this regard: always the same rules, but never the same game twice, so there's always something to come back to. So I didn't sit down and create fifty or a hundred different puzzles. Instead, I created a puzzle designer. Every time you play a game of Last Train to Timbuktu, the puzzle designer is sitting there in the background making up new puzzles for you to solve.
In this series, I'll explain how the puzzle designer works and, more importantly, why it works that way. Today, we'll start at the beginning and look at the bare bones of a puzzle in Timbuktu.
As you know if you've played the game or watched the trailer, a puzzle in Last Train to Timbuktu is just a path between train stations with mixed up train tracks. To solve the puzzle, you rotate rows and columns of the tracks so that they connect the stations. So, when the puzzle designer creates a puzzle, it has two fairly obvious jobs to do:
To create a path, the designer puts down a station on an empty puzzle board. Starting at the station, it wanders aimlessly through the board, laying down train tracks as it goes. When it happens to wander off the board, it decides that's a pretty good spot for the second station, and presto! It has a train track between two stations.
Of course, we don't want paths that look like these ones.
So the designer has to be a bit careful to make sure the path is long enough and doesn't cross over itself. But this aimless wandering already produces interesting, varied train tracks just waiting to be scrambled into puzzles.
To accomplish said scrambling, the puzzle designer can't just mix up the tracks all willy-nilly. No - it must bear in mind exactly what it's designing: a puzzle. A puzzle intended to be solved by a player, and so it's rather important that the puzzle has a solution. The designer must therefore make sure that, however it mixes up the tracks, you'd better be able to un-mix them by rotating rows and columns.
The best way to do this, of course, is to mix up the tracks by rotating rows and columns, and so that's exactly what the designer does. Then you, the player, if you're clever enough, can just rotate the same rows or columns in the opposite direction to solve the puzzle. Of course, most of us aren't quite that clever and it takes us a few extra moves to connect the stations.
As when it makes a path, the designer has to be a bit careful when scrambling the pieces. Mostly, it has to avoid the two situations illustrated below. In the puzzle on the left, moving the middle column has no effect. On the right, the designer has scrambled up the puzzle, but inadvertently solved it in the process.
Fortunately, these situations are easy to avoid. When the designer moves a row or column, it checks if the move was redundant or solved the puzzle. If so, it just reverses the move and tries a different one. The result is nice juicy puzzles like these:
As you can see from the screenshots, these kind of single-path puzzles are used in the Race mode of the game. But the game doesn't stop there, and neither does the puzzle designer. In the next couple of posts, I'll look at how the designer builds on this foundation to generate more elaborate, strategic puzzles for the challenge modes, and how it takes difficulty levels into account.