Skip to content

ZSlayerHQ/ZSlayerBossProximity

Repository files navigation

ZSlayer Boss Proximity

Immersive horror audio when bosses are nearby — heartbeat, heavy breathing, and dread

License: MIT Version SPT BepInEx .NET


Your heartbeat pounds. Your breathing gets heavier. Something is close. A client-side BepInEx plugin for SPT that plays escalating heartbeat and heavy breathing audio when you're near a boss in raid. Closer = louder, faster, bassier. Horror game feel.

Discord | YouTube | Releases


What Is This?

A lightweight client-side mod that adds proximity-based horror audio to raids. When you're within range of any boss (Tagilla, Reshala, Killa, Sanitar, etc.), your character's heartbeat starts pounding — getting faster, louder, and bassier the closer you get. Get within 20m and heavy breathing layers in. Kill the boss and the audio smoothly fades away.

Works with all 21 vanilla boss types plus custom modded bosses via config. No server mod required — pure client-side immersion.


Features

Heartbeat System

Escalating heartbeat audio driven by boss distance.

  • 40m range — heartbeat starts at the edge of detection
  • BPM scaling — 60 BPM at max range, 140 BPM at point-blank
  • Volume scaling — faint at distance, pounding up close
  • Low-pass filter — audio gets bassier and more muffled as you close in (2000 Hz → 600 Hz)
  • Timer-based playback — each beat is a discrete thump, not a looping track

Heavy Breathing

Layered breathing audio for extreme close range.

  • 20m range — breathing kicks in when you're dangerously close
  • Volume scaling — silent at 20m, intense at point-blank
  • Pitch scaling — breathing gets faster as proximity increases (0.9x → 1.1x)
  • Seamless loop — continuous breathing audio with crossfade

Smart Detection

Efficient boss tracking with minimal performance impact.

  • 21 vanilla boss types tracked (Reshala, Killa, Tagilla, Sanitar, Gluhar, Knight, Big Pipe, Bird Eye, Kolontay, Partisan, Zryachiy, and more)
  • Custom boss IDs — add modded bosses via config
  • Event-driven — subscribes to spawn/death events instead of polling
  • Nearest-only — only the closest boss drives audio (no stacking)
  • 10 Hz update rate — distance checked every 0.1s for smooth response

Smooth Transitions

No jarring audio cuts — everything fades naturally.

  • Fade-in — audio ramps up smoothly when entering range
  • Fade-out — audio ramps down when leaving range or boss dies
  • Lerp-based — all values (volume, BPM, pitch, filter) smoothed per frame
  • Configurable speed — adjust fade responsiveness via config

Audio System

Ship real audio files or let the mod generate its own.

  • WAV file support — drop heartbeat.wav and breathing_loop.wav in the Audio folder
  • Auto-trim — long recordings are trimmed to a single beat on load (0.5s) with fade-out to prevent clicks
  • Procedural fallback — if no WAV files are present, generates heartbeat (layered sine waves with lub-dub envelope) and breathing (filtered noise with inhale/exhale cycle) at runtime
  • 2D audio — non-directional (it's YOUR heartbeat, not the boss's)

Fully Configurable

All settings exposed via BepInEx config (F12 in-game).

Setting Default Description
Enabled true Master toggle
HeartbeatRange 40m Detection distance
MinBPM / MaxBPM 60 / 140 BPM range
MinVolume / MaxVolume 0.15 / 1.0 Volume range
BreathingRange 20m Breathing distance
BreathingMaxVolume 0.8 Breathing volume
FadeSpeed 3.0 Transition speed
CustomBossIds (empty) Modded boss IDs



Quick Start

Download the latest release from Releases and extract into your BepInEx plugins directory:

EscapeFromTarkov/
└── BepInEx/
    └── plugins/
        └── ZSlayerBossProximity/
            ├── ZSlayerBossProximity.dll
            └── Audio/
                ├── heartbeat.wav        ← optional (procedural fallback)
                └── breathing_loop.wav   ← optional (procedural fallback)

Launch the game and load into any raid with a boss. That's it — no configuration needed.

To customize settings, press F12 in-game to open the BepInEx config manager.




How It Works

