An open-source neurofeedback sandbox where a stylised forest responds to your brain-measured focus. Grow majestic trees when attention is high, watch them wither when it drops, and plug in any BCI headset through a thin adapter layer.
- Focus-training game – calm, positive-reinforcement loop for users to help them gain focus and self-control.
- Open BCI playground – pluggable interface so researchers can swap in new headsets or signal-processing pipelines with minimal code.
| Device | Transport | Metric | Status |
|---|---|---|---|
| Mock generator | Internal | focus (sine wave) | ✔ |
| Neurosity Crown | SDK → OSC bridge | focus (0–1) | ✔ |
| Muse, OpenBCI, etc. | – | – | ☐ (coming) |
A Device dropdown in the Settings panel lets you switch sources at runtime.
Download the latest Windows build from the Releases page.
git clone https://github.com/nikakogho/DreamscapeGrove.git
cd DreamscapeGrove
npm install # installs @neurosity/sdk, osc, dotenvCreate a .env with these or set them manually
| Name | Example | Purpose |
|---|---|---|
| CROWN_ID | Crown-A08 | Device ID from console.neurosity.co |
| CROWN_EMAIL | you@example.com | Login for SDK bridge |
| CROWN_PWD | yourPassword | Password for SDK bridge |
| FOCUS_PORT | 9001 (default value) | Port on localhost to stream focus metrics to, change if needed |
Make sure you have Unity 2021 installed
- Open Assets/Scenes/SampleScene.Unity
- Press Play
- The game auto-launches
focus-osc-bridge.js - logs into the Crown via the Neurosity SDK
- rebroadcasts
/focuson UDP 9001
- The game auto-launches
- Concentrate - focus bar goes up and once it crosses the threshold, tree starts to grow
- Toggle settings UI with the ⚙ icon or by pressing F1
- Settings
- Use the Thresholds Panel (top right)
- Min. Focus - focus threshold you can adjust for more/less sensitive experience
- Min. Confidence - mock source gives 0.95, choose based on your experience
- Use device dropdown to pick the device (currently only Mock)
- Use the Thresholds Panel (top right)
- Live focus graph with confidence-based colours
- Green = confidence ≥ confidence threshold
- Yellow→Red = below confidence threshold
- Horizontal Black bar = required focus level (moves when focus threshold adjusted in settings)
| Package | Version | Why |
|---|---|---|
| TextMesh Pro | 3.2+ (comes with Unity) | Slider labels & future HUD |
| URP | 12 LTS | Lightweight, WebGL-friendly visuals |
| @neurosity/sdk | npm | Crown focus stream |
| osc / dotenv | npm | Bridge & env vars |
Unity packages auto-install via Packages/manifest.json; Node packages install with npm install
Assets/
└─ Scripts/
├─ Core/ # device-agnostic interfaces + FocusManager
├─ Adapters/ # one class per BCI implementation
├─ Gameplay/ # tree growth & world behaviours
└─ UI/ # settings panel, HUD
- Core/FocusInterfaces.cs – defines FocusFrame and IFocusSource
- Core/FocusManager.cs – singleton that polls the active source
- Adapters/MockFocusSource.cs – sine-wave mock (for headless tests)
- Adapters/NeurosityWsFocusSource.cs - reads focus from localhost:9001 UDP
- Gameplay/TreeGrowth.cs – scales a tree based on focus/confidence
- focus-osc-bridge.js - streams focus metric from Neurosity's server and relays it on localhost:9001 UDP
| Milestone | Status |
|---|---|
| 0.1 Settings UI & device dropdown | ✔ |
| 0.2 Live focus graph | ✔ |
| 0.3 Crown focus via SDK bridge | ✔ |
| 0.4 TreeSpawn visual (multiple trees appear / die) | ✔ |
| 0.5 Windows standalone build + ZIP + setup doc | ✔ |
| 0.6 In-game UI for connection status | ✔ |
| 0.7 First dev-log video (overview → demo → code walk-through) | ☐ |
| 0.6 In-game UI to enter Crown credentials | ☐ |
| 0.8 Raw EEG → custom focus DSP (theta/beta) | ☐ |
- Fork -> branch -> PR
- Keep non-Unity logic in Core/
- New headsets: implement IFocusSource and drop it in Adapters/
MIT - do whatever you want with this, feel free to use it for learning, work, commercially, research, whatever, just don't use it for evil