DEV Community

Ritam Debnath
Ritam Debnath

Posted on

PULSE — A Psychological Horror Experience That Reads Your Fear with Presage SmartSpectra SDK

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

PULSE is a biometric psychological horror game where your physical fear is the controller.
In traditional horror games, you press keyboard keys to sprint away or hide in closets. In PULSE, an acoustic predator stalks an endless dark hallway. It is blind, but it possesses hyper-sensitive auditory awareness of your cardiovascular system: it hunts by the sound of blood pumping through your veins.
Built with Electron, Canvas 2D, procedural Web Audio, and the Presage SmartSpectra SDK, PULSE monitors your contactless vitals (pulse rate, respiration, and heart rate variability) in real time:

  • 🫀 Your Heartbeat is the Audio: An authentic 40Hz sub-bass chest thump and ambient drone stay locked to your actual biological BPM.
  • 👹 The Sprinting Monster ("The Heart Hunter"): If your heart rate spikes $\ge$ 8 BPM above your calibrated resting baseline, the entity detaches from the end of the corridor and sprints screaming straight at your face.
  • 🧘 Biofeedback Survival Loop: You cannot outrun it with keys. The only way to survive is to physically sit still, close your eyes, take slow deep breaths, and force your biological pulse back down below threshold. Once your pulse stabilizes, the entity loses your trail and retreats into the darkness.
  • 🎥 Picture-in-Picture Night-Vision Bio-Feed: Features an integrated military night-vision facecam in the top-right corner with a live photoplethysmogram (PPG) cardiac wave sweeping across the screen.

Demo


Direct video link: Watch the Demo on YouTube

What you see in the demo:

  1. Calibration: SmartSpectra locks onto the face via camera and measures baseline resting vitals (~72 BPM, 14 br/min).
  2. Exploration: Navigating the perspective corridor with dynamic mouse-aimed flashlight and the live PPG cardiac wave in the top-right HUD.
  3. The Biometric Jump Scare: A fear spike causes pulse rate to jump from 72 BPM to 88 BPM; emergency alarms flash and the monster sprints forward with clawing limbs.
  4. Physiological Recovery: Taking slow deep breaths on camera lowers the heart rate back to 73 BPM, forcing the monster to retreat.
  5. Fear Profile: The final survival report analyzing duration, peak pulse, and adrenaline responsiveness.

Code

The project is fully open source under the MIT License:
👉 GitHub Repository: https://github.com/ritamgit-alt/pulse-biometric-horror

Quick Setup:

git clone https://github.com/ritamgit-alt/pulse-biometric-horror.git
cd pulse-biometric-horror
npm install
echo "PRESAGE_API_KEY=your_api_key_here" > .env
npm start
Enter fullscreen mode Exit fullscreen mode

How It Responds to Human Signals

PULSE integrates the Presage SmartSpectra SDK via its native pure-FFI runtime (koffi) in an Electron desktop architecture:

  1. Pulse Rate (BPM):
    • Measured frame-by-frame via rPPG from the camera stream using cardioMetrics.
    • Modulates the Web Audio procedural heartbeat generator: faster pulse produces higher pitch, shorter intervals, and heavier sub-bass thumps.
    • Drives the core predator AI state machine: $$\Delta \text{BPM} = \text{Pulse}{\text{current}} - \text{Pulse}{\text{baseline}}$$ If $\Delta \text{BPM} \ge 8$, the game transitions into CHASE mode.
  2. Breathing Rate (br/min):
    • Measured via breathingMetrics (CHEST_BREATHING and BREATHING_RATE).
    • Controls volumetric canvas fog density and screen vignette breathing motion.
  3. Heart Rate Variability (HRV):
    • Evaluates physiological tension and modulates ambient drone dissonance.
  4. Self-Healing Simulation Fallback:
    • The engine includes a smooth watchdog fallback that generates realistic physiological trends if the webcam stream is obstructed, guaranteeing 100% testability.

Prize Categories

I am submitting for the Most Creative or Delightful Use category:
Instead of building a conventional healthcare telemetry dashboard or fitness tracker, PULSE flips contactless human sensing into an innovative biofeedback mechanic. It turns your webcam into a physiological game controller where physical composure and breath control are the sole win conditions.

Consent and Data Handling

PULSE was built with strict privacy-by-design standards:

  • Explicit Opt-In Screen: Before camera access is initialized, players must read a privacy disclosure and check an explicit consent box.
  • 100% In-Memory Processing: Video frames are analyzed purely in-memory via MediaStreamTrackProcessor and discarded immediately. No video frames, photographs, or recordings are ever stored to disk or transmitted across any network.
  • Local Telemetry: All vitals calculation and audio/visual rendering occur entirely on the user's local machine. Telemetry flags are set to enableTelemetry: false.
  • Immediate Kill-Switch: Pressing ESC at any second terminates all camera feeds, stops tracks, and closes the session.
  • Non-Diagnostic Notice: This application is strictly an interactive entertainment experience and makes no clinical diagnosis or health claims.

Top comments (0)