Forge is a dynamic and open-source Rules Engine tailored for Magic: The Gathering enthusiasts. Developed by a community of passionate programmers, Forge allows players to explore the rich universe of MTG through a flexible, engaging platform.
Note: Forge operates independently and is not affiliated with Wizards of the Coast.
🌟 Key Features
🌐 Cross-Platform Support: Play on Windows, Mac, Linux, and Android.
🔧 Extensible Architecture: Built in Java, Forge encourages developers to contribute by adding features and cards.
🎮 Versatile Gameplay: Dive into single-player modes or challenge opponents online!
🛠️ Installation Steps
📥 Desktop
Latest Releases: Download the latest version here.
Snapshot Build: For the latest development version, grab the forge-gui-desktop tarball from our Snapshot Build.
Tip: Extract to a new folder to prevent version conflicts.
User Data Management: Previous players’ data is preserved during upgrades.
Java Requirement: Ensure you have Java 17 or later installed.
📱 Android
(Note: Android 11 is the minimum requirement with at least 6GB RAM to run smoothly. You need to enable "Install unknown apps" for Forge to initialize and update itself)
Download the APK from the Snapshot Build. On the first launch, Forge will automatically download all necessary assets.
📱 iOS (early stage)
Build the IPA according to Wiki
No jailbreak needed, only developer mode and iOS 16-27
Connect your device to a PC to self-sign and upload the app file, multiple tools exist e.g. Sideloadly
🎮 Modes of Play
Forge offers various exciting gameplay options:
🌍 Adventure Mode
Embark on a thrilling single-player journey where you can:
Explore an overworld map.
Challenge diverse AI opponents.
Collect cards and items to boost your abilities.
🔍 Quest Mode
Engage in focused gameplay without the overworld exploration—perfect for quick sessions!
🤖 AI Formats
Test your skills against AI in multiple formats:
Sealed
Draft
Commander
Cube
For comprehensive gameplay instructions, visit our User Guide.
💬 Support & Community
Need help? Join our vibrant Discord community!
📜 Read the #rules and explore the FAQ.
❓ Ask your questions in the #help channel for assistance.
🤝 Contributing to Forge
We love community contributions! Interested in helping? Check out our Contributing Guidelines for details on how to get started.
ℹ️ About Forge
Forge aims to deliver an immersive and customizable Magic: The Gathering experience for fans around the world.
No good first issue or help wanted issues are currently available.
Contribution Guide
Contributing to Forge
Forge is an open-source project run by volunteers, and contributions are welcome! This page explains how to get set up and how to avoid the most common problems in pull requests.
A Java IDE. IntelliJ is recommended. Eclipse also works and includes Maven.
To get started, fork the project on GitHub and clone your fork. Then run Maven from the project folder to download the dependencies and build a snapshot:
mvn -U -B clean -P windows-linux install
Add -DskipTests for a faster build. The IntelliJ setup guide explains how to run the desktop and mobile clients. To test a change in a game, you can turn on Developer Mode in Preferences.
Android
[!CAUTION]
Shared code also runs on Android. Be careful about using Java APIs that Android doesn't support such as StringBuilder.isEmpty(). Google's documentation for these is sometimes inaccurate.
Install these through the Android SDK Manager (in IntelliJ: Tools > Android > Android SDK Manager):
Android SDK Build-tools 35.0.0
Android 15 (API 35) SDK Platform
Proguard 7.6.0 is included under forge-gui-android/tools (proguard.jar). It supports up to Java 23.
Card scripting
Card scripts are in forge-gui/res/cardsfolder. The Card scripting API page on the wiki explains the format.
The easiest way to write a new script is to use a similar card as a template. Prefer one from a recent set, since older scripts can use outdated forms. Test the card in a game before you open a PR.
It is recommended to run the card-script linter before you open a PR, to identify mistakes such as misspelt parameters and ones the engine doesn't read. Card-script linting explains how to run it and what its findings mean.
Opening a pull request
Before opening a pull request you should do the following:
Check GitHub first for open PRs and issues on the same topic.
For a large change, it can be helpful to seek feedback on Discord before opening a PR.
In particular, new features for formats like Adventure Mode should be discussed with existing developers in the planning stage before any PR is opened. Sometimes stand-alone features make more sense to integrate into other mechanics, or a desired quality-of-life change may be better addressed by expanding on existing gameplay systems rather than simplifying them.
Keep each PR to one goal or feature. Avoid lumping different features into the same PR that could be dealt with separately.
For a change that may affect performance, you should profile the impact on different board states (e.g. 1v1, 4v4 Commander, wide token decks) and give before and after performance numbers in the PR description.
If your PR involves a visual or UI change, include a screenshot or video in the PR description.
Build and run the tests before you open a PR. CI runs mvn clean test, and Checkstyle fails the build on unused or redundant imports.
Using AI coding agents
[!IMPORTANT]
Use of AI coding agents such as Claude Code, Codex or Copilot is acceptable. However, ultimately you are the author responsible for any change, so make sure you understand it and can explain it.
If an agent wrote a substantial part of your contribution, say so in the PR body or add it as a co-author.
Agent-written PRs tend to go wrong in the same few ways:
Work with Forge's existing architecture. Before adding something new, check whether existing code already does the job and either re-use or adapt it, so the change fits how the rest of Forge works rather than adding a parallel system.
Keep the code simple. Aim for the clearest, smallest change that solves the problem.
Fix the root cause, not the symptom. Trace a bug back to where it starts and fix it there, rather than hiding the bug and leaving other cases broken.
Keep PRs as small as possible. Break a large feature into a minimal first version that works on its own, followed by smaller PRs, because one large PR takes much longer to review than two small ones.
Keep code comments short. Comment only what isn't obvious from the code, such as a hidden constraint or the reason for an unusual choice. Don't use a code comment to describe the bug you fixed or the change you made. That belongs in the PR description.
Make sure you run your change before you open a PR. Reproduce a bug before you fix it, check in a game that the fix works, and state in the PR description what you have verified.
Keep your PR description concise and to the point. It should identify the key issue in the PR, any implementation issues or decisions maintainers should be aware of, and what testing you have completed. Agents tend to write unnecessarily long and complex PR text.
If your change touches the rules engine, the AI or another complex system, it can help to have your agent run an adversarial review before you open the PR. Ask it to look for ways the change could be wrong, not just to confirm that it works.
If your change doesn't originate from the Comprehensive Rules (e.g. a new game variant or format, unprecedented mechanics from newly released cards, or un-cards) be ready to explain how it integrates and functions with the existing rules engine.
Try and answer review comments in your own words, or make clear when