chkgk / otree_slider_puzzle

Two-player slider puzzle for oTree
MIT License
2 stars 1 forks source link

The code sometimes record moves incorrectly #6

Open yukitakahashi1 opened 3 years ago

yukitakahashi1 commented 3 years ago

Hi Christian,

I am running an experiment using your slider puzzle as a real effort task and it worked completely fine in the code test. However, when I ran the experiment with real human subjects, the move_history variable recorded impossible moves for some subjects. For example:

Do you have any idea why this happened and how to recover the original moves (I am using the 2-player version of the puzzle)?

Some possibilities (just speculations):

HistoryPt3Rd1.xlsx HistoryPt3Rd6.xlsx

chkgk commented 3 years ago

Hi Yuki,

I am sorry to hear that you encountered issues running your experiment. I have not used this game in any of my own projects and therefore have no experience with its performance in actual experiments with many participants.

In the two-player variants, each move is recorded on the clients' side. Only the recorded move history of player one is used for the group history. Thus, your speculation that there were connection issues might be right. For future experiments, I guess one should store the moves for each player individually (like it is done in the single player variant), and figure out a way to resolve conflicts to determine a group's state of the board.

On recovering moves: One would have to check all recorded moves for plausibility / validity, then reconstruct the board up to the last known plausible / good condition and check if there is one (or a series of) valid moves that get the board to the next recorded move. This will be quite complicated to program and even more tedious to do manually. Maybe it is wise to check if the exact move history is needed to answer your research question. It will be difficult to analyze in any case...

yukitakahashi1 commented 3 years ago

Hi Christian,

Thank you very much for your reply. I do not need the exact move history per se, but I will probably need it because I need the following information: (i) whether a player's move is reversed by the other player and (ii) the number of moves each player made that reduced (and increased) the number of moves required to reach the solution. It would be difficult to obtain these without the exact move history.

If I want to store the moves for each player individually (as in the single-player version), how should I modify the codes (I am sorry, but I am not familiar with javascript)? Or better, would it be possible to store the group moves in the player model so that we can have two identical move histories for each player. We can check if they coincide, and if not, can infer which moves are missing.

And, may I ask a few additional questions?

yukitakahashi1 commented 3 years ago

Hi Christian,

Sorry to write to you again, but may I also ask this issue to the oTree discussion group? Chris may have some ideas on it.

(But I'd still like to have your help on how to edit the javascript so that it stores the moves for each player individually and/or stores the group moves on both sides of the players.)

chkgk commented 3 years ago

Hi Yuki,

Of course you can ask anyone for help, but I would recommend to upload your actual code for the experiment to a repository, so that others can check and refer to it directly. That might be especially helpful if you have implemented your custom logic to determine good/bad moves.

I have created a new branch on my repository in which I implement storing both players' moves and comparing them before determining the group outcome. Here is a direct comparison of the code: https://github.com/chkgk/otree_slider_puzzle/compare/store_both_players

To your questions: I am not sure what exactly is going on. I thought that a weak internet connection might be plausible. However, you are right, that the puzzle should not be solvable then. Another issue I see is that the game is reset for a player, if s/he refreshes the browser page mid-game. Currently, the board is not restored to the last known position, but rather starts from scratch. That might also explain why moves differ between players and why one player might have made "impossible" moves, given the other player's state of the board.

Unfortunately, tackling these issues and further developing the game is far outside the scope of my work here. As I said, I am not using this code. I simply wrote it as a starting point when you asked on the Google group. I am afraid that you would have to develop further features yourself or find somebody to do it for you. I really cannot support this much more. That said, it is published under the MIT open source license. You can use, modify, and change every part of the code as you like without having to ask me.