Giter Club home page Giter Club logo

pazuauto's Introduction

pazuauto

This is the ultimate goal for pazusoba, solving the puzzle and performing the solution. scrcpy is used to mirror and control my Android devices. For iOS devices, Dell Mobile Connect can be used. Wormhole is another alternative and is quite good but it is paid.

For Android, there will be a standalone app to performance the automation on the device without a computer. Check out pazusoba-android.

Projects

Supported system

  • Windows
  • Mac OS
  • Linux, maybe (manual adjustment)

Scrcpy

It might be a good idea to reduce the bit rate and resolution so that it won't affect the performance of your device. The solver only needs to take a screenshot of it so it doesn't need to be too high resolution. The board is recognised by colour so it should work for all games.

$ scrcpy.cmd -b 1M -m 512

Supported games

  • Puzzle & Dragons (パズドラ)
  • Puzzle & Dragons Battle (パズドラバトル)
  • Puzzle & Dragons Z (パズドラZ)
  • Puzzle & Dragons Mario (パズドラマリオ)
  • Puzzle & Dragons X (パズドラクロス)

Last three games are supported if you play them on your device with citra emulator not on the 3DS. Yes, I own all three games and am playing them again at the moment.

Setup

The automation project should only be used for education purpose. DO NOT use it for any other purposes nor am I liable for anything you do.

It is recommended to use virtualenv inside automation/ and run pip install -r requirements.txt to install everything.

You also need pazusoba binary and place it in automation/.

Extra

Special thanks to my OP Cody 大先輩 for helping me with opencv.

pazuauto's People

Contributors

henryquan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

sile0007

pazuauto's Issues

Automation

TODO

  • Detect board when it is complete blacked out
    • Go to every orb and hold until it is read
  • Detect whether orbs are interactable
    • Detect battle (battle xx / xx) and wait for 1.5s
    • Detect empty tiles and wait for 1.5s or 3 cycles
    • When more than half the board is not readable (try again)
  • Support more orbs
  • Support different game ratio (need more testing)
    • Currently, only 2:1 is supported
    • There are 16:9 and also 3:2 available
    • The new iPad UI is also different
    • Template should be the same but not sure if it matters
  • Mac OS uses retina and the point location can be a bit different
  • Enter dungeons automatically
    • Pick the right dungeon
    • Choose my own leader
    • Enter the dungeon
  • Battle counter
    • Count battle from 0
    • Detect boss battle
    • Detect OK button (clear or game over)
  • Stop when out of stamina
  • Quit dungeon and avoid using magic stones
    • Still need to make sure touches are working
  • Fix touch issues with pyautogui
    • Sometimes, it doesn't click or mouse down
  • Use skill 1 to 6 (for 周回)
  • Detect board location
    • This is important when porting to Android
    • Can use the heart icon to determine the location
  • Faster screenshot
  • ~~~無限回廊三回まわる~~~
    • Pick the dungeon
    • Choose my own leader
    • Enter the dungeon
    • Count battle from 0 to 50
    • Clear the dungeon
    • Quit the dungeon
    • Do this 3 times
  • Normal dungeons
    • The program is running for a few hours and has cleared many normal dungeons one by one
  • Battle detector not working all the time
    • This should be the first thing to check
    • Continue can be very dangerous sometimes
  • Detect board size based on a single orb size
    • Board size can change during a battle, rare but possible

Structure update

The current implementation while being functional isn't great in the long run. I should have different strategies for different game mode. Thus, a refactor is needed to fix some problems.

  • Singleton class for configuration
  • Config should be easy to change
  • Introduce different strategies
  • Move some python scripts to a folder
    • config and main should be outside
  • Board detection should be automatic unless it failed many times
  • more coming soon

Call pazusoba.so with cdll

Currently, python is using the binary via command line and pazusoba writes the final route to the disk. This works very well but it isn't ideal because file I/O takes time. If python calls pazusoba via cdll, the data can be sent to python directly and python can simply read it and ask pazusoba to free the list. pazusoba will be compiled to a shared library as pazusoba.so. However, this is not possible unless pazusoba supports it.

WIP

  • Make pazusoba.so with cmake
  • Add a python wrapper
  • Pass data to the shared library
  • Receive the route from the library
  • Update cmake so that the output is libpazusoba.so on all platforms

All good for now. However, not yet finalised but it is working.

Board failure

The route might still be wrong or maybe I am just imagining things. This can be the automation issue. Note that the route can be checked every time. It is highly possible that skyfall broke it.

Original - Final - Route
LBRLGDDRGDLDLHGDBGHGBHRDGHBBRR
BRDRGDLLLLGDHGGDGDHHHRDBGBBBRR
LLULLDRDDRURRULUULDLLURRDRRDRD

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.