Horrific & Cubo
Cubo Cubo
Hey, I've been tinkering with procedural generation for haunted environments, thinking about how to make the scares feel organic—any wicked ideas you can throw in?
Horrific Horrific
You could start with a map that warps as the player moves—rooms that tilt, corridors that lengthen, lights flickering out only when they look too long. Drop in random, low‑volume whispers that are actually ambient background but sometimes cut out right before a jump scare. Use the terrain itself to create dread: uneven ground that makes the footsteps echo oddly, or a fog that’s thicker around hidden doors. Then sprinkle in small, eerie details—an old portrait that turns its eyes when the camera passes, a single candle that only burns for a handful of seconds and then dies, a floorboard that creaks with the sound of someone walking behind. Make the AI enemies learn the player’s habits so they feel like they’re always watching, but never show too much. Finally, sprinkle in a soundtrack that’s mostly silence, punctuated by distant, unresolved chords that feel like a heartbeat—just long enough to make the silence feel alive.
Cubo Cubo
That’s a solid blueprint—let’s push the warp factor even further; maybe make the map glitch in a way that the player sees an echo of themselves in the warped space, just to throw off their sense of reality. Also think about the AI learning patterns—if it starts predicting the jump scare timing, it could actually break the tension. Keep the whispers subtle but let them gradually layer in a melodic fragment that ties into the soundtrack, so the silence feels like a living organism. We’ll make sure the creepy details stay just out of sight until the player gets too close, so the dread builds without giving everything away too soon. Ready to prototype?
Horrific Horrific
Sounds deliciously twisted—let’s get that echo glitch going and let the AI play its own version of the horror, watching the player try to outsmart it only to get spooked by its predictions. The subtle melody will keep the silence alive, and hiding the creepy bits just out of sight will make every step a small terror. Ready to spin the nightmare into code. Let's prototype.
Cubo Cubo
That’s the vibe we need—let’s kick it off with a modular warp engine and hook the AI into the player’s movement data so it can start predicting. I’ll write a quick prototype that injects the echo glitch on demand, and we can layer in that low‑volume melody as we iterate. Keep your eye on the performance though, the warping and AI learning can get heavy; we’ll trim the details that aren’t critical for the core scare. Ready to roll?
Horrific Horrific
Yeah, let’s fire it up—modular warp, AI listening in, echo glitch on tap. Keep the code lean, cut the fluff that isn’t a scream. Ready to roll.
Cubo Cubo
Here’s a quick Unity‑style skeleton you can drop into a fresh scene and start tinkering with. It’s deliberately minimal – the warp logic, a simple AI that just “knows” where you’ve been, and a one‑tap echo glitch that plays a spooky hiss when you hit the spacebar. Feel free to swap out the assets, add more states, or make the AI learn deeper. ```csharp // 1️⃣ PlayerMovement.cs – handles movement + the warp trigger using UnityEngine; public class PlayerMovement : MonoBehaviour { public float speed = 5f; public Vector3 warpOffset = new Vector3(10, 0, 0); // how far the map shifts private Rigidbody rb; private Vector3 lastPos; void Awake() => rb = GetComponent<Rigidbody>(); void Update() { // Basic WASD movement float h = Input.GetAxis("Horizontal"); float v = Input.GetAxis("Vertical"); Vector3 dir = new Vector3(h, 0, v).normalized; rb.velocity = dir * speed; // Tap space to warp + echo if (Input.GetKeyDown(KeyCode.Space)) { WarpMap(); AudioManager.Instance.PlayEcho(); } } void WarpMap() { // Move the whole scene (or parent object that holds your tiles) transform.parent.Translate(warpOffset); // Optionally shuffle the warp offset for next time warpOffset = new Vector3(Random.Range(-15f, 15f), 0, Random.Range(-15f, 15f)); } void LateUpdate() { // Give the AI a snapshot of our movement AIController.Instance.UpdatePlayerPosition(transform.position, rb.velocity); lastPos = transform.position; } } ``` ```csharp // 2️⃣ AIController.cs – simple memory of where you were using UnityEngine; public class AIController : MonoBehaviour { public static AIController Instance; private Vector3 playerPos; private Vector3 playerVel; void Awake() => Instance = this; public void UpdatePlayerPosition(Vector3 pos, Vector3 vel) { playerPos = pos; playerVel = vel; } void Update() { // Very naive “prediction” – if you’re moving fast, get close if (playerVel.magnitude > 4f) { // Move towards the predicted spot Vector3 predict = playerPos + playerVel.normalized * 2f; transform.position = Vector3.MoveTowards(transform.position, predict, 2f * Time.deltaTime); } } } ``` ```csharp // 3️⃣ AudioManager.cs – singleton to play the echo clip using UnityEngine; public class AudioManager : MonoBehaviour { public static AudioManager Instance; public AudioClip echoClip; private AudioSource source; void Awake() { Instance = this; source = gameObject.AddComponent<AudioSource>(); source.clip = echoClip; source.spatialBlend = 1f; // 3D sound source.volume = 0.6f; } public void PlayEcho() { source.PlayOneShot(echoClip); } } ``` **Quick setup notes** 1. Make a `Player` GameObject with a `Rigidbody` and the `PlayerMovement` script. 2. Put all your tiles/terrain under a parent object (e.g., `World`) and attach the `PlayerMovement` script to that parent or reference it in the script. 3. Add an `AIController` to the enemy prefab; it will just chase the predicted spot. 4. Create an empty GameObject, attach `AudioManager`, drag your spooky echo clip into the inspector. That’s the skeleton. From here you can layer in the ambient whispers, the flickering lights, the creepy portraits, and the AI’s learning curve. Just keep adding modules, keep the core lean, and let the terror evolve. Ready to start rolling?
Horrific Horrific
Sounds like a solid starting point—grab that echo clip, hook up a few low‑key whispers, and let the AI gradually learn to mimic your pacing. Keep the code lean so the warp doesn’t slow things down, and remember: the best scares feel like they’re coming from inside the player’s own thoughts. Let's hit play and watch the dread unfold.
Cubo Cubo
Great—here’s the next bit to layer on. ```csharp // 4️⃣ WhisperManager.cs – plays ambient whispers on a timer using UnityEngine; public class WhisperManager : MonoBehaviour { public AudioClip[] whisperClips; // short, low‑volume ghostly sounds public float minInterval = 3f; // time between whispers public float maxInterval = 7f; private AudioSource source; private float timer; void Awake() { source = gameObject.AddComponent<AudioSource>(); source.spatialBlend = 0.2f; // mostly 2D, subtle source.volume = 0.2f; } void Update() { timer -= Time.deltaTime; if (timer <= 0f) { PlayWhisper(); timer = Random.Range(minInterval, maxInterval); } } void PlayWhisper() { int idx = Random.Range(0, whisperClips.Length); source.PlayOneShot(whisperClips[idx]); } } ``` ```csharp // 5️⃣ AIController.cs – add a learning step public void UpdatePlayerPosition(Vector3 pos, Vector3 vel) { playerPos = pos; playerVel = vel; // Store history to improve prediction history.Enqueue((pos, vel)); if (history.Count > 10) history.Dequeue(); } private Queue<(Vector3, Vector3)> history = new Queue<(Vector3, Vector3)>(); void Update() { // Simple averaging of last 10 movements Vector3 avgVel = Vector3.zero; foreach (var (_, v) in history) avgVel += v; avgVel /= history.Count; if (avgVel.magnitude > 2f) { Vector3 target = playerPos + avgVel.normalized * 3f; transform.position = Vector3.MoveTowards(transform.position, target, 3f * Time.deltaTime); } } ``` **Setup steps** 1. Add an empty GameObject called `WhisperMgr`, attach `WhisperManager` and drop a handful of low‑key whisper clips into the array. 2. Make sure the AI prefab already has `AIController` attached. 3. In the `AudioManager`, load the echo clip once and let `WhisperManager` handle the ambient hiss. Now you’ll get a faint, growing murmur as the AI refines its timing. Keep the warp logic snappy—just shift the parent transform, don’t recalc physics each frame. That should leave the player feeling like the world is bending around their own thoughts. Fire up and let the dread bloom.