hback – 0.0.2
This is an update to my hback memory game. You can always grab the latest version from hback-latest.tar.gz.
Based on feedback (kudos James and Joseph) I’ve refactored a lot of the code and added the following feature requests:
- Left and right arrows toggle the buttons on/off. Joseph’s suggestion worked fine, but on my setup it only highlighted the correct button. This seems a little counterintuitive to me since the API calls it an “activation”; my version looks for key events and automatically toggle the buttons.
- Game has a Pause mode which can be toggled on/off with
'p' - Added some comments ;-)
- Added a score logger which I think would be cool for eventually analyzing lots of data (eg. pretty graphs of user improvement over time). This can be disabled with
turnOffLogging=Truein hback.hs, although I don’t see why you would want to: I’m not sending your data over the wire to analyze average IQs of Haskell hackers (yet).
I think the biggest changes are under the hood: I refactored the widgets and state data structures and, as a consequence, a lot of the remaining code. Hopefully the code is a little clearer on what it’s doing and why. Send in all your feedback and ideas! (I do try to get around to implementing them, eventually.)
Per user requests, here are some of the liberties I took with the original paper:
The number of graphics were chosen to be 9 different boxes (this is how I understood the paper’s description). I’ve been considering adding color variations (eg. with two colors, we would have 18 different graphics) – would this be a good idea?
The paper only stated alphabet letters were chosen for the sounds. This is consistent with what I learned about easy memory encodings in my psychology courses in college. ;-) What I am not sure about is the number of different sounds used. I decided to keep the number of unique sounds equal to the number of graphics (just to minimize unnecessary variations).
The pseudorandom generator was originally free-for-all, but I found the chance of a True Negative was unfairly high (especially at higher levels of play). In other words, with increasing levels of difficulty, it was much safer to guess that the stimuli did not repeat. Since the user could easily “win” the game by not doing anything, it clearly went against the primary objective of the game as defined in the paper: to keep the user challenged at all times. After several different iterations of pseudorandom generators, I settled on the current version: there is a 50% chance that the stimuli is in fact the same as n-th previous turn and a 50% chance it is one of the other stimuli (randomly generated with equal probabilities). I feel this most clearly follows in the spirit of the game, which is to ensure that game consistently keeps the user mentally challenged (too easy or too difficult means the user loses concentration and no learning takes place).
With the same primary goal, the next-level choice is decided: with a naive score currently calculated as ((true positive + true negative) / total), the game level difficulty will decrease at 35% or lower, increase at 75% or higher, and otherwise remain the same. These boundaries were arbitrarily chosen by me and I am waiting for feedback to find out if they do in fact deliver a “consistently challenging” environment.
I do remember one problem with the original game: getting it running.
For anyone using kubuntu you might want to look into getting the “libghc6-<stuff goes here” packages.
By Piotr Krzyzek on 05.30.08 19:27
Thanks for the update and added features and explanations (and the comments in code)!
To any Gentoo users who try to install the latest version and get an error relating to use of Data.Time.Clock.POSIX (not in previous version), you need to install first the dev-haskell/time package from the haskell-overlay (if you’re using GHC 6.8, use the 1.1.2.0 version or newer).
By Joseph on 05.30.08 22:11
Is the distribution supposed to have a Paths_hback.hs in it? I was getting errors after building and installing with:
runhaskell Setup.lhs configure –prefix=$HOME –user
runhaskell Setup.lhs build
runhaskell Setup.lhs install
When I started the app from any other directory, it said it couldn’t find the glade file.. I think Cabal was picking up that Paths_hback.hs file instead of using the one that it auto-generates. After removing Paths_hback.hs and doing the configure, build, install dance again, things seem to work fine.
Maybe the problem was a result of tweaks I made to the Cabal file to get it working with GHC 6.8 though.
By Joseph on 05.31.08 3:18
Something seems very wrong in this new version.
I just had a string of about 15 Fs in a row, which seems like it should be so unlikely as not to have happened yet.
Also, when I look at the score output, it seems to be incorrect. Even doing 1-back, which is so easy that I can be extremely sure that I get every one correct if I don’t momentarily space out, I see the score has entries of 2 and 3 that shouldn’t be there. I’m not sure if the timing is off or it has to do with my keystrokes not being registered properly or what.
I’m not sure on differences between 0.0 and 0.2, but 0.0 is much more reliable for me. When I know that I nailed a level, it always increases. With version 0.2, it usually doesn’t.
I also had problems with the level NEVER changing from 1 when I installed the app. Using the `make trial` version seems to be less flakey, but then it has to be run from the hback directory in order to work.
By Joseph on 06.01.08 1:06
hmm, that doesn’t sound cool. I was hoping after the rewrite the behavior would become more explicit, not less so.
Joseph, thanks for the thorough feedback and cabal update. I will look into this, but probably won’t really have the time in the next couple days, since I’ve got exams starting and project dates looming. :)
By Norbert on 06.01.08 9:52