Loreinator / Shuffle-Move

Program to help choose moves in the Pokemon Shuffle puzzle game
GNU General Public License v3.0
95 stars 18 forks source link

Stage 37 Meowth solver #24

Closed Loreinator closed 6 years ago

Loreinator commented 9 years ago

Criteria:

ALWAYS gets 400g or 500g from the stage.

Easy to use, works out-of-box depending on your current status for score/hp and moves left.

Attempts to salvage any bad runs as best it can - finishing the level if you can't get any coins, or grabbing as much gold as you can and finishing it.

Leanny commented 9 years ago

I'll try to find an algorithm for this. I have a basic idea on how to do this, but writing it down and verifying the algorithm for "all" cases will be hard. (E.g. If the team used consist of 4 lv 1 base 30 NVE pkmn, this will be unsolvable ... need to find a good criterion folr this)

Loreinator commented 9 years ago

For an efficient solver, you could give a scoring metric of how good the situation is after a move. Basically, some way to numerically rank all possible boards given the number of moves remaining. Using that, we could sort by that metric and our gold farming will almost always end with 500 or 400 gold. On Sep 22, 2015 3:54 PM, "Leanny" notifications@github.com wrote:

I'll try to find an algorithm for this. I have a basic idea on how to do this, but writing it down and verifying the algorithm for "all" cases will be hard. (E.g. If the team used consist of 4 lv 1 base 30 NVE pkmn, this will be unsolvable ... need to find a good criterion folr this)

— Reply to this email directly or view it on GitHub https://github.com/Loreinator/Shuffle-Move/issues/24#issuecomment-142400589 .

Leanny commented 9 years ago

Pretty neat idea. I will look into it :)

tcm1998 commented 8 years ago

Any updates on this yet? I'd like to have a go at this myself, but since it's already taken, I thought I'd better ask first. It would be a waste of time to do thing twice!

Loreinator commented 8 years ago

Nope, I haven't had time due to work and other obligations. Go ahead if you think you know how to do this.

-Andrew On Oct 15, 2015 3:25 AM, "tcm1998" notifications@github.com wrote:

Any updates on this yet? I'd like to have a go at this myself, but since it's already taken, I thought I'd better ask first. It would be a waste of time to do thing twice!

— Reply to this email directly or view it on GitHub https://github.com/Loreinator/Shuffle-Move/issues/24#issuecomment-148303875 .

tcm1998 commented 8 years ago

My ideas so far ...

First version will be limited to the normal "right edge" technique (collecting the coins in the 6th column). The coins situation in this column can be "converted" into a number from 0 to 63 (6 bits binary), where a lot of situations can be discarded as a fail or an impossible situation. This way every coin situation can be rated pretty easily using 2 predefined arrays or, even better, a predefined dictionary.

Now, unfortunately, not every move will directly lead to an improvement in the coin situation. For that reason, I'd like to calculate up to 3, maybe even 4 moves (recursively) to get to such a coin improvement.

How does this sound so far?

Now the only thing I don't seem to get from studying the source is the feeders. Are the feeders used for creating skyfall? It obvious that potential combo's at the top have to be verified. Otherwise poor Meowth will die too fast, but I don't seem to understand how I can use the existing feeder code for this. Besides that it seems minimum feeder height seems to be set hardcoded to zero. To me that makes even less sense.

Loreinator commented 8 years ago

The main problem is that if you allow it to calculate 3 or 4 moves forwards... that could be a huge number of possible paths = computationally expensive. It might not be possible for modern hardware to accomplish this in a reasonable timespan without significant optimizations.

Ideally, the comparrision should operate on a single result and not require the simulation to be called more than once more.

FlipzMCL commented 8 years ago

You know, I've been thinking a bit about how to make a Meowth-37 solver mode, and I've come up with a few simple rules that could help.

  1. Put a hard cap on the score the solver is allowed to suggest; if a move would make the total score exceed 1150 points before the last turn, that move is invalid and an alternate needs to be found (i.e. that move gets dropped to the bottom of the priority queue). If all available moves will make the total score exceed 1150 points, suggest the move that provides the most gold.
  2. When possible, avoid leaving groups of icons that can be triggered by skyfall.

The above two don't really "solve" Meowth, but they provide useful metrics by which to sort the available moves for a manual solution--a useful stopgap a la the Weekend Meowth mode until the full solver is available.

The following two describe my thought process when I'm trying to solve Meowth; I'm not sure if they're simple enough to code easily, but at least it's a start on analyzing how player behavior works on the stage:

  1. Look for matches that will group coins in pairs of two on the right-most column. If no such move exists, look at the icons above and below each single coin in the right-most column, then try to group two or more of one of those icons around a single coin not residing in the right-most column.
  2. If there are three of the same icon in between coins in the right-most column, try to make a four-match so that the top and bottom coins become adjacent. (I prefer to have lots of different icons in the right-most column, so I have the maximum number of options when choosing what to match in order to drag the spawned coins into the column.)

Hope this helps!

dschu012 commented 4 months ago

I'm 8 years late to the party, but was this ever done? I just started playing recently and was curious since I see the issue marked as complete.

Edit: if anyone is interested in this in the future, this is hacky but seems to get 300+ coins most times. it looks 1 move ahead to determine a move to try to line up coins on the right side to later cash in (looking 2+ took too long). https://github.com/Fvegini/Shuffle-Move/compare/master...dschu012:Shuffle-Move:adb_test_1