Game State Model - jeutn/omg-research-project GitHub Wiki
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
Type: List Description: Stores used or discarded cards before reshuffle
Invariants:
- discardPile.size >= 0
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
Type: Integer
Invariants:
- roundNumber >= 1
- Increments only after Clean-up phase
Type: Enum {Preparation (Sunrise), Planning, Resource Finalisation (Sunset), Production, Cleanup}
Invariants
- Follows an order
- 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}
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
Type: Integer
Invariants:
- 0 <= assistants <= 2
- Assistants are unlocked only when: certain combinations of buildings in a player's building site are active
Type: Enum { Efficient, Sloppy }
Invariants:
- Must be selected during Planning phase
- Cannot change after Planning phase ends
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
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
- Record of goods produced and their corresponding economical value (coins)
Type: Dictionary<GoodType, Integer>
Invariants:
- All values ≥ 0
- Goods are produced via buildings only
Type: Integer
Invariants:
- coins >= 0
Effects:
- Reveal cards onto market display
Constraints:
- Only modifies marketDisplay
Effects:
- Players select: worker mode, production building, optional construction, optional assistant hire
Constraints:
- No randomness introduced
- All decisions stored in plannedActions
Effects:
- Additional cards added to Market Display
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
Effects:
- Clear plannedActions
- Move used cards to discard pile
- Update round number
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.
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