Giter VIP home page Giter VIP logo

talon_mtga's Introduction

MTGA Talon

Talon integration for Magic: The Gathering Arena (MTGA). Uses screen-based recognition to play cards and press buttons. Still requires some manual input for cards with targets and selecting blockers/attackers, but gets a good chunk of the way.

Caveats:

  • Tuned on a 1440p screen, may need tweaking for other resolutions
  • Has some edge cases with unusual card borders
  • Can struggle if you have many cards in hand
  • Still needs other interaction tools for blocks, individual attackers, and generally uncommon interactions
    • Pairs nicely with an eye-tracker for this

Short video of usage: https://youtu.be/hkBFbhc1mvg

Setup

  • Clone repo to Talon user folder e.g. C:\Users\<username>\AppData\Roaming\talon
  • Either install dependencies manually or install Anaconda 3
    • Manually
      • Open C:\Users\<username>\AppData\Roaming\talon\.venv\Scripts in command prompt
      • pip install "numpy>=1.21.4" "opencv-contrib-python==4.5.5.62" "opencv-python-headless==4.5.5.62" "pillow>=8.4.0" pyautogui
    • Anaconda 3
      • Create environment from provided yaml conda env create -f talon_env.yaml
        • This is allows side-loading tools without messing with the Talon virtual environment
  • Reload Talon

Usage

  • Consider turning off subtitles as unfortunately they appear over the cards and can't easily be moved
  • Run MTGA in full-screen
    • Disable alternate card arts
    • Ensure there are no overlays in the way
  • A special magic mode will be enable when selecting MTGA which disables other commands to improve detection
  • Use highlight cards or keep highlighting cards to show overlays and ensure that you're playing the thing you want
    • Highlights will close automatically or in continuous mode stopped with stop highlighting cards
    • Use select card X to activate a card
    • Use play X to play a card
    • You can skip highlighting first by saying fast X
  • Use done or ok to press any orange button
  • See mtga.talon for full command list
  • Note: Provides the mouse talon integration for mtga mode from the excellent knausj_talon

Example Overlay

MTGA with Talon Overlay

Notes

Fairly hacky approach to the optical recognition of the cards, but it runs decently fast and works most of the time.

  • Aims to run fast (currently <0.1s locally)
    • Lets numpy/OpenCV do the majority of the heavy lifting
  • Use MTGA's blue/yellow "playable" border to find the rough region
    • Left-most card has a darkened effect
    • Use region to strip out everything else
  • Use black border to find individual cards
    • Will always be delineated by blue borders
    • Parametrise black border to catch most cases
    • Pull border coordinates to get a clickable position

talon_mtga's People

Contributors

lif3line avatar

Watchers

 avatar

talon_mtga's Issues

Doesn't seem to quite work properly

The visual card recognition seems not to work; it almost never shows stuff in game even when i go "keep highlighting cards", and also seems to randomly turn on in other apps for some reason.

I installed the program in C:\Users<username>\AppData\Roaming\talon.venv\Scripts\user, as C:\Users<username>\AppData\Roaming\talon.venv\Scripts seems to do nothing at all.
I ran the pip install in the talon.venv\scripts folder.
I switched my monitor and in-game resolution to 1440p.
i have no cards with borderless art

Also, it seems to not disable outside commands while in MTGA.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.