Corporations & Companies

This page documents the fields for CORPORATIONS and COMPANIES — the two entity arrays that define who plays, who invests, and what special abilities are in the game. Both are defined in entities.rb and included into the main Game class.

For trains, phases, and market configuration see Trains, Phases & Market.


CORPORATIONS

CORPORATIONS is an array of hashes, one per major corporation. Each hash is read by Engine::Game::Base during initialisation to construct Engine::Corporation objects [lib/engine/corporation.rb:1].

Required fields

FieldTypeDescription
symStringShort identifier shown on share certificates (e.g. 'PRR')
nameStringFull display name
logoStringPath under public/logos/ without the .svg extension (e.g. '1830/PRR')
tokensArray\Token cost at each city; first element is always 0 (home token is free)
coordinatesStringHex coordinate for the home token (e.g. 'H12')
colorStringCSS colour string for the corporation card

Common optional fields

FieldTypeDefaultDescription
float_percentInteger60Percentage of shares sold before the corporation floats and receives treasury cash
max_ownership_percentInteger60Maximum percentage of shares a single player may hold
typeSymbol:majorCorporation type; affects which Steps are available and how revenue is split
simple_logoStringSimplified logo path for small icon views
sharesArray\default IPO spreadCustom share distribution percentages
always_market_priceBooleanfalseIf true, all purchases use market price rather than IPO price
capitalizationSymbolCAPITALIZATION constantPer-corporation override for :full or :incremental capitalisation
president_percentInteger20Size of the president's certificate
par_via_exchangeBooleanfalseCorporation is pared by exchanging a private company
reservation_colorStringHex colour used for the IPO reservation
cityIntegerWhich city slot on the home hex receives the home token (for multi-city hexes)
second_cityStringSecond token coordinate for corporations that start with two tokens
abilitiesArray[]Corporation-level abilities (same structure as company abilities)

Where to look for more options

Many titles add custom corporation types or fields. Before adding new fields, check:

  • lib/engine/corporation.rb — full list of attributes read from the hash
  • lib/engine/game/g_1830/entities.rb — canonical 1830 example
  • lib/engine/game/g_1867/entities.rb — title with both minors and majors

Example

CORPORATIONS = [
  {
    float_percent: 60,
    sym:          'PRR',
    name:         'Pennsylvania Railroad',
    logo:         '1830/PRR',
    simple_logo:  '1830/PRR.alt',
    tokens:       [0, 40, 100, 100],
    coordinates:  'H12',
    color:        '#32763f',
  },
].freeze

COMPANIES

COMPANIES is an array of hashes defining private companies (privates). Each hash becomes an Engine::Company object [lib/engine/company.rb:1]. Privates are auctioned or distributed at the start of the game.

Required fields

FieldTypeDescription
nameStringFull display name
symStringShort identifier (e.g. 'CS')
valueIntegerFace value / purchase price
revenueIntegerIncome collected each OR while player-owned

Common optional fields

FieldTypeDefaultDescription
descString''Text description shown in the UI
abilitiesArray[]Special abilities granted to the owner
colorStringnilCard background colour (nil uses the default yellow)
min_priceIntegervalue / 2 rounded upMinimum resale price to another player
max_priceIntegervalue * 2Maximum resale price
typeSymbolCompany type (used by some custom Steps to filter)
treasuryIntegervalueStarting cash inside the company (rare)
discountInteger0Reduces the minimum auction bid

Abilities

Each ability is a hash with at least a type: key. Common types:

TypeKey fieldsEffect
blocks_hexesowner_type:, hexes:Prevents corporations from placing tokens on listed hexes while condition holds
tile_layowner_type:, hexes:, tiles:, when:, count:Grants a free or discounted tile lay on specified hexes
teleportowner_type:, tiles:, hexes:Allows token placement without connectivity
exchangecorporation:, owner_type:, when:, from:Allows exchange for a share of the named corporation
sharesshares:Purchaser automatically receives specified shares
no_buyCompany cannot be sold to corporations
closewhen:, corporation:Closes the company when the condition is met
revenue_changerevenue:, when:Changes revenue at a phase trigger

For the full ability vocabulary see Ability Types.

Example

COMPANIES = [
  {
    name:    'Champlain & St.Lawrence',
    sym:     'CS',
    value:   40,
    revenue: 10,
    desc:    'The owning corporation may lay a free tile on B20.',
    abilities: [
      { type: 'blocks_hexes', owner_type: 'player', hexes: ['B20'] },
      {
        type: 'tile_lay',
        owner_type: 'corporation',
        hexes: ['B20'],
        tiles: %w[3 4 58],
        when: 'owning_corp_or_turn',
        count: 1,
      },
    ],
    color: nil,
  },
].freeze

What's Next


Version: 2026-05-08 — derived from lib/engine/corporation.rb, lib/engine/company.rb, lib/engine/game/g_1830/entities.rb.