About the Game

Silent Maze was an experimental horror game in which I implemented the players microphone as a core mechanic. This meant that any noises made in the real world would affect the game world abd screaming or talking in real life would attract the monsters. I made this project in March of 2024 as a personal challenge, limiting myself to 48 hours as a practice for game jams.

  • Created within a 48-hour self-imposed time limit.
  • Uses the player's microphone as a gameplay mechanic.
  • Procedural maze generation using a depth first inspired algorithm

Development

This project was developed in Unity using C#. There are three core components to the gameplay, these are procedural maze generation, enemy AI and the noise system / microphone implementation.

The maze itself is generated at runtime using a recursive depth-first search inspired algorithm. Each cell in the grid is a prefab consisting of four walls and four corners. The algorithm I designed essentially "carves out" a path by deactivating walls between visited cells before backtracking when it hits a wall with no unvisted neighbours. The algorithm is relatively simple but creates enough unpredictability for each level to be visually distinct. I made some additions to this algorithm by randomly selecting 5% of the walls and deactivating those as well. This helped to open the space up a bit more, allowing for the player to more freely explore the maze, without as many dead ends.

The monsters in the game where designed to respond entirely to noise, essentially making them blind. Using a distance value between themselves and the player, along side the players noise level, I was able to create a system that simulates the monsters being attracted to noise. While the monster never directly moves to the players location, it records the position of the last noise it heard and moves towards that instead giving the player a chance to escape, so long as they do it quietly.

The microphone system was the main experiment from this project and used some basic tricks for its implemententation. Once the game is opened the player is prompted to choose their primary microphone as well as manually scale the sensitivity. From there the game starts to record the microphones inputs. Every frame, I took a short sample of the audio buffer, analysing it for its loudest moment. The value is then multiplied by the sensitivity value and smoothed using linear interpoltation to avoid any erratic spikes returning a "loudness" value between 0 and 1.


float[] samples = new float[sampleWindow];
clip.GetData(samples, position - sampleWindow);

float maxSample = 0;
for (int i = 0; i < sampleWindow; i++)
{
	float sample = samples[i];
	if (maxSample < sample) maxSample = sample;
}

float normalisedLoudness = maxSample * sensitivity;
normalisedLoudness = Mathf.Clamp01(normalisedLoudness);
								

This value is then scaled up to create a "hearable distance" value, allowing the enemies to locate the player with audio alone. I also made a few tweaks to this value, adding to it when the player is moving, running or crouching. This helped the game feel more dynamic and ensured the system didn't rely entirely on the microphone.

The resulting prototype, while unpolished, is actually quite fun and proves the core concept of silence being mechanical can work in a game. That said I believe the addition of forcing the player to speak would have amplified the gameplay and intensity of the experience a lot, perhaps by making the game multiplayer with in game voice chat or adding some form of speech to text system.

Screenshots