HUSH:一款能聽見你心跳的恐怖遊戲(Presage SmartSpectra SDK 挑戰賽)
HUSH: a horror game that hears your heartbeat (Presage SmartSpectra challenge)
HUSH 是一款桌面第一人稱恐怖逃脱遊戲,透過 Presage SmartSpectra SDK 將玩家的脈搏、呼吸、面部反應和聲音轉成怪物可察覺的噪音。遊戲會先花約 20 s 記錄玩家的個人基準;沒有攝影機或 API key 也可使用模擬模式遊玩。
This is a submission for the Presage SmartSpectra SDK Challenge
What I Built
HUSH is a first-person horror escape game for the desktop (Electron + three.js). Each run generates a new house. A creature that cannot see well but hears everything hunts you by sound. You need to find the key, unlock the exit and leave, while the game listens, through your webcam and the SmartSpectra SDK, to how your body reacts. Your pulse, breathing, face and voice all turn into noise the creature hunts. Fear is the mechanic, and calm is how you win: staying still, hiding in wardrobes and lockers, holding your breath and even closing your eyes become real tactics.
Download the Windows installer from the latest release (unsigned, so SmartScreen may ask you to choose "More info" then "Run anyway"). No camera or key? A simulation mode lets anyone play.
Demo
Screenshots (simulation mode). These are local files: upload them to DEV when posting (drag them into the editor) and replace the paths.
Code
https://github.com/amit-ksh/hush (MIT license). Setup is in the README: pnpm install, pnpm start, then paste your Presage API key in the app (or put it in .env). Simulation mode needs no key or camera. Textures are from Poly Haven (CC0) and everything else is built from code; the full list is in CREDITS.md.
How It Responds to Human Signals
HUSH requests breathing, cardio (pulse, HRV) and face (blinking, talking, expression) metrics from @smartspectra/node-sdk and turns them into a noise meter that the creature "hears":
- Pulse above your calibrated resting baseline: the main noise source.
- Breathing rate above baseline and falling HRV: smaller contributions.
- Fear / surprise expression: a short burst. Talking: a large one, so do not whisper.
- Eyes closed (blink held for 1 s): the screen dims and noise falls. Closing your eyes is a tactic, not just a gimmick.
- The heartbeat you hear in the game is synced to your live BPM, and the creature's hearing radius grows with the noise.
Integration: the renderer starts SmartSpectraSDK with the requested metrics, listens to its metrics, validationStatus, streamAvailable and error events, and decodes each metrics buffer into one live state (BPM, breathing rate, RMSSD, fear, talking, eyes closed). The game loop reads that state every frame. A calibration step (about 20 s) records your own baseline, so the game reacts to your change rather than absolute numbers. Validation hints from the SDK ("no face found", "too dark", "hold still") appear in the HUD. If the SDK stops the camera because the frame rate is too low, the game restarts it in the background instead of interrupting play. If there is no key or camera, a simulation mode produces synthetic signals. These values are used purely as game signals.
Prize Categories
Most Creative or Delightful Use
- Inspiration: I was watching *TheRadBrad * play a horror game set in a forest. The player stumbled onto some creepy cult imagery, and a moment later a creature came sprinting from far away and started searching for them. What stuck with me was not the jump scare, it was that the game listened to the microphone: the creature could hear the player's real voice, and making noise meant you were done.
- What makes it original: I kept thinking: what if it listened to more than your voice? HUSH combines that mic-listening idea with a heartbeat-driven creature, plus procedural houses, hiding spots and jump scares. Your own body is the "noise", so the scarier it gets, the louder you are, and the only way to survive is to calm yourself down. At the end you get a graph of your pulse with each scare marked on it.
Consent and Data Handling
- Opt-in camera: a short consent screen explains what happens (with a collapsible "Privacy details" section) and the camera does not open until you press "Play with camera". Simulation mode never touches the camera.
- Processing: video frames are processed by the Presage SmartSpectra SDK. The app itself stores and uploads nothing; processing is handled by the Presage SDK under Presage's privacy policy: https://api.physiology.presagetech.com/privacypolicy
- Optional microphone: a separate, unchecked-by-default opt-in on the consent screen. The mic is used only as a sound level meter (an AnalyserNode reduced to a dBFS number in memory) so loud sounds can attract the creature. Audio is never recorded, stored or uploaded by the app.
-
SDK telemetry is disabled (
enableTelemetry: false). -
Storage and retention: no frames, video, vitals or logs are written to disk. The player's Presage API key, typed into the app, is stored only if they opt in ("Remember (encrypted)"), encrypted with the OS keystore via Electron
safeStorage, and only locally; otherwise it lives in memory for the session. The key is only sent to Presage by the SDK, is never logged, and can be cleared from the app at any time (deletion). - No optional AI service: the game uses no AI service at runtime and shares nothing with third parties other than the SDK's own processing above.
-
Easy off switch:
Escpauses the game and stops the camera and the microphone. The camera is also stopped on the end screen. - No health claims: HUSH is a game, not a medical device. Signals are shown as "game signals", not diagnoses or stress levels, and there is no covert monitoring: the camera only runs after explicit consent.
Agent Session
You
getting no face error when i playing and moving the players and stop every 2-3 seconds, fix and i have click and hold to look around the game, i should able to look wihtout click and hold
Agent
Agent
Agent
Agent
Agent
Agent
Agent
Agent
Agent
Agent
Agent
Agent
Agent
I made three changes, but I haven't run the game. I'm also guessing at the cause of the stops, so please test it.
-
Look without holding: mouse look in
player.jsnow works with no click and no hold. Pointer lock is still requested, and any key or click re-locks it. -
Stopping every 2-3 seconds:
app.jspaused the game whenever pointer lock was lost. Camera start-up or a focus change can drop the lock, and that would explain the stops. Losing the lock no longer pauses. Esc still pauses, but when the pointer is locked the first Esc only releases it, so press Esc a second time to pause. -
"No face found" flicker:
biometrics.jsmarked the face as lost after 3 seconds without camera data. I raised that to 8 seconds, because the camera data arrives in bursts. This only hides the flicker. If the "no face" hint still shows, check your lighting and that you're facing the camera.
If it still stops every 2-3 seconds, tell me what the screen shows when it stops (the pause menu, a frozen frame or a camera error).
You
it show the paused screen, camera & mic off. Resume restart them message in the dialog
Agent
Agent
Agent
Agent
That pause screen is the one the old code showed when pointer lock dropped. With my change, Esc is the only thing that opens it without a reason. You were probably still running a build from before my edits, because the renderer is bundled and needs a rebuild.
I've now rebuilt it, and it compiles. Close the game and start it again with pnpm start. The installed 0.1.1 .exe won't have the fix until you run pnpm dist and reinstall.
If it still pauses with this same message, tell me whether you pressed Esc just before. If you didn't, I'll add logging to find out what triggers it.
You
now showing camera frame rate is too loww, so camera stopped. Add light, clsoe other apps using camera, the press Resume to restart
Agent
Agent
Agent
Agent
Agent
Agent
The camera message was the real cause of the stops. The SDK shuts the camera down when its frame rate stays low (error 14), and the game paused when that happened.
The game no longer pauses for it. It now shows "Camera frame rate low, restarting camera..." and restarts the camera in the background. If it restarts 8 times or fails to come back, it pauses as before. I rebuilt the renderer, and it compiles, but I haven't tested this with a real camera.
Restart with pnpm start to try it.
The restarts only treat the symptom. The camera frame rate drops because of low light, other apps using the camera, or the game using a lot of CPU or GPU. If restarts happen often, try better front lighting and close other apps that use the camera. If that doesn't help, I can lower the game's render resolution or frame rate to leave more CPU for the camera.
You
but why camera frame is low or get stop?
Agent
Agent
I can't say for certain, because I haven't measured it. The SDK stops the camera when its frames per second stay under its threshold, and several things can cause that.
- Low light. Webcams lower their frame rate in dim light, because they use longer exposures. A dark room with the screen as the only light is the most common cause on laptops. It would also explain why "no face found" appears.
- Another app using the camera. Teams, Zoom, the Windows Camera app and browser tabs can all compete for it.
- The game and the face-analysis SDK sharing the CPU and GPU. The game already renders at 1x pixel ratio without antialiasing, so it's fairly light. A laptop on battery or in power-saver mode can still throttle hard.
- The camera or its driver. Some webcams and virtual cameras (OBS, Camo) deliver 15 fps or less.
To find which one it is, try these in order:
- Check the camera's frame rate in the Windows Camera app with the room lit from the front.
- Plug in the laptop and set the power mode to Best performance.
- Close any other app that might hold the camera.
Next time it happens, open DevTools (Ctrl+Shift+I) and send me the [hush] sdk error lines from the console. If it's the game competing for CPU, I can lower the render rate to 30 fps while the camera is on.
You
show these message at right side, and remove option to show .env from first screen
Agent
Agent
Agent
Agent
Agent
Agent
Agent
Agent
The status text "Using .env key" also shows on the first screen, so I'm changing that too.
Agent
Agent
Agent
Agent
Agent
Both changes are in. I rebuilt the renderer and the tests pass, but I haven't looked at the game on screen.
-
Messages on the right: the in-game messages, such as "Camera frame rate low, restarting camera...", now show on the right side of the screen, right-aligned. The change is in
index.html. -
No
.envon the first screen: the key chip now says "Key set". The status text says "Using the configured key" instead of "Using .env key". The "Add an API key below" hint no longer mentions.env. I updated the one test that checked the old status text.
Run pnpm start to see them.
You
directly show the enter presage key input option, remove use own key option
Agent
Agent
Agent
Agent
Agent
Agent
The first screen now shows the "Enter your Presage API key" field directly. The collapsed "Use your own API key" dropdown is gone. I rebuilt the renderer and it compiles, but I haven't looked at the screen.
I made two edits for this. In index.html I replaced the collapsible section with a plain label and the key input. In app.js I removed the line that opened the old dropdown in the screenshot mode.
I left the pause screen's "API key" dropdown as it was, since you only mentioned the first screen. Run pnpm start to check.
You
mouse look ux is not look, if mouse cursor reach end left/right, i was not look and move futer left/right
Agent
Agent
Agent
Agent
Agent
Agent
Mouse look now keeps turning when the cursor reaches the left or right edge. I rebuilt it and it compiles, but I haven't played it to check how it feels.
-
Edge turning: if pointer lock isn't active and the cursor rests at the left or right screen edge, the view keeps turning that way until you move the cursor away. That's the change in
player.js. -
Re-locking: pointer lock is also retried on mouse movement, at most once a second, and it takes over when it works. A locked pointer has no edge, so the turning is only a fallback. The retry is in
app.js. - Warning message: "Click the screen to look around" now shows once per session instead of every failed attempt.
The fallback is not smooth, because the edge turn runs at a fixed speed. If the lock still doesn't engage, tell me whether the "Click the screen to look around" message appears. That will tell me whether Windows or Electron is refusing the lock.
You
make it darker where light on teh side areas, make harder for player it see on right or left
Agent
Agent
Agent
Agent
The left and right sides of the view are now darker, so it's harder to see to either side. I rebuilt it and it compiles, but I haven't looked at the result in the game. The changes are in world.js:
- Flashlight cone: it's narrower, with a half-angle of about 17° instead of 29°. It also fades out more softly at the edges and drops off faster with distance.
- General light level: the ambient light is lowered from 1.0 to 0.7, and the post-blackout reset uses the same value. This makes the whole scene slightly darker, not only the sides.
If it's too dark or too bright, adjust the cone angle (0.3) and the ambient value (0.7) and tell me which way to go. I can also add a dark screen-edge vignette on top, which would work like peripheral blindness.
You
no i mean, keep the flashlight size and brightness like before and on side dedcrease teh brightness
Agent
Agent
Agent
Agent
The screens sit at z-index 20 and the overlay at 8, so menus cover it. It only shows over the game.
I put the flashlight back to how it was: the original size, brightness and ambient light. For the sides I added a dark overlay on the left and right edges of the screen. The left and right ~12% of the screen are nearly black (65–92% dark), and it fades to fully clear by about a third of the way in from each side. The centre is untouched. The overlay is in index.html. I rebuilt it and it compiles, but I haven't looked at it in the game.
If you want the sides darker or lighter, or the clear area in the middle narrower or wider, change the percentages and opacity values in the #sideDark rule and tell me if you'd like me to tune it.
You
commit and release new exe
Agent
Agent
Agent
Bump to 0.1.2, commit, build.
Agent
Agent
Agent
Version 0.1.2 is committed, pushed and released with a new installer: https://github.com/amit-ksh/hush/releases/tag/v0.1.2
-
Commit:
f1828f9, which also bumps the version and the README download name to 0.1.2. -
Installer:
HUSH Setup 0.1.2.exeis attached to the release. It is unsigned, so SmartScreen may ask you to choose "More info" and then "Run anyway". - Not played: I didn't launch the built installer, so none of the fixes in this release have been tried in the game.
You
push the changes
Agent
Agent
Everything is already pushed. Local main matches origin/main at f1828f9, and the v0.1.2 tag is on GitHub too. I pushed during the release step. There's nothing new to push.
You
update submission tempalte to this format-
<pasted_content id="9c71">
This is a submission for the Presage SmartSpectra SDK Challenge
What I Built
<!-- Provide an overview of your experience and what it lets people do. -->
Demo
<!-- Embed or link your demo video showing the live Presage signal(s) in action. Public hosting of your app is optional. -->
Code
<!-- Share a link to your public code repository. Make sure it includes setup instructions. -->
How It Responds to Human Signals
<!-- Which live Presage signal(s) does your app use (such as pulse, breathing rate, HRV, or expressions), and how does the experience respond to them in real time? Walk us through how you integrated the SmartSpectra SDK. -->
Prize Categories
<!-- Are you entering a prize category? Note which one(s) apply (Most Creative or Delightful Use, Best Thoughtful Real-World Use, or both). If not, you can remove this section. -->
<!-- Most Creative or Delightful Use: tell us what inspired your project and what makes it original, playful, or unexpected. -->
<!-- Best Thoughtful Real-World Use: tell us what real-world need your project addresses, who it's for, and how you designed it to be usable for those people. -->
Consent and Data Handling
<!-- Required: explain how your app obtains camera consent and handles data. Disclose any storage, sharing, retention, deletion, SDK telemetry, or optional AI service use. -->
<!-- Reminder: diagnosis or treatment claims, medical decision-making, and covert or non-consensual monitoring are not allowed. -->
Agent Session
<!-- Optional but encouraged: upload your transcript at https://dev.to/agent_sessions/new, curate or slice the parts worth showing, and embed it right here. Supported tools include Claude Code, Gemini CLI, Codex, GitHub Copilot CLI, and Pi. -->
<!-- Sessions are unlisted by default, so hit Make Public before you publish or judges won't be able to open it. Check your transcript for keys and sensitive data first. -->
<!-- Don't forget to add a cover image if you want! -->
<!-- Reminder: Team submissions are not allowed, and each participant may submit only one entry. -->
<!-- Thanks for participating! -->
</pasted_content id="9c71">
Agent
Agent
Agent
Agent
I rewrote submission/post.md to match the new template's sections: What I Built, Demo, Code, How It Responds to Human Signals, Prize Categories, Consent and Data Handling and Agent Session. I haven't committed it.
I kept the dev.to front matter (title and tags) and updated the challenge link to the new URL. I also made a few content changes:
- Inspiration: the old Inspiration section moved under the Most Creative or Delightful Use prize category.
- Credits: the Credits section is now one line in Code.
- Download link: What I Built now points to the latest release for the installer.
- Signal integration: the signals section now describes how the SDK is wired in, including the HUD hints and the automatic camera restart on low frame rate.
- Consent section: I added explicit lines on retention, deletion, telemetry, "no AI service at runtime" and no covert monitoring. This section is required.
Placeholders you need to fill in before posting:
- The demo video link.
- The name of the forest game from your inspiration (or delete that note).
- The Agent Session embed. Upload the transcript at dev.to/agent_sessions/new, check it for keys, and make it public.
- The screenshot paths, which still need uploading to DEV.
I didn't claim a Best Thoughtful Real-World Use entry, because it doesn't fit a horror game.
You
push all teh changes and how to embed the session transcript?
Agent
Agent
Agent
submission/ is in .gitignore, so post.md was never tracked. That's why git reports nothing to commit. Everything that is tracked is already pushed: main matches origin/main at f1828f9. I left the ignore rule alone, since you may want the draft kept private. If you want post.md in the repo, say so and I'll remove the ignore rule and commit it.
Embedding the session transcript on DEV:
1. Go to https://dev.to/agent_sessions/new and upload the Claude Code transcript. The file is a .jsonl in [REDACTED]\.claude-account2\projects\D--personal-apps-hush\. The most recent one is this session.
2. Curate or slice it to the parts worth showing.
3. Check it for keys and anything sensitive. Look especially for your Presage API key, and for your email and local paths, which can appear in the transcript.
4. Click Make Public. Sessions are unlisted by default, and judges can't open them until you do.
5. Embed it in the post under "Agent Session". DEV gives you an embed tag or URL after the upload. Paste that where the TODO comment is in post.md, and it's usually a {% embed <session URL> %} liquid tag. I'm not certain of the exact syntax, so use what DEV shows you.
You
can you give me file contains the Claude Code transcript?
Agent
Agent
The transcripts are in [REDACTED]\.claude-account2\projects\D--personal-apps-hush\. There are three session files:
| File | Last modified | Size | Notes |
|---|---|---|---|
1da7abe8-d775-40ae-9fd0-d3c79f915865.jsonl |
22:38 | 1.1 MB | This session (the fixes, release and submission post) |
64d12d02-957d-459a-b48a-0a28ba6ad93b.jsonl |
17:37 | 6.5 MB | Earlier session, most likely the main build of the game |
e687e01e-db06-4a7f-9e67-b35d839cd6bc.jsonl |
16:04 | 0.8 MB | Earlier session |
I'd upload the 6.5 MB one, since it probably holds most of how the game was built. I haven't opened it to confirm. The current session is the one that shows the debugging and release work. DEV may accept only one transcript per embed, so pick the one that best shows how you built the game.
Before you upload, search the file for PRESAGE_API_KEY, your API key and your email. If you want, I can check these files and copy a redacted version somewhere you can find it, like the Desktop.
You
can remove the unneccsary detials ffroms session which is not needed, like using dev.to submission for my submision and api keys to not include in teh transcript?
Agent
Agent
Agent
Agent
Agent
Agent
Cleaning up the remaining Windows username in paths (the escaped-backslash form my pattern missed).
Agent
Agent
Agent
Agent
The sed didn't match, so the old email pattern ran again. I'll edit it directly.
Agent
Agent
I made cleaned copies of all three transcripts in [REDACTED]\Desktop\hush-transcripts\. Your original transcripts are untouched. I checked that every line in the new files still parses as JSON, and that searches for your email, username, "gmail" and "dev.to" find nothing.
| File | Size | Content |
|---|---|---|
64d12d02-957d-459a-b48a-0a28ba6ad93b.jsonl |
4.2 MB | Main game build. This is the one I'd upload. |
1da7abe8-d775-40ae-9fd0-d3c79f915865.jsonl |
346 KB | This session: the fixes and the release |
e687e01e-db06-4a7f-9e67-b35d839cd6bc.jsonl |
289 KB | Earlier, smaller session |
What I removed:
- Internal bookkeeping lines (file-history snapshots, permission and mode entries, account and org IDs), which aren't part of the conversation.
- In this session, the turns about the dev.to submission, the transcript, the API key and the embed. That was 82 lines, and I dropped each of those turns along with the replies that followed it.
- Your email, your Windows username and its path, and anything that looks like a PRESAGE_API_KEY=... value or an sk-/key- style token.
What I couldn't confirm: your .env has no key in it, and I found no key in the transcripts. A search for key-like strings can still miss a format I didn't think of. Do a quick search of the files for your actual key before you make the session public.
The cleaning script is clean.py in my scratchpad. Tell me if you want other topics dropped, such as the earlier "no face" debugging.
You
status?
Agent
Nothing is running right now. Here's where each piece stands.
-
Code and release: everything is committed and pushed (
mainis atf1828f9). Release v0.1.2 is live on GitHub with the installer. I haven't played the new build myself, so the game fixes are untested. -
Submission post:
submission/post.mdfollows the new template, but it's in an ignored folder, so it isn't in git. It still has placeholders: the demo video link, the name of the forest game, the Agent Session embed and the uploaded screenshots. -
Transcripts: cleaned copies are in
[REDACTED]\Desktop\hush-transcripts\, with your email, username and API-key-like strings removed. I'd upload64d12d02-957d-459a-b48a-0a28ba6ad93b.jsonl. Search it for your actual Presage key first, since a pattern search can miss one.
What's left is yours to do: record the demo video, upload the transcript at dev.to/agent_sessions/new and make it public, then fill in the placeholders and publish.
來源:DEV Community · dev.to






