Game State Model - jeutn/omg-research-project GitHub Wiki

5.1 Global State

5.1.1 Deck

Type: List Description: Represents the draw pile

Invariants:

  • deck.size > 0 at all times
  • Cards are always drawn from deck[0] (top of deck)
  • Deck must be shuffled at the start of each round

Transitions:

  • On discard: cards discarded from hands are appended to a discard pool
  • On reshuffle: the discard pool is shuffled and reassigned to deck

5.1.2 Discard Pile

Type: List Description: Stores used or discarded cards before reshuffle

Invariants:

  • discardPile.size >= 0

5.1.3 Market Display

Type: List Description: Publicly visible cards determining available resources; 'market display'

Invariants:

  • marketDisplay.size >= 0
  • Cards are only added during Phase 1 and 3
  • Cards remain visible until end of the round, then it is reset

Derived State:

  • availableResources = marketDisplay + playerHand

5.1.4 Round Number

Type: Integer

Invariants:

  • roundNumber >= 1
  • Increments only after Clean-up phase

5.1.5 Phase

Type: Enum {Preparation (Sunrise), Planning, Resource Finalisation (Sunset), Production, Cleanup}

Invariants

  • Follows an order

5.2 Player State

5.2.1 Hand

  • Cards available to the player
  • Inventory of # of resources and # of buildings available Rules:
  • Cards are multi-purpose (Building, Resource, Economy)

Type: List

Invariants:

  • hand.size >= 0
  • Cards are hidden from other players
  • Cards are multi-purpose: {building, resource}

5.2.2 Buildings (Building Site)

Type: List<BuildingCard, Worker, Assistant(Opt.)>

Invariants:

  • buildings.size >= 1 (player must always have at least one building including the Charburner)
  • Only constructed buildings exist in this list
  • There is always at least 1 active building (for production) per round

5.2.3 Assistants

Type: Integer

Invariants:

  • 0 <= assistants <= 2
  • Assistants are unlocked only when: certain combinations of buildings in a player's building site are active

5.2.4 Worker Mode

Type: Enum { Efficient, Sloppy }

Invariants:

  • Must be selected during Planning phase
  • Cannot change after Planning phase ends

5.2.5 Planned Actions (Temporary State)

Type: Struct

Planned actions can include:

  • Worker mode (sloppy or efficient)
  • Chosen building for production
  • Additional building for production (if assistant in use)
  • Optional additional building for construction

Invariants:

  • Must be fully defined before Production phase
  • Cleared after Cleanup phase

Permanent Player State Properties

5.2.6 Victory Points

Type: Integer

Invariants:

  • victoryPoints >= 0
  • Updated only during Cleanup or scoring events
  • Aggregated from buildings, coins, assistants

Note: this may or may not be visible to the player in digitisation

5.2.7 Inventory (Goods Storage)

  • Record of goods produced and their corresponding economical value (coins)

Type: Dictionary<GoodType, Integer>

Invariants:

  • All values ≥ 0
  • Goods are produced via buildings only

5.2.8 Coins

Type: Integer

Invariants:

  • coins >= 0

5.3 Phase State

5.3.1 Preparation (Sunrise)

Effects:

  • Reveal cards onto market display

Constraints:

  • Only modifies marketDisplay

5.3.2 Planning

Effects:

  • Players select: worker mode, production building, optional construction, optional assistant hire

Constraints:

  • No randomness introduced
  • All decisions stored in plannedActions

5.3.3 Resource Finalisation (Sunset)

Effects:

  • Additional cards added to Market Display

5.3.4 Production

Effects:

  • Resolve all planned actions
  • Determine success/failure of production

Constraints:

  • Probabilistic outcomes should be logged (for transparency)
  • Function will check if any player has 8 buildings - if yes, trigger final round process

5.3.5 Cleanup

Effects:

  • Clear plannedActions
  • Move used cards to discard pile
  • Update round number

5.4 System-Level Invariants

These must always hold true:

Every player has:

  • ≥ 1 building
  • ≥ 0 cards in hand
  • No resource or currency can be negative
  • Deck + discard + all player zones = full card set (no duplication/loss)

The card draws must be random to emulate the physical game. Randomness in digital games can be deterministic (using seeds) or logged for replayability. See more Mechanics.

5.5 Transparency Requirements

For increased visibility of actions, consequences and the game state, the digitised game could have:

  • Full history/log of:
    • Card draws
    • Production outcomes
    • Resource calculations
  • Predicted production outcomes
  • Recommended production activity
⚠️ **GitHub.com Fallback** ⚠️