Train Automaton Theory Pt2

This is Part 2 of the computer science theory behind the Train Automaton game. It describes the impact of player input on the automaton as well as the thing that makes a language a language: symbols or in this cases: train stations. The first part will covers the initial state machine.

Under the hood, the game is based on non deterministic finite automata (NFA), a computational model to describe regular languages or the more commonly used regular expressions. In Computer Science a language consist of a set of words, which themselves consist of symbols (or more casually “letters”).

figure 1: a switch as shown to the player.

The first post explained the internal wiring of the single tile <3,2> and its surroundings. Lets look what changes on player input.

If the player inputs a switch like in figure 1, the game will wire the internal states of the tile together as shown in figure 2.

The blue transitions are the ones added by the switch. Similar to the inter tile transitions, railways can be used both ways: for horizontal railway two transitions <x,y,W,I> to <x,y,E,O> and <x,y,E,I> to <x,y,W,O> are created. Note that, contrary to the inter tile transitions, the intra tile transitions lead from “I” to “O”.

The inter tile transitions not only directly represent the rails in the tile but perform a second function: the transition symbols in figure 2 are shown as variable x. Depending on the given tile x internally assumes the following values.

  • a, b, c… : if the tile contains a (red, green, blue) station.
  • ε : if the tile contains no station.

Due to the nature of the game, most of these transitions will remain ε-transitions: The board is quite small and there needs to be some place to navigate the rails without moving through stations. This leads to the next post, where I will explain the difficulties that came with those ε-transitions.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s