New Map Development - YourDeveloperFriend/choochoo GitHub Wiki

We welcome contributions to creating new maps. There is a bit of boilerplate needed to support new maps, so I created a script that should set all of that boilerplate up. Run the following command to create a new map:

# The name of the map should be the title of the map as it will be displayed to end-users.
# The arguments min and max refer to the number of players.
ts-node ./src/scripts/create_map.ts -n "New England" -min 2 -max 2

Grid

Build the grid using factory methods and constants from the factory.ts file. All grids are built using an array of arrays, where the first array refers to the first column in the map. Use startsLowerGrid if the first column starts lower than the second column. The entire engine is built using Axial Coordinates using flat-tops, meaning that maps that are oriented with pointy-tops are configured and built using flat-tops, then rotated before being rendered to the end user. You can configure the rotation in the MapSettings file.

MapSettings

The MapSettings file is a file used during the engine and configuration of the map. It includes any overrides and modules that are needed for the engine of that particular map.

The overrides are accomplished by taking a file that is a part of the engine and creating a child class. Then when that file is injected, it'll pull in the child class instead. The modules are a set of reusable modules that handle simple functions. A class can be overridden by a module, so in theory if you use a module that overrides a base class, and provide an override for that same class, it'll follow this logic: ModuleClass extends OverrideClass extends BaseClass.

ViewSettings

ViewSettings are used to manage anything related to how the map is rendered. Use this to modify the text copy around an action, or to render rivers and other textures for the map. This is also where you can create the views for configuring any variants for the map. See Reversteam for an example of how to manage variants or add rivers to a map.