SSVEP Neurogaming Hackathon Information
What we set out to do:
Two-Player SSVEP-based game with one OpenBCI board.
What we accomplished:
Two-Player SSVEP-based game with one OpenBCI board.
What we did not accomplish at the hackathon:
A nice graphical version of the game. We presented a text-based version of the game.
How did we go about doing this?
We used the OpenBCI GUI Processing sketch from their official repository. In the Hexbug branch is the EEG_Processing file that has already arranged code for multiple users. What we did was learn how the code works and tweak it so we could have two users on one board, and have the Processing sketch identify and tag different sets of frequencies for the users.
Octavian had found research suggesting even smaller squares could be used in an SSVEP matrix for more input. Yannick had spent a portion of the hackathon wiring up very bright LEDs, which we then took turns staring into. Our retinas will never be the same….Somehow though, the best results we got were from the flashing on the monitor. The LEDs were not doing the trick for us. I’m not quite sure why that was the case, but perhaps future investigation into it will provide decent answers. I personally would rather use an Arduino controlled SSVEP stimulator than a monitor. I would expect it to have a more consistent frequency than a monitor. Conor helped us make a processing sketch of flashing lights at specific frequencies. We found we had best results with the full height flashing lights and a middle black panel separating the two frequencies. There is a version of smaller lights also in our repository.
Hooking up two people to one board consisted of connecting an electrode to the person’s occipital lobe (right above the big bump in the back of the head), and connecting a reference and ground. You do not want to use the same reference for both individuals. In order to do this, you connect the reference electrode (SRB) to the positive channel on the OpenBCI board. (Negative channel on the bottom, positive channel is on top). Once you start the Processing GUI, in the channel settings (labeled Chan Sets) you can turn off referencing of those channels from SRB. I was told that Bias is ok to use for both individuals. Yannick connected wires to the Ground and wrapped them around the electrode channels in an attempt to shield them from outside intereference. I am not an electrical engineer, but the theory goes (I think) that if you have the ground wrapped outside the wires carrying the signal then any interfering signal will hopefully get pulled into the ground cable (electricity likes going to ground…right?) and not affect the reference or actively measuring electrode(s).
One problem we encountered (in the last ~hour before presentations) was that making a sprite-racing game in Processing was not going to be easy. Well, it turns out it is easy, but it is not easy to do in the Processing OpenBCI GUI. After the hackathon, I put two servers in the OpenBCI GUI sketch and made a game client. I had to make two servers because Processing cannot send integer arrays. It can send Bytearrays, but I was in a coffee shop, am a newbbieeee, and didn’t want to delve into deep magic (ain’t no Gandolf over here). Anyways, two servers and one game client and the game is officially active.
Thankfully all I had to do was carry over the game engine logic Yannick and Octavian setup already and sip my Iced Tea in the humid (I was in D.C. on one of those nasty humid days) cafe. There still is work to be done cleaing up the code and making it its own branch of the Processing GUI. Hopefully the server can be setup more efficiently and people can plug other awesome applications and games into it!!!
I plan on providing a more detailed follow up in the coming weeks as well as more input in the write up from my awesome partners on the SSVeePers team. (It was originally SS Vipers, but I thought that sounded a little too swastika for me and am glad the other name stuck).
The Game Engine:
The game takes three possible values, 8 Hz, 10 Hz, and 12 Hz. These values can be changed in the EEG_Processing.pde file. The flashing lights are at 8 and 12 Hz. The 10 Hz covers alpha. We have a very secretive formula for scoring points based on what the dominant frequency for each user was. Well, actually Alpha got the lowest, 12 Hz got 2nd highest, and 8 Hz got 1st. It is an arbitrary setup (and helped Yannick beat me during the presentation….*Shakes fists and grumbles something about a rematch*). Anyways, letting bygones be bygones, we found out that certain people react better to certain frequencies. It makes sense intuitively, but I do not have a legitamate peer-reviewed paper explaining why. I am sure with a little digging I will find something regarding that. SSVEP is a very popular BCI protocol. It takes very little mathematical processing to do, especially compared to predicting affective states or motor imagery. Learning about how to implement this into a two-player game was a great experience and being able to meet new people and make new friends made everything even better. Not to mention we actually got to work alongside Conor and Joel, the founders of the device we were hacking on!
*it is in the ssvep-neurogaming branch*
Octavian, John, and Yannick