A first-person horror survival game built with a custom OpenGL rendering engine in C++17. Navigate a dark museum, collect keys to escape, and avoid AI-driven enemies that freeze when caught in your flashlight beam.
You wake up trapped in a dark museum. Three keys are scattered throughout the environment. Collect them all to unlock the exit door and escape. But you're not alone — skeletal AI guards roam the halls hunting you.
Core mechanics:
- Flashlight (Torch): Shine your spotlight on enemies to freeze them in place. They can't move while illuminated.
- Hiding: Press
Fnear tables to hide underneath. Enemies lose track of you while hidden. - Key Collection: Find all 3 keys scattered across the map to unlock the exit.
- Escape: Once all keys are collected, reach the exit door before you're caught.
Controls:
| Key | Action |
|---|---|
| WASD | Move |
| Mouse | Look around |
| F | Hide/unhide under tables |
| Q | Settings menu |
| ESC | Return to menu |
Watch the full gameplay video here:
https://drive.google.com/file/d/1IKwIN0e0E7Hj2GHYx0CjgNtVjX-OVfN8/view
- Forward renderer with support for opaque and transparent object sorting
- Physically-based lighting with multiple light types (point, directional, spot) and material maps (albedo, specular, roughness, ambient occlusion, emission)
- Shadow mapping with animated shadow casting for AI characters
- Skeletal animation system with FBX model support (idle, running, turning, taunt)
- Post-processing pipeline — custom blood-shake effect on game over, vignette, chromatic aberration
- Texture mapping with configurable samplers (filtering, wrapping, mipmaps)
- Entity-Component-System (ECS) architecture for scene management
- Physics via ReactPhysics3D — rigid bodies, collision detection, raycasting
- AI pathfinding and steering — enemies roam, detect the player, and chase
- Torch-freeze mechanic — spotlight cone + line-of-sight raycasting freezes enemies
- Hiding system — proximity-based table detection with enter/exit states
- Collectible system — key pickup, door unlock, and victory trigger
- Scene deserialization — all scenes defined in external JSON config files
- Audio via SoLoud — background music, spatial SFX, jumpscare stings
- Custom loading screen with randomized horror tips and glitch effects
- In-game HUD showing key progress
- Game-over sequence with jumpscare → text reveal → interactive restart
- Settings menu with volume control
source/
├── common/
│ ├── components/ # ECS components (camera, light, mesh-renderer, rigidbody, AI, collectible, hideable)
│ ├── ecs/ # Entity, World, Transform
│ ├── material/ # Material system, pipeline state
│ ├── mesh/ # Mesh loading and VAO management
│ ├── shader/ # Shader program compilation and linking
│ ├── systems/ # Game systems (renderer, physics, AI, hiding, collectibles, animation)
│ └── texture/ # Texture2D, samplers, texture utilities
├── states/ # Game states (menu, play, loading, HUD, game-over)
└── application.hpp # Main application loop
- CMake 3.10+
- C++17 compiler (MSVC 2017+, GCC 9+, or Clang 5+)
- OpenGL 4.x capable GPU
# Configure
cmake -B build -S .
# Build
cmake --build build --config Release
# Run
./bin/GAME_APPLICATION -c='config/app.jsonc'On Linux, also install OpenGL and GLEW development packages:
sudo apt install libgl-dev libglew-dev| Library | Purpose |
|---|---|
| GLFW | Window management and input |
| GLAD | OpenGL function loading |
| GLM | Mathematics (vectors, matrices, transforms) |
| Dear ImGui | Immediate-mode UI |
| Assimp | 3D model importing (OBJ, FBX, glTF, Collada) |
| ReactPhysics3D | Physics simulation and collision detection |
| SoLoud | Audio engine |
| TinyEXR | HDR texture loading |
This project was developed for the CMP3060 Computer Graphics course (Year 3, Spring 2026). It builds on a phased engine implementation:
- Phase 1: Core rendering pipeline — shaders, meshes, transforms, pipeline state, textures, samplers, materials, ECS framework, forward renderer with sky and post-processing.
- Phase 2: Lighting system with multiple light types and lit materials, plus the full game implementation with physics, AI, audio, and gameplay mechanics.
Built by the Unblinking team.