The Path of Penance

ABOUT THE GAME

The Path of Penance is a psychological horror survival game developed as my final major project for university. The game places players in a dystopian future where prisons no longer exist, replaced by the Penitence Engine, a machine that constructs a personalised simulation from the convicted's fears and guilt. Players must traverse a cursed road to earn their redemption, facing enemies, resource scarcity and the constant temptation to stray from the path.

The game blends roguelike and survival horror elements, drawing inspiration from titles such as Dark Souls, Inside and Returnal. Each run is procedurally varied through randomised chest placement, weapon distribution and enemy spawning, ensuring no two playthroughs feel identical. Players manage a directional inventory system across four weapon slots, balance limited ammunition shared across weapon types and make strategic decisions about when to engage enemies and when to seek safety under the streetlamps scattered along the road.

Built entirely in Unity using C#, The Path of Penance was developed solo over the course of the academic year. The project required building numerous interconnected systems from scratch including a proximity based enemy spawning system with cooldown logic, a scriptable object driven weapon and inventory architecture, a dynamic ammo economy shared across weapon types and a chest spawning system that guarantees fair weapon distribution across the length of the road.

What defines The Path of Penance is its tension between safety and progression. Straying from the road deals damage but is necessary to find weapons and supplies. Streetlamps offer healing and protection from enemies but have a finite healing capacity per run, preventing players from camping indefinitely. This push and pull between risk and survival is the core of the experience, designed to keep players anxious, resourceful and always moving forward.

Genre . System

Horror . Walking Simulator . FPS

Unity . C#

Year

2026

Final Year Major Project for Bachelor's Degree (Bsc)

Details

Developer: Richard Ogun

Role: All systems within the game.

Team Size: Solo developer

Duration: 6 Months

Showcased: Guildford Games 2026

Above is a video showcasing the gameplay in motion.

System

Procedural Chest Spawning System

One of the core design challenges in The Path of Penance was ensuring that players always had access to weapons and resources without making the experience feel predictable. I built a chest spawning system that divides the road into paired spawn zones, guaranteeing at least one chest per zone while randomising the second. Weapons are distributed across the road in a fixed progression pattern, ensuring players always encounter new weapons as they advance rather than finding everything clustered at the start or end. Every chest regardless of whether it contains a weapon also drops randomised amounts of ammunition across all four types, with rarer ammo types like shotgun shells appearing in smaller quantities. The system was iterated on several times after playtesting revealed that early versions could place all weapons in the final section of the road, making the pistol the only usable weapon for most of a run.

Directional Inventory and Weapon Management System

The inventory system in The Path of Penance was designed to feel intuitive under pressure while supporting the game's survival mechanics. Players have four directional slots mapped to the arrow keys, each capable of holding two weapons. Weapons are automatically assigned to slots in order as they are picked up, and players can cycle between the two weapons in any slot by pressing the same direction twice. The system is built on Unity ScriptableObjects, meaning each weapon carries its own data including clip size, ammo type, damage, fire rate and reload time. A significant technical challenge was preventing ScriptableObject asset data from being permanently modified at runtime, as firing a weapon would otherwise permanently reduce the starting ammo stored in the asset between sessions. This was solved by treating clip ammo as a runtime value set on pickup rather than a persistent value stored in the asset.

Ammunition Economy System

The ammunition system was designed to create meaningful resource management decisions across multiple weapon types. Four ammo types exist in the game, small, medium, large and shotgun shells, each shared across all weapons of that type. The stash displayed in the top right of the screen represents reserve ammunition separate from what is loaded in any weapon's clip. When a player reloads, ammunition moves from the stash into the clip and the display updates accordingly. This means players must consider not just whether they have ammo but how it is distributed across weapons sharing the same type. The system is managed through a singleton AmmoInventory class that any script can query or modify, keeping ammo logic centralised and consistent.

Enemy AI, Health and Spawning System

Enemies in The Path of Penance are built around a NavMesh-driven chase and attack system with several layers of contextual behaviour. Each enemy detects the player within a configurable range, chases them across the road and executes timed attack sequences driven by animation events. A separate health component handles damage reception, hit reactions, death animations and a fade-out coroutine that dissolves the enemy body over time before destroying it. Enemies respect the game's safe zone mechanics, stopping their pursuit when the player stands under a streetlamp. The spawning system uses fixed spawn point markers placed around the map, each triggering a group spawn when the player enters a proximity radius. A cooldown system prevents immediate respawning, and a separate player proximity spawner attached to the player spawns enemies directly around them once they have acquired their first weapon. All active enemies despawn if the player remains off the road or in a safe zone for a sustained period, with the despawn timer resetting if the player returns to the road before it expires.

Gunplay and Combat System

The gunplay system supports both semi-automatic and fully automatic fire modes, determined per weapon through the ScriptableObject data. Firing uses raycasting from the centre of the camera to ensure accuracy aligns with the crosshair regardless of weapon position in the player's view. Each shot consumes clip ammo, triggers a camera recoil coroutine that kicks the view upward before returning to its original rotation, and plays the weapon's assigned fire sound. When the clip is empty the game automatically initiates a reload. The reload system draws from the shared ammo stash, calculates how much ammo is needed to fill the clip and deducts accordingly, playing a reload sound and enforcing a configurable reload delay. All weapon behaviour data including damage, range, fire rate and reload time is stored in ScriptableObjects, making balancing straightforward without touching code.

Player Health, Stamina and Off-Road Punishment System

