# Getting Started

This documentation aims to be a developer biased overview of using the [Bonspiel Games custom Emotiv Cortex support package](https://github.com/cm-nielsen/CortexPlugin) to make BCI enabled video games in Unity.

There is a significant amount of UI/UX and game design inherent to any project involving BCI. An effort will be made to guide these efforts, but the majority of content will involve technical integration.

## Background

Ultimately, the unity package in question is a wrapper of [the official websocket API](https://emotiv.gitbook.io/cortex-api/)

Though the structure may be altered or simplified, ultimately the package conforms to the same processes and credential checks as the raw API. That is to stress that though these docs should provide most developers enough information to make a functional game, familiarity of or frequent reference to the base material may be an import augment to those looking to do more.

## Prerequisites

As Emotiv services are centralized and proprietary, official credentials are required for any third party application. See [the official docs](https://emotiv.gitbook.io/cortex-api/#prerequisites) on how to set up an account and get app credentials. **MAKE SURE TO NOTE THE CLIENT SECRET.**

1. Install Unity. You can get it for free at [unity3d.com](https://unity3d.com/get-unity/download).
2. Make an EmotivID on [the official website](https://emotiv.com)
3. Create a Cortex application on [the account page](https://emotiv.com/my-account/cortex-apps/) to get an app client id and secret. **MAKE SURE TO NOTE THE CLIENT SECRET AS IT WILL ONLY BE SHOWN ONCE**
4. [Download and install](https://www.emotiv.com/emotiv-launcher/#download) the EMOITV Launcher
5. Add the CortexPlugin package to any Unity project using the package manager via git url:

```
https://github.com/cm-nielsen/CortexPlugin.git
```

In the likely event that you don't have access to hardware for hands on testing, the Emotiv launcher allows you to create a "Virtual Brainwear device" which will simulate a headset, providing contact quality and mental commands.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bonspiel-games.gitbook.io/cortex-unity-plugin/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
