Wiki

Clone wiki

openvibe-gipsa-extensions / BrainInvaders

Introduction

We have developed the prototype of a pure-BCI video game based on the well known vintage video game Space Invaders. In our Brain Invaders a number of aliens are displayed and the player has to destroy a particular alien, the target, only by concentrating on it. The game makes use of a state-of-the art P300 oddball paradigm to select the alien to be destroyed at a regular pace, based on current probabilities assigned to each alien by a learning machine continuously analyzing and classifying the user’s electroencephalographic stream, achieved with the Open-ViBE platform.

Brain Invaders is a mind controlled game and thus it uses only EEG signal that originates from the human brain to control the game (no keyboard, no joystick, nothing). Differently from the Space Invaders, here your brain is the ultimate weapon :)

A published report on a previous version of the Brain Invaders (Congedo et al., 2011) is available. A demonstration of the latest version is available here.

Game Rules

The goal of Brain Invaders is simple: in a grid of aliens, the task of the player is to shoot the alien leader. This leader is depicted as a red alien. To shoot the leader, the player has to stay focused on it and count (in thoughts) the amount of times it flashes. If the player succeed in shooting the leader, a new level with a different alien invasion will start.

Each level features different alien placements and movement as well as certain types of distracting aliens. These distractors are of different colour and aim to break the player's concentration on the leader alien.

Each level, the player gets a limited amount of shots to succeed in shooting the leader. At the bottom of the screen, the maximum amount of shots the player can fire will be shown. All shots in yellow are still unfired shots, whereas red shots indicated a fired one. If a shot turns grey, this indicated that some error occurred in the signal processing or communication and that a random shot was fired. If this is the case, consult the game's log file (located as GameSession.txt in dist/share/openvibe-applications/brain-invaders/brain-invaders).

Installation

Brain Invaders can be compiled from source code or deployed with our Windows Installer.

Prerequisites

  • EEG amplifier supported by OpenVibe
  • install OpenVibe 1.0 or later

Binary Installation

Simply use the installer from our downloads page. Once installed start the game by clicking on ov-brain-invaders.cmd. The game also installs a Gipsa-lab folder in your start menu. The preferred way of starting Brain Invaders is to use the BI Launcher (ov-brain-invaders-launcher.cmd)

Configuration

Brain Invaders can easily be customized to different resolutions, levels and even graphics. Note that since version 1.4 Brain Invaders comes with a build-in tool called "Brain Invaders launcher" that will help you easily configure the game. Please refer to Brain Invaders config file for more information. You can also load the OGRE 3D engine configuration by setting "ShowOgreSetup" to "true" in the Brain Invaders config file file.

Source Code

Source code is available in the adjacent GIT repository.

Scenarios Deployment

OpenVibe P300 Scenarios are deployed by our all in one installer for Brain Invaders. Scenarios are needed for the Training and Online phases of the game.

Different Tagging Types

Brain Invaders can synchronize its visual simulations (the flashes) with OpenViBE in several ways. This is explained in our Tagging page.

The following options can be set in Brain Invaders:

  • Software Tagging (option "software") - this method requires that you use our Gipsa's Acquisition Server. You will also need to restart the AS every ten or twenty minutes.
  • Parallel Port (option:"8bit") - allows hardware tagging through the parallel port.
  • Serial Port (option:"serial") - serial port (COM1, COM2 ..) is used. This option allows computers without parallel port to be used with hardware tagging because the serial port can run over USB cable. Please, read the entire Tagging page for more information. Tagging is configured in \share\brain-invaders.conf or through Brain Invaders Launcher.

Troubleshooting

Please check:

Running the Game

To play the game, the player first has to be trained to shoot the alien. To start training, start an Openvibe Aquisition server for your amplifier and run the Train script in the OV designer. Once, the Train script is running, run ov-brain-invaders.cmd. When the start screen is presented, press "p" or "t" (last version) to start the training. During the training, the player has to focus on the red alien and try to count the number of flashes.

After the training is finished you will see a classification score in the OV console. If this percentage is higher than 75%, then the game will usually run fine for the subject. Quit the game and stop the Train script in OV designer.

To play the game start the Online script. Start the game through ov-brain-invaders.cmd and press space to start the online mode of the game.

For Software Tagging mode you should not stop the OpenVibe Acquisition server between the train and online phases.

Additional considerations

The environment around the subject should be quiet You should not be discouraged if you are not hitting the target. The levels are not sorted by difficulty. Maybe the one you currently lose is actually the hardest and it is normal to lose several lives before hitting the target

Video Resolution

To adjust the resolution, navigate to dist/share/openvibe-applications/brain-invaders/brain-invaders/ and locate the file ogre.cfg. Open the file and edit the Video Mode setting to the required resolution. Changing Full Screen to Yes will enable Full Screen mode (due to Ogre limitations it is recommended to use the screen resolution as the game resolution when starting the game in Full Screen). The resolution can also be changed through the Brain Invaders Launcher.

New Levels

New levels should be created according to the Brain Invaders XML-specification. If the level is named BILevel<x>.xml where <x> is a integer, then the file will act as the x-th level. Please note that Brain Invaders stops if the next level is not found, so when there are only 7 levels, the new level should be level 8 not level 9. Place the levels in /dist/share/openvibe-applications/brain-invaders/brain-invaders/Resources/game/Levels/

Due to current Openvibe-limitations, any level should contain 36 aliens in a 6 by 6 matrix.

For a more detailed description of the Level format, see LevelXMLSpecification

Editing Assets

There are two ways assets from brain invaders can be edited. First of, sprite images can be replaced (using the same filenames) by navigating to /dist/share/openvibe-applications/brain-invaders/brain-invaders/Resources/

Secondly, the colour manipulation of the different Alien Types can be manipulated by editing the spaceinvader.material-file in /dist/share/openvibe-applications/brain-invaders/brain-invaders. Here, each alien is described according to the following format:

#!python

 material Spaceinvader/Alien_<X>_<Y>_<Z>
 {
     technique
     {
         pass
         {
             lighting off

             ambient 1 1 1 1
             diffuse 1 1 1 1
             specular 0 0 0 0
             emissive 0 0 0 

             scene_blend alpha_blend
             depth_write off

             texture_unit
             {
                 texture Resources/game/<texture-name> 2.5
                                 colour_op_ex source1 src_manual src_current <R> <G> <B>
                        tex_coord_set 0
             }
         }
     }
 }

where <X> indicated the Alien type, <Y> the frame (either 0 or 1) of the animation and <Z> is U for a non-flash and F for a flashing Alien. For the short display of the target at the beginning of the level, replace <Y>_<Z> by T

Replace <texture-name> to use a different sprite (e.g. alien-new.jpg) and give it a colour-adjustment by editing <R> <G> . These are the rgb-multiplication colour-values that are applied to the sprite.

For more information on levels see the Level Builder.

License

Brain Invaders is GPL licensed.

Updated