┌─────────────────────────────────────────────────────────┐
│                    IN RAID (Update Loop)                 │
│                                                         │
│  BossTracker (10 Hz)                                    │
│    ├── Maintains alive boss list via GameWorld events    │
│    ├── OnPersonAdd → check IsTrackedBoss → add          │
│    ├── UnregisterPlayer → remove                        │
│    └── Calculates nearest boss distance                 │
│                                                         │
│  ProximityAudioController (every frame)                 │
│    ├── Reads ClosestBossDistance from tracker            │
│    ├── Heartbeat (40m → 0m)                             │
│    │   ├── BPM: Lerp(60, 140, proximity)                │
│    │   ├── Volume: Lerp(0.15, 1.0, proximity)           │
│    │   ├── LowPass: Lerp(2000, 600, proximity) Hz       │
│    │   └── PlayOneShot on timer interval                 │
│    ├── Breathing (20m → 0m)                             │
│    │   ├── Volume: Lerp(0, 0.8, proximity)              │
│    │   └── Pitch: Lerp(0.9, 1.1, proximity)             │
│    └── All values smoothed via Mathf.Lerp per frame     │
│                                                         │
│  Harmony Patches                                        │
│    ├── GameWorld.OnGameStarted → create tracker + audio  │
│    ├── GameWorld.OnDestroy → cleanup                     │
│    └── GameWorld.UnregisterPlayer → remove dead boss     │
└─────────────────────────────────────────────────────────┘



Tracked Bosses

All 21 vanilla boss roles are tracked by default:

Boss Role ID Map
Reshala bossBully Customs
Killa bossKilla Interchange, Streets
Tagilla bossTagilla Factory, Streets
Sanitar bossSanitar Shoreline
Gluhar bossGluhar Reserve
Shturman bossKojaniy Woods
Knight bossKnight Various
Big Pipe followerBigPipe Various
Bird Eye followerBirdEye Various
Kolontay bossKolontay Streets
Partisan bossPartisan Various
Zryachiy bossZryachiy Lighthouse
Boar (Kaban) bossBoar Streets
Cultist Priest sectantPriest Various (night)
Santa gifter Seasonal
Arena Fighter arenaFighterEvent Various
Legion (WildSpawnType)199 Various
Punisher (WildSpawnType)801 Various

Modded bosses: Add integer WildSpawnType IDs in the CustomBossIds config entry (comma-separated).




Roadmap

Future features planned for integration into this mod:

Status Feature Description
Done Boss Heartbeat Escalating heartbeat + breathing near bosses
Planned Cultist Whispers Eerie whispers and murmurs when near Cultists — layered audio that intensifies with proximity, especially unsettling during night raids
Planned PMC Proximity Dread Low, unsettling drone audio when an enemy PMC is within ~50m — no directional information, just the creeping awareness that someone is close. Teammates excluded.



Tech Stack

Component Technology
Plugin C# / .NET Framework 4.7.1, BepInEx 5.x
Patching Harmony via SPT ModulePatch
Audio Unity AudioSource + AudioLowPassFilter, custom WAV loader, procedural generation fallback
Detection GameWorld events + WildSpawnType role matching



Requirements

Version
SPT 4.0.x
BepInEx 5.x (bundled with SPT)
FIKA Not required



FAQ

Does this work without FIKA?

Yes. This is a pure client-side mod with no server dependency. It works on vanilla SPT and with FIKA.

Does the server or other players need this installed?

No. Only install it on your own game client. It has no server component and no multiplayer impact.

Can I use my own heartbeat audio?

Yes. Drop any 16-bit PCM WAV file named heartbeat.wav in the Audio/ folder. Long recordings are automatically trimmed to a single beat (0.5s). Same for breathing_loop.wav (not trimmed — should be a seamless 3-4 second loop).

Will it affect performance?

No measurable impact. Distance checks run at 10 Hz (not every frame), boss tracking is event-driven, and audio uses Unity's built-in AudioSource system.

What if no audio files are present?

The mod generates procedural audio at runtime — a synthetic heartbeat (layered sine waves) and breathing loop (filtered noise). It works out of the box, but real samples sound better.




Contributing

This is a solo project by ZSlayerHQ, but feedback and bug reports are always welcome.

  • Bug Reportsopen an issue with steps to reproduce
  • Feature Requests — open an issue or discuss on Discord


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages