Commander Format

This section documents the implementation of the Commander (EDH) format in Rummage, a multiplayer format that emphasizes social gameplay, unique deck construction constraints, and strategic depth.

Note: For a high-level overview of the Commander format rules without implementation details, see the Commander-Specific Rules Reference.

Format Overview

Commander (formerly known as Elder Dragon Highlander or EDH) is a sanctioned Magic: The Gathering format with these defining characteristics:

FeatureDescriptionImplementation
Deck Construction100-card singleton decks (no duplicates except basic lands)Deck validation systems
CommanderA legendary creature that leads your deckCommand zone and casting mechanics
Color IdentityDeck colors must match commander's color identityDeck validation and color checking
Life Total40 starting life (vs. standard 20)Modified game initialization
Commander Damage21 combat damage from a single commander causes lossPer-commander damage tracking
Multiplayer FocusDesigned for 3-6 playersTurn ordering and multiplayer mechanics

Documentation Structure

The documentation is organized into the following sections:

  • Overview - High-level overview of the Commander format and implementation approach
  • Game Mechanics - Core game state and mechanics implementation
    • Game State Management
    • State-Based Actions
    • Random Mechanics (coin flips, dice rolls)
  • Player Mechanics - Player-specific rules and interactions
    • Life Total Management
    • Commander Tax
    • Color Identity
  • Game Zones - Implementation of game zones, especially the Command Zone
    • Command Zone
    • Zone Transfers
    • Zone-specific Rules
  • Turns and Phases - Turn structure and phase management
    • Turn Order
    • Phase Management
    • Multiplayer Considerations
  • Stack and Priority - Stack implementation and priority system
    • Priority Passing
    • Stack Resolution
    • Special Timing Rules
  • Combat - Combat mechanics including commander damage
    • Combat Phases
    • Commander Damage Tracking
    • Multiplayer Combat
  • Special Rules - Format-specific rules and unique mechanics
    • Partner Commanders
    • Commander Death Triggers
    • Commander-specific Abilities
  • Core Integration - How Commander extends MTG core rules

Key Mechanics Implementation

Command Zone

The Command Zone serves as the foundation of the format:

#![allow(unused)]
fn main() {
// Command Zone implementation
#[derive(Component)]
struct CommandZone {
    owner: Entity,
    contents: Vec<Entity>,
}

// Commander component
#[derive(Component)]
struct Commander {
    owner: Entity,
    cast_count: u32,
}
}

Key implementations:

  • Commanders start in the Command Zone
  • Zone transfer options when commanders change zones
  • Commander Tax calculation (2 additional mana per previous cast)

Commander Damage Tracking

#![allow(unused)]
fn main() {
// Tracking damage from each commander
#[derive(Component)]
struct CommanderDamageTracker {
    // Maps commander entities to damage received
    damage_taken: HashMap<Entity, u32>,
}

// System that checks for commander damage loss condition
fn check_commander_damage_loss(
    tracker: Query<(Entity, &CommanderDamageTracker, &Player)>,
    mut game_events: EventWriter<GameEvent>,
) {
    for (entity, tracker, player) in &tracker {
        for (_, damage) in tracker.damage_taken.iter() {
            if *damage >= 21 {
                game_events.send(GameEvent::PlayerLost {
                    player: entity,
                    reason: LossReason::CommanderDamage,
                });
                break;
            }
        }
    }
}
}

Key Commander Rules

The following key Commander rules are implemented in our engine:

RuleDescriptionImplementation Status
SingletonOnly one copy of each card allowed (except basic lands)
CommanderLegendary creature in command zone
Color IdentityCards must match commander's color identity
Command ZoneSpecial zone for commanders
Commander TaxAdditional {2} cost each time cast from command zone
Commander Damage21 combat damage from a single commander
Starting Life40 life points
Commander ReplacementOptional replacement to command zone
Partner CommandersSpecial commanders that can be paired🔄
Commander NinjutsuSpecial ability for certain commanders⚠️
Commander-specific CardsCards that reference the command zone or commanders🔄

Technical Implementation

The Commander format is implemented as a Bevy plugin that extends the core MTG rules:

#![allow(unused)]
fn main() {
pub struct CommanderPlugin;

impl Plugin for CommanderPlugin {
    fn build(&self, app: &mut App) {
        app
            // Commander components
            .register_type::<Commander>()
            .register_type::<CommanderDamage>()
            .register_type::<ColorIdentity>()
            
            // Commander resources
            .init_resource::<CommanderConfig>()
            
            // Commander systems
            .add_systems(Startup, commander_game_setup)
            .add_systems(
                PreUpdate,
                (check_commander_zone_transfers, validate_color_identity)
            )
            .add_systems(
                Update,
                (track_commander_damage, apply_commander_tax)
            );
    }
}
}

Testing Strategy

Commander testing focuses on these key areas:

  1. Rule Compliance: Verifying all Commander-specific rules
  2. Integration Testing: Testing interaction with core MTG systems
  3. Multiplayer Scenarios: Validating complex multiplayer situations
  4. Edge Cases: Partner commanders, commander ninjutsu, and other special mechanics

Each section includes detailed test cases to validate the correct implementation of Commander rules. Our testing approach ensures:

  1. Full coverage of Commander-specific rules
  2. Edge case handling for unique interactions
  3. Performance validation for multiplayer scenarios
  4. Verification of correct rule application in complex board states

For detailed testing approaches, see the Commander Testing Guide.

Implementation Status

FeatureStatusNotes
Command Zone✅ ImplementedComplete zone mechanics
Commander Casting✅ ImplementedWith tax calculation
Zone Transfers✅ ImplementedWith player choice
Commander Damage✅ ImplementedWith per-commander tracking
Color Identity✅ ImplementedDeck validation
Partner Commanders🔄 In ProgressBasic functionality working
Multiplayer Politics⚠️ PlannedDesign in progress

For more information on the official Commander rules, refer to the Commander Format Rules.