Web-Based Tool for Deck Optimisation in Magic: The Gathering
Published:
Problem
In competitive Magic: The Gathering, optimising the balance of resources (e.g., lands vs. spells) in a deck is crucial for consistent gameplay outcomes.
Players often rely on intuition or static charts, but an interactive, parameterised probability tool can make the process data-driven.
Goal: Create a fully interactive, browser-based tool to model draw probabilities for different deck configurations and help players optimise resource distribution.
Approach
- Designed a hypergeometric probability model to estimate the likelihood of drawing specific resources within defined game stages, given deck composition.
- Implemented the probability engine in JavaScript for client-side computation, enabling instant recalculation as users adjust deck size, land count, and draw parameters.
- Built a responsive UI using HTML/CSS for clarity and mobile compatibility.
- Hosted via GitHub Pages for free public access without server infrastructure.
Stack
- Mathematical foundation: hypergeometric distribution for discrete draw probabilities.
- Frontend development: JavaScript for logic and interactivity, HTML/CSS for structure and styling.
- Deployment: GitHub Pages hosting for frictionless user access.
Results
- Delivered a tool where players can adjust inputs and instantly view probability curves and summary statistics.
- Enabled scenario testing for resource distribution, improving deck consistency and performance.
- Supported competitive decision-making with rigorous, data-driven insights.
Impact
- Showcases application of probability theory in a gaming context.
- Demonstrates ability to design, code, and deploy a performant, accessible interactive tool from scratch.
Links & Resources
- 🌐 Live tool: MTG Deck Optimisation Tool
- 💻 Code repository: GitHub – MTG
Role
- Developed hypergeometric probability model and optimisation logic.
- Implemented full frontend in JavaScript with responsive design.
- Deployed via GitHub Pages for public access.