This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#9292 - New game plugin, NBackBox
Attached to Project:
Rockbox
Opened by Joseph Garvin (dataangel) - Sunday, 17 August 2008, 16:43 GMT+2
Opened by Joseph Garvin (dataangel) - Sunday, 17 August 2008, 16:43 GMT+2
|
DetailsIt's still a bit rough around the edges, but I've written a new game plugin called NBackBox. It's an implementation of the dual-n-back exercise, discussed in this Wired article: http://www.wired.com/science/discoveries/news/2008/04/smart_software . In short, it's a game that improves your brain's working memory. I've tried to keep it as close to how the game was described in the original paper.
Any feedback/bug reports/code suggestions much appreciated :) Joe |
This task depends upon
tab should be 4 spaces..
you havnt made it target-portable (BUTTON_POWER isnt deifned on every target)
your only using the main screen, this could probably work on multi screen targets (use rb->screens[i]. functions)
also, please choose a better name... we really have enough rockBLAA or BLAAbox plugins...
also, can you please split the patch up into the actual code and the included data files? no need for us to download 2MB every time we want to check out the code :D
Some more comments-
for ipod, BUTTON_DOWN is called BUTTON_PLAY (again, take a look at minesweeper etc for appropriate keymaps for other targets)
This currently does not build in non-debug/non-sim builds because of the use of rb->debugf, which is only defined in debug/sim builds. So rather than rb->debugf you should use the DEBUGF macro - which aliases to rb->debugf for debug/sim builds and aliases to thin air for non-debug/non-sim builds (where rb->debugf doesn't actually exist)
Those audio arrays included should not be bare in /apps/plugins - better to have /apps/plugins/dualnback/ hierarchy containing dualnback.c and the associated files (and add dualnback to /apps/plugins/SUBDIRS)
Also -- compiling plugin for real target also exceeds boundaries of PLUGIN_RAM section (on ipod at least) -- plugin is too big to fit in memory... Would it be possible to reduce the size of the audio somewhat to fit available target ram (shorter sounds? resampled to lower sampling frequency?) and/or be played back using codec (mp3) rather than raw pcm?
So then I decided to look at what other plugins did, and they have full fledged makefiles, which seems overkill here, since I only have one real source file, dualnback.c. Also, maybe there's a good reason for it, but it looks like what most plugins with a subfolder do now is to copy and paste the same stock Makefile (except for changing filenames), which seems like a bad practice (if you fix something in one the rest are still bugged).
-Sound files are now 11025hz mono, so they fit under 300KB. Will now actually load on real Sansa e200's.
-Backlight support
-Fixed bug where there would be 1 too many trials per block
-Fixed the wrong number of matches being present in each block
-Plugin now has its own folder for sources
The next step to shrink its memory usage for smaller players would be to use MP3s, but I haven't been able to get the mp3 playback functions to work and it's slow to test since they're not defined for the simulator (why?).
On the "software codec" players, it sounds like you have enough space in the plugin buffer already. At the moment we'd want to stop playback anyway, since you can't listen to music while the plugin plays sounds anyway (though software mixing in the future might change this situation, though I think it's unlikely you'd want to play this game while other noises go in the background that could make hearing the numbers difficult).
On the "hardware codec" players, my guess is that mixing will be more or less impossible anyway. So you can stop playback and used the compressed audio buffer for your sounds anyway. They'll still need to be MP3 though, unless you want to look at the wavplay plugin for what is necessary to playback uncompressed audio.
See how other targets handle keymaps and just copy one with the correct number of needed buttons. That should be simple enough, I think.
Keep up the great work, this is a wonderful application!
I wrote a small patch, which fixes the Button problem and add 4 spaces, instead of just 2.