Development Guide

This section provides comprehensive information for developers who want to contribute to or work with the Rummage MTG Commander game engine.

Table of Contents

  1. Introduction
  2. Key Development Areas
  3. Development Environment
  4. Working with Bevy
  5. Integration with Testing

Introduction

The Rummage development guide is designed to help developers understand the architecture, code style, and development practices used in the project. Whether you're a new contributor or an experienced developer, this guide will help you navigate the codebase and make effective contributions.

Rummage follows a test-driven development approach, which means testing is an integral part of the development process. Understanding how development and testing interact will help you create robust, maintainable code that correctly implements the complex MTG rule system.

Key Development Areas

The development documentation is organized into these key areas:

  1. Getting Started

    • Setting up your development environment
    • Building and running the project
    • First steps for new contributors
  2. Architecture Overview

    • High-level system architecture
    • Component relationships
    • Design patterns used
  3. Code Style

    • Coding conventions
    • Documentation standards
    • Best practices
  4. Working with Bevy

  5. Core Systems

    • Snapshot System - Game state serialization and replay functionality
    • Testing - How core systems integrate with testing

Development Environment

To work with Rummage, we recommend the following tools and configurations:

Required Tools

  • Rust (latest stable version)
  • Cargo (comes with Rust)
  • Git
  • A compatible IDE (Visual Studio Code with rust-analyzer recommended)

For Visual Studio Code:

  • rust-analyzer: For Rust language support
  • CodeLLDB: For debugging Rust applications
  • Better TOML: For editing TOML configuration files

Building the Project

Basic build commands:

# Build in debug mode
cargo build

# Build in release mode
cargo build --release

# Run the application
cargo run

# Run tests
cargo test

Working with Bevy

Rummage is built on the Bevy game engine, which provides a data-driven, entity-component-system (ECS) architecture. The Working with Bevy section provides detailed guidance on:

  • Understanding ECS: How Rummage organizes game elements into entities, components, and systems
  • Plugin Development: Creating and working with Bevy plugins
  • Rendering Systems: Implementing visual elements and UI components
  • Bevy 0.15.x Specifics: Working with the latest Bevy APIs

Bevy 0.15.x introduces some important changes, including deprecated UI components like Text2dBundle, SpriteBundle, and NodeBundle which are replaced by Text2d, Sprite, and Node respectively. Our documentation provides guidance on using these newer APIs correctly.

Integration with Testing

Testing is a foundational aspect of Rummage development, ensuring that our implementation correctly follows MTG rules and maintains compatibility across system changes. Our Testing Overview provides comprehensive information on our testing approach.

Test-Driven Development Workflow

When developing new features for Rummage, we follow this test-driven workflow:

  1. Document the Feature: Define requirements and behavior in the documentation
  2. Write Tests First: Create tests that verify the expected behavior
  3. Implement the Feature: Write code that passes the tests
  4. Refactor: Improve the implementation while maintaining test coverage
  5. Integration Testing: Ensure the feature works correctly with other systems

Testing Infrastructure in Development

Our development process is tightly integrated with testing:

  • ECS System Testing: Use ParamSet and other techniques described in the ECS Guide to avoid runtime panics
  • Snapshot Testing: Leverage the Snapshot System for deterministic state verification
  • Visual Testing: For UI components, use our visual differential testing tools

MTG Rule Verification

When implementing MTG rules, refer to both:

By integrating testing throughout the development process, we ensure that Rummage maintains a high level of quality and accurately implements the complex MTG rule system.

Contributing

We welcome contributions to the Rummage project! Please see our contribution guidelines for information on how to submit changes, report issues, and suggest improvements. For specific guidance on our git workflow and commit message format, refer to our Git Workflow Guidelines.

Next Steps

To start developing with Rummage, we recommend:

  1. Read the Getting Started guide
  2. Review the Architecture Overview
  3. Familiarize yourself with Bevy ECS concepts
  4. Review the Testing Overview to understand our testing approach
  5. Check out the API Reference for detailed information on specific components and systems

For questions or assistance, please reach out to the development team through the project's GitHub repository.