Player health and stamina are managed through separate components that communicate with the player controller. Health decreases when hit by enemies or when the player steps off the road, with off-road damage applied continuously over time without triggering the player's pain sounds, which are reserved for enemy hits only. At 25% health a heartbeat sound fades in gradually, increasing tension as the player approaches death. The stamina system drains while sprinting and regenerates after a configurable delay once the player stops, preventing the player from sprinting indefinitely. When stamina is depleted sprinting is disabled until the bar recovers. Both systems feed into a unified death flow that triggers the death screen, stops all non-ambient audio and presents the player with retry and main menu options.

Streetlamp Safe Zone System

Streetlamps serve as the game's primary safe haven mechanic. Each lamp projects a trigger zone that sets the player's safe zone flag to true, causing all enemies to halt their pursuit and preventing new enemy spawns from triggering. While inside the zone the player heals over time up to a per-lamp maximum of 200 health per run. Once a lamp has given its full healing capacity it stops healing but continues to provide enemy protection, meaning players cannot indefinitely exploit lamps for full health restoration. This cap was introduced during development to prevent players from bypassing the game's core tension by camping lamps rather than progressing. The healing capacity resets when the scene reloads on death.

Procedural Audio System

Audio in The Path of Penance was implemented to reinforce atmosphere and give the player meaningful feedback at every moment. Enemy growls are positional 3D sounds that fade with distance, ensuring players are only aware of nearby threats. A separate effects audio source on each enemy handles hit and death sounds without interrupting the ambient growl loop. Player feedback sounds including grunts and screams play randomly when taking enemy damage, while a looping heartbeat fades in at low health. The background theme and wind ambience loop continuously throughout the game while distant screams play at randomised intervals to unsettle the player. Weapon sounds, chest open sounds, weapon switch sounds and the win/lose musical sting are all wired to their respective gameplay events. All enemy audio is paused when the game is paused and resumed when play continues, ensuring audio state is consistent with game state.

UI and HUD System

The HUD was designed to remain minimal and readable without breaking the game's oppressive atmosphere. A health bar sits in the bottom left alongside a stamina bar that depletes during sprinting. A diamond shaped directional inventory widget in the bottom right displays only the currently active weapon in each slot along with its loaded clip count, hiding inactive weapons to reduce clutter. An ammo display in the top right shows the reserve stash for all four ammo types, remaining invisible until the player opens their first chest. A crosshair appears at the screen centre only after the player picks up their first weapon. Weapon pickup notifications appear in a semi-transparent box on the left side of the screen using the same system as tutorial messages, fading in and out automatically. The pause menu, death screen and win screen all use Canvas Group fading for smooth transitions and disable player input while active.

Tutorial and Onboarding System

Given the game's minimal approach to handholding, a trigger-based tutorial system was built to deliver contextual hints at key moments without interrupting the flow of play. Invisible trigger volumes placed at specific points along the road detect when the player walks through them and send a message to a central TutorialManager, which fades a text box in on the left side of the screen, holds it for a set duration and fades it out. If a new trigger fires before the previous message has faded, the current message is immediately replaced by the new one. Each trigger fires only once per run. The system reuses the same display infrastructure as the weapon pickup notifications, keeping the codebase consistent.

Game Flow and Scene Management

The overall game flow is managed through a GameManager singleton that listens for player death and win conditions and triggers the appropriate UI response. On death all audio stops, the death screen fades in and the game pauses. The retry button reloads the game scene entirely, resetting all systems to their initial state. A separate intro scene plays a Star Wars style scrolling text crawl that establishes the game's lore before fading into the game level. The crawl can be skipped with a key press and only plays when starting a new game from the main menu, not on retry. Scene order in the build profile runs from main menu to intro to game level, with the retry flow bypassing the intro entirely by loading the game scene directly.

Reflection

During the development of The Path of Penance, I gained extensive experience designing and implementing interconnected game systems entirely from scratch as a solo developer. The project presented significant technical challenges across nearly every system, many of which required multiple iterations before arriving at a working solution.

The inventory and weapon management system proved more complex than initially anticipated. Early implementations treated ScriptableObject assets as runtime data containers, which caused weapon stats to persist incorrectly between sessions. Resolving this required rethinking how runtime state was separated from designer-facing asset data, ultimately leading to a cleaner and more robust architecture. The ammunition economy system went through similar revisions, particularly around ensuring the UI correctly reflected stash values separate from loaded clip counts.

The enemy spawning and despawn logic also required considerable reworking. Early versions of the despawn timer did not correctly reset when the player returned to the road, meaning enemies would disappear even during active combat. Diagnosing and resolving this reinforced the importance of clearly defining state transitions and thoroughly testing edge cases rather than assuming intended behaviour.

The chest and weapon distribution system was another area of significant iteration. Initial implementations occasionally placed all weapons in the final section of the road, leaving players with only the starting pistol for the majority of a run. This required redesigning the spawning logic to guarantee weapon availability across the full length of the road in every playthrough.

Raycast based shooting presented its own challenges, particularly around layer masking and firing point orientation, both of which required debugging across multiple sessions before producing reliable results.

Overall, The Path of Penance strengthened my understanding of Unity's component architecture, ScriptableObject driven design, runtime state management and the importance of iterative testing when building systems that depend heavily on one another.

© Richard Ogun. All rights reserved.

Information icon

We need your consent to load the translations

We use a third-party service to translate the website content that may collect data about your activity. Please review the details in the privacy policy and accept the service to view the translations.