Skip to content

Observations

Both wrappers return dictionary observations:

{
    "observation": np.ndarray,
    "action_mask": np.ndarray,
}

observation is a flat categorical int64 NumPy array backed by a Gymnasium MultiDiscrete space. action_mask is an int8 NumPy array backed by MultiBinary.

Feature Names

Raw environments expose observation_feature_names. This tuple is the stable feature-name to index mapping for the flat vector:

raw = raw_env(seed=123)
raw.reset()
names = raw.observation_feature_names
observation = raw.observe("player_0")["observation"]
score_0 = observation[names.index("score_0")]

Generated schema pages list every feature and categorical cardinality:

Visibility

The match wrapper is perspective-aware:

  • The perspective player's hand card ids are visible.
  • Opponent hand slots are hidden as 0.
  • Deck order is not exposed.
  • Deck, hand, graveyard, banished, and set-aside counts are exposed.
  • Board state, graveyards, banished cards, scores, leader charges, coins, mulligans, crowns, pass state, and pending-choice metadata are exposed.

Card ids are categorical. 0 means empty, hidden, or unknown. Positive values map to sorted curated catalog ids for the configured catalog version.

Match Vector Contents

The match vector includes:

  • Match globals: perspective player, phase, active player, first player, pending player, round number, result, scores, and pending-choice count.
  • Per-player public state: leaders, stratagems, charges, coins, mulligans, crowns, pass flags, and zone counts.
  • Hand slots for the perspective player only.
  • Both players' board rows, including card, power, armor, ownership, controller, zone, tracked statuses, counters, order state, cooldown, and charges.
  • Fixed row-effect duration slots.
  • Graveyard and banished history slots.
  • Pending-choice option slots.

Deckbuilding Vector Contents

The deckbuilding wrapper prepends meta features to a full match observation vector:

  • Current meta stage, perspective player, active player, and match-started bit.
  • Per-builder deck readiness, build-started flag, leader, stratagem, draft counts, provision totals, provision cap, validity, and per-card counts.
  • The inner match vector, zeroed until a match exists.

During match play, the prepended deckbuilding features remain present and the inner match observation is copied from the active GwentPettingZooEnv.