ekohilas / train-conductor-world-map

A set of files to generate a map for the Train Conductor World mobile game.
2 stars 1 forks source link

Train Conductor World Map

Train Conductor World is mobile game (for iOS and Android) by The Voxel Agents. The game has several cities on a world map (currently, only European cities).

This repository (forked from a GitHub Gist) is an effort to replicate the game world map outside the game, and to help plan in-game routes, such as with Train Conductor World Tools

Tiled Map Editor was used to rebuild the map, and ImageMagick to automatically generate the graphics.

Assets

Files

map.png

The exported map generated by Tiled from train-conductor-world.tmx

Train Conductor World exported Tiled map

tiles.csv

A sheet exported from Google Sheets which details information on each tile.

Note that Column Name and Data Type are respectively stored in the first and second row.

Column Name Data Type Description
Abbreviation string A shorter form of the tile name; for an Environment this is an emoji; for a Location, a two letter abbreviation; for a Track or Connection, a Unicode Box-drawing character where the heavy side denotes which direction has a branch.
Name string The name of the tile, where given. For Tracks and Connections, this was inspired from the Unicode name of the Abbreviation, omitting "Heavy" and "Light" by denoting the direction before the "and" as the one with two tracks. For Location and Environment, this was taken from the game.
Color string The hex color code for the tile denoted as #rrggbb. Used by generate_tiles.sh
Group string The group the tile belongs to. Either Environment, Location, Track, or for artistic purposes, Connection.
Type string The type of tile within the group; for an Environment, whether it's Sparse or Dense; for a Location, whether it's a City or Port; for a Track, whether it's Wood, Iron, Alloy, or for artistic purposes, Transparent; for a Connection, which City it belongs to.
Filename string A sorting and path friendly name for the tile, generated by replacing ` with_, padding numbers, and joining theId,Group,Group Id,Type, andNameby-, followed with.png`.
Id integer The id of the tile starting from 0, which can be used to read map.csv.
Tmx Id integer The id of the tile starting from 1, which can be used to read the CSV embedded inside train-conductor-word.tmx
Group Id integer The id of the tile starting from 0, used to dictate the order of groups.
Height integer The layer height of a Environment where 0 is the lowest.
Connection Color string The hex color code for the connection of a City, denoted as #rrggbb.
X integer The x coordinate[^1] of a Location.
Y integer The y coordinate[^1] of a Location.
Overlays list[^2] The names of any Environments that a Track can build on.
Speed float The speed multiplier that a Track provides for connections.
Branching boolean[^3] Whether a Track or Connection contains a branch.
Branches integer The number of branches of a Track or Connection.
Vertical boolean[^3] For a Track or Connection, whether it has a connection from top to the bottom.
Horizontal boolean[^3] For a Track or Connection, whether it has a connection from left to right.
Up Right boolean[^3] For a Track or Connection, whether it has a connection from the top to the right. For an Environment, used by generate_tiles.sh to determine whether to draw a shape in the top right corner.
Down Left boolean[^3] For a Track or Connection, whether it has a connection from the bottom to the left. For an Environment, used by generate_tiles.sh to determine whether to draw a shape in the bottom left corner.
Down Right boolean[^3] For a Track or Connection, whether it has a connection from the bottom to the right. For an Environment, used by generate_tiles.sh to determine whether to draw a shape in the bottom right corner.
Up Left boolean[^3] For a Track or Connection, whether it has a connection from the top to the left. For an Environment, used by generate_tiles.sh to determine whether to draw a shape in the top left corner.
Up boolean[^3] Whether a Track, Location, or Connection has a track on the top.
Right boolean[^3] Whether a Track, Location, or Connection has a track on the right.
Down boolean[^3] Whether a Track, Location, or Connection has a track on the bottom.
Left boolean[^3] Whether a Track, Location, or Connection has a track on the left.

[^1]: From the top left corner, starting from 0, where X increases rightwards and Y increases downwards. [^2]: Stored as a quoted string separated with ,. e.g. "Grass, Forest, Water". [^3]: Since the CSV was managed in Google Sheets, a boolean value in tiles.csv will be either TRUE or FALSE

tiles.json

Stores the data from tiles.csv in a more computer readable format.

train-conductor-world.tmx

The file storing the map and tile data, which can be easily edited or viewed using Tiled.

achievements.json

Originating from here, this file lists the achievements of the game in a computer readable format.

tiles_csv_to_json.py

A script that acknowledges the Data Types of tiles.csv and converts it to tiles.json, removing any missing values.

generate_tiles.sh

The script uses ImageMagick to generate pixel artwork for the tiles given tiles.csv.

On normal execution, the script will perform as follows, only generating files if they don't already exist:

  1. generate_straight_track
    1. generate_straight_planks
      • Draws planks distributed across the tile.
    2. generate_straight_rails
      • Draws rails at a fixed ratio from the center.
  2. generate_curve_track
    1. generate_curve_planks
      • Applies a polar distortion map to curve the given straight planks.
    2. generate_curve_rails
      • Applies a polar distortion map to curve the given straight rails.
  3. generate_straight_connection
    • Draws a connection similarly to generate_straight_track.
  4. generate_curve_track
    • Draws a connection similarly to generate_curve_track.
  5. generate_from_csv
    1. generate_environment
      • Overlays one to four diamonds on a square of a given background color.
    2. generate_location
      • Overlays (from top to bottom):
        1. A colored two letter abbreviation of the location name in serif font.
        2. A white circle.
        3. A horizontal and vertical track.
        4. A background colored with the same color as the two letter abbreviation.
    3. generate_track
      • Overlays (from top to bottom):
        1. The set of rails which produce the track.
        2. The set of planks which produce the track.
        3. A background of a given color.
    4. generate_connection
      • Overlays the set of connections which produce the connection.
      • Applies the color of the connection.

tests.py

A Python 3 script that runs tests to ensure correctness after editing.

screenshots

Artwork

Tiles

The tiles directory stores all the images required for train-conductor-world.tmx

Environments

There are 5 different environment tiles, of which some have different styles of graphics between themselves, and again depending on the season.

Clouds
Water
Grass
Forests
Mountains

Locations

As of January 2022, there are a total of 29 different locations in game.

A lot of the earlier details such as what order which locations were unlocked or released in are no longer easily found without restarting the game, however looking at the game's version history, the determined order is:

  1. Prague & Warsaw [v1.3]
  2. "UK & Scandinavia" (Assumed to be Copenhagen, Edinburgh, Gothenburg, Grimsby, London) [1.4]
  3. Bernina [v1.6]
  4. Belfast [v1.8]
  5. Mostar [v1.10]
  6. Madrid [v1.12]
  7. Budapest [v1.14.1]
  8. Florence [v19.0]
Cities

There are 23 playable cities:

Ports

There are 6 connectable ports:

Each port can connect up to 8 other cities, with each requiring keys which can be obtained by connecting to other cities with certain types of track tiles.

Tracks

It is believed[^4] that there are total of 42 track tiles, with 6 of them being Wood, 18 being Iron, and the remaining 18 being Alloy.

Wooden
Iron
Alloy
Transparent

[^4]: I have yet to see any Alloy track tiles which take the same form as the Iron double curve branched track tile through both collecting over 1000 tiles and through the tile trader. I suspect that even if someone were to collect these tiles and trade them in, they would be returned with the superior 3 connection Alloy version. This screenshot from Facebook also backs the theory.

Connections

TODO

Artwork

generate_tiles.sh