padopt - a Puzzle & Dragons Optimizer
- Select a profile, or create your own profile, to get better solutions.
- Input your board, by
- left or right click on an orb to select its type;
- click on the top green bar to pick a screenshot from your mobile or desktop file system;
- drag-and-drop a screenshot from desktop into the browser window;
- use "Import" feature to manually input all orbs using keyboard;
- Click "Solve" after completing the board.
- Choose one solution and see how it is performed.
I recommend using this tool to check solutions and for learning purposes; it rarely if ever gives a truly optimal board solution and does not take into account unprotected cascades, orb movement timer, complexity of the path, and other details. That being said, do what you like with it. ¯\(ツ)/¯
Profiles and Calculations
All these do is change the weights of specific orb combinations to change the multiplier value of given solutions. Despite Rows being one of the possible inputs it does a pretty awful job of doing it. I wouldn't recommend using this tool for Row teams (and honestly you shouldn't need to given that they're almost never combo reliant).
For each main attribute add 1 to that color under 'N.' You can optionally add .3 to the columns for sub attributes but it won't change your results much. For color combo leads such as Kali, just put 1 for required colors and 0 for everything else.
For TPA calculations, each TPA on the monster is an additional 1.5 multiplier:
tpa = 1*(1.5)^n - 1
Add the resulting weights for each color.
For example, if you have 3 green monsters and one has a TPA and the other has two TPA, the base weight is 3 and the TPA effect is 1 x 1.5 for the single TPA (.5 extra) and 1 x 1.5 x 1.5 = 2.25 (1.25 extra) for the double TPA so you enter 1.75.
Alternatively just put 1 where you have TPAs and 0 where you don't.
New Predefined Profile
Profiles are now define in profile.js. Feel free to add new profile and send me a pull request. You can also create your own customized profile and save in browser (localStorage).
Browsers with following supported:
gulp to start a development server at port 8080. The only SCSS file (source.scss) will compile to CSS on-the-fly. Both JS and CSS are auto minify. Everything is config under gulpfile.js.
- source.js: The main JS, which interact with all other JS files and DOM. No other JS files will interact with DOM or each others!!!
- board.js: The game boards, solution path, and path animation.
- image-analysis.js: Analysis screenshot for orbs.
- optimizer2.js: Calculate solutions. Rewrite base on optimizer.js, Remove (almost) all global variables and wrap it into a function (as Class). Remove code that interact with DOM and board. Rename all functions and variables name. Multiple logic is rewrote completely. Other logic is same as the old optimizer.js.
- profile.js: Store pre-defined profiles, and load/save customized profile from/to localStorage.
- polyfill.js: JS es6 polyfill for old browser.
- modernizr.js: Browser features detection.
- Introduce better solver (e.g. this post). Currently just a brute-force greedy algorithm, which may not produce truly optimal results.
- Resolve overlapping lines and points.
- Simulate swapping and matching when playing the animation and dropping the matches.
- The default weight of the profiles may need to be adjusted.
- Image analysis: enhance orb shape analysis
- Profile add support for different leaders (Leader and Friend using different monster).