Skip to content

Implementing a new Variant (Step by Step)

Dr. Martin Brumm edited this page May 12, 2020 · 2 revisions

General Approach

The following consists of my preferred way of working top down in implementing new variants.

Study Phase

  • Reading the Variant Rules
  • Playing the Variant
  • Understanding the Variants specials
  • Finding and noting the differences to already implemented variants:
    • 1830 for the base game
    • 1856 for a game with loans and nationalisation
    • 1835 for a game with minors and nationalisation
    • 18EU for a game with mergers
    • 1880 for a game with complex round handling mechanismn and other bells and whistles
    • 1837 for a game with multiple chained Startrounds

Generating the Configuration

Copy the configuration from data/18(see above nearest ancestor) into a new directory data/18Variantname Refactor the Configuration Create Tiles needed Debug your config and map (the latter is sometimes really interesting to find the right orientation and graphic for the tile notations...)

Generate the classes with major differences

Most likely you will have to create a new StartRound class inherit one of the classes Check for differences in the OperationRound and StockRound and MergingRound (if needed) behaviour thats not yet configurable. Either make the Top Classes configurable or implement new derived specific classes. Those classes go into game/specific/_18Variant directory or ui.swing/specific/_18Variant

Do we need any changes to the UI Code ? (StartRoundWindow comes to my mind at first).. Do we need more information displayed in the GameStatus ? (StatusWindow and linked classes)

If the base game is running(Startround running smoothly into StockRound and subsequently the first OR) i usually start implementing the Private Powers from the easiest (using existing SpecialProperties) to the toughest (new Properties).

Check the tiles and map code for any special handling (not yet implemented) (MUltiple Tile Lays..)

Check the Train abilities see if those need special handling (Rusting, Hexes, Rotting) Adjust the RevenueCalculation for that...

Missing Features May 2020

  • Handling of Holding Companies (1844 Tunnel and Mountain Companies)
  • Merging Rounds with Player Interaction (18EU has a rudimentary version; needed for 1817; 18Ireland)
  • Halfpay for direct company revenues (Mail Contracts)
  • Special Trains 3/2 or Pullmann calculations (1822, 1846 ?)
  • Companies keeping other companies (1841, others ?)
  • Handling and displaying of Loans like for 1817
  • Secure destination run handling (18OE) -> OrientExpress
  • Offboard and See Rights Handling in 18OE (Route calculation, Tile laying)
  • Map Layering (Handling of Incentives in 18OE)
  • Multiple Tilelaying by different players for 1 Company (1822MX)
  • Complex bidding (1822 family) needs a different StartRound and StockRound UI