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

Stepwise moves #36

Closed Leanny closed 6 years ago

Leanny commented 9 years ago

After using Shuffle Moves I asked myself a lot "How the hell can this be a 7 combo?!" and could only see a 5 combo. It would be really useful if you can make a "Step" function that allows to see how the whole move is executed. A step would be defined by at least these points:

I hope this is possible to realise without much to do. If you need ideas how to implement this:

avengah commented 9 years ago

I second this, as well as an undo function so you can see the final state of the board and go back. This would be useful for potentially setting up the next turn.

Loreinator commented 9 years ago

@Leanny There is a way for me to hook this into the existing framework, but my only concern is how much memory this will take. The SimulationResult will obviously have to change slightly to include this new component of data. The boards that result could be listed there with their likelihood and allow you to select them to switch between which you want to 'step' through.

@avengah what do you mean by undo? There already is an undo function in the program.

avengah commented 9 years ago

Oh, sorry, my mistake - I must have missed it.

Leanny commented 9 years ago

@Loreinator It looks like you are storing the whole result board for each possible move. Wouldn't it be possible to store the reference to the original board and a diff set where only the changed ones are stored? (E.g. [[1,1],Air] for in 1,1 is now Air.) That way you would not need to store the whole board and will save memory most of the times. The calculation of the new board would be easy by replacing the tiles. Undo would be possible by creating an inverse array. (E.g. [[1,1], Bulbasaur] for Bulbasaur in 1,1.) Steps could be done easily with this and would not need that much memory, since the whole board would rarely change at once.

Loreinator commented 9 years ago

Good idea, I hadn't thought of that - since the boards are fairly efficiently stored anyway I never considered compression of them.

It will take some doing though to get it perfect - and I'm definitely going to write some rigorous tests for it, i.e. randomized boards and small random changes to see that the before and after (and reverse) are all consistent.

tcm1998 commented 8 years ago

IMHO it's not necessary to store all in-between boards for all moves. When step by step inspection comes around, the user has already chosen ONE move. Why not run the simulation for THAT particular move again, but now storing the in-between results? After that the UI can deal with displaying the in-between steps.

Loreinator commented 8 years ago

Yup, definitely possible to adapt the simulation to do that.