🕯️ Inspiration

We grew up loving classic horror books, campfire stories, and tabletop RPGs where a Game Master shapes every twist of the adventure. That sense of “something unseen controlling the story” inspired us to reimagine horror using AI. We wanted a game that doesn’t follow a script — but writes the nightmare while you’re inside it.

👁️ What it does

HAUNTED: The AI Nightmare Game is a web-based horror experience where an AI acts as the Game Master. It dynamically generates scenes, puzzles, threats, and consequences based on the player’s choices and fear level. No playthrough repeats — every session becomes a unique horror story driven by tension and psychological dread.

🔧 How we built it

We developed the game using Next.js 14, React 18, TypeScript, and Tailwind CSS for the frontend. Our game engine and AI-driven narrative service run through Google Gemini, combining fear and threat calculations to adjust pacing and intensity. A custom in-memory store manages sessions, checkpoints, and experimental multiplayer rooms. Jest was used for unit tests.

⚠️ Challenges we ran into

Ensuring the AI never produced story-breaking or inconsistent scenes Preventing soft-locks and narrative loops in branching gameplay Balancing horror tone while keeping content strictly PG-13 Maintaining continuity as every scene is generated on the fly Implementing synchronized fear and survival logic in multiplayer mode

🏆 Accomplishments that we're proud of

Achieving fully dynamic AI-generated horror that adapts to the player Creating a working fear-based intensity system with smooth escalation Designing a landing page and interface that reinforce the horror atmosphere Completing soft-lock prevention and checkpoint systems that keep the story playable Making multiplayer collaboration functional — even experimentally — under generated horror scenarios

🎓 What we learned

We learned how to shape AI creativity into structured gameplay, how to apply prompt engineering for continuity and tone control, and how to architect safe PG-13 horror without explicit content. We gained hands-on experience with real-time state management, error-tolerant API design, and gameplay balancing powered by AI logic rather than traditional level design.

🚀 What's next for HAUNTED: The AI Nightmare Game

Full multiplayer campaign with character classes and shared inventory Persistent accounts and cloud-based save files Leaderboards for survival time and puzzle completion Audio cues and ambient soundtrack synced to fear level Support for WebSockets to enable real-time cooperative exploration Mobile version and exclusive Halloween special events.

Built With

  • built-with:-next.js-14
  • git
  • google-gemini-api-(gemini-pro)
  • in-memory-game-state-store
  • jest
  • next.js-api-routes
  • node.js-20
  • react-18
  • react-testing-library
  • tailwind-css
  • typescript
  • uuid
Share this project:

Updates