Giter Site home page Giter Site logo

dragalia-controller's Introduction

Dragalia-Controller

This is a Python 3.7 script which enables using a controller to control the mobile game Dragalia Lost on Android without an emulator by using scrcpy.

Video Demo!

Requirements

  • Android device
  • Latest scrcpy
  • Xbox One/360 controller
  • Python 3.7+ (with pip)
  • PyAutoGUI
  • PyInputs
  • PyWin32

First Time Setup

  1. Make sure you have all of the requirements fulfilled and you know how to use/run each one.
  2. Run pip install pyautogui
  3. Run pip install inputs
  4. Run pip install pywin32
  5. Clone this repository to anywhere on your computer.
  6. Adjust button ratios as needed.
  7. Adjust the following constants
Constant Default value
WINDOW_TITLE 'Pixel 2' (this should be the title of the scrcpy display window)
UI_LAYOUT 'right' ('right' or 'left' UI Layout)
TITLE_OFFSET 30 (Thickness of your Windows titlebar - affected by Windows scaling)

Running

  1. Start scrcpy, preferrably with the window title.
  2. Connect your controller of choice.
  3. Run python dragalia-controller.py
  4. Keep the window at the same aspect ratio without black bars if you need to resize it.
  5. Sit back and enjoy using your controller to play!
  6. Press ctrl+c a few times to quit.

Defaults (my setup)

  • OS: Windows 10
  • Windows Display scaling: 100%
  • Monitor size: 1920x1080, 24"
  • Phone resolution: 1080x1920, Pixel 2
  • Dragalia Lost: Quick90 off, Quick180 off

Default Key mappings for Xbox One/360

Button Action
A Attack (tap)
X First skill
Y Second skill
B Third skill
LB Dragon
RB Helper skill
Left Joystick Move
Right Joystick Dodge (Swipe)
Menu Pause/unpause
Select Minimap
DPad Up/Down Switch character up/down

Contributing

Please fork the repository, and make a pull request! Make sure to be as detailed as possible in your description - I'll probably accept it. All improvements are welcome!

Bugs

There are lots of them, I'm sure (see below). If you find something though, please create an issue. Be as detailed as possible!

TODO/Nice to haves

  • Better joystick input handling (something's off about deadzone detection, especially on X-only and Y-only axes)
  • Multiple controller support (PlayStation, etc)
  • Different DPI scaling support
  • Different devices (find an easier way? relative screen boundaries vs exact screen boundaries?)
  • Automatic detection of which menu you're in and switch input schemes automatically (inputs may be able to do detection)
  • Sticker menu (find a button combo)

Dragalia Lost is copyright Nintendo, Cygames.

dragalia-controller's People

Contributors

thinkaliker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

alfonso8483

dragalia-controller's Issues

More documentation needed

Hi, I am trying to modify this script for another game(Honkai Impact 3) but am unable to figure out how can i position joystick
but buttons can be set something like this (something like using screen aspect ratio):
(new position buttonx) = ((screen resolution x) / (position of button x)) * (new screen resolution x)
(new position buttony) = ((screen resolution y) / (position of button y)) * (new screen resolution y)

x and y are axis here not the button names
plus not all of the buttons are defined in the script and i am having difficulty in understanding button names.

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.