Unity systems and tools

Dungeon Wipe

I built a level editor with 26 prefab types so I could test dungeon layouts without rebuilding the game. Save a layout as JSON and the game rebuilds the level and its enemy navigation. I also designed the combat and adaptive healing used in my first-author ICEC 2024 paper.

Role
Solo Programmer and Designer
Context
  • Solo Project
  • BSc final project
  • research prototype
Period
2024
Status
  • Playable in browser
  • Windows build
  • source available
  • Unity 2022 LTS
  • C#
  • JSON
  • NavMesh
  • ScriptableObjects
Dungeon Wipe gameplay in a custom dungeon with enemies, hazards, score, and health UI
Dungeon Wipe combat in a level reconstructed from my JSON layout data.

Overview

I designed and programmed Dungeon Wipe as my BSc final project. It combines dungeon combat, a player-facing level editor and adaptive healing used in my first-author ICEC 2024 paper.

Visual assets in the public build are AI-generated placeholders. The systems, tooling and code are mine.

My contribution

  • Built the multi-floor grid editor, including occupancy checks, snapping and JSON records for 26 selectable prefab types.
  • Reconstructed saved layouts through a prefab registry and baked navigation after loading, so enemies could use newly authored levels.
  • Designed and implemented Warrior, Archer and Mage roles alongside sword, crossbow and shield combat.
  • Implemented health-threshold potion support and improved attack and potion feedback after player comments.
  • Reduced the WebGL download from 149 MB to 39 MB through texture budgets and compression, and added one headless-capable build script for Windows and WebGL.

Combat and Enemy Roles

Warriors swarm the player to force movement around the level. Archers create ranged pressure that the shield or environmental cover can answer. Mages bypass the shield, so the same defence cannot solve every ranged threat.

Weapon switching was an original goal: when a Mage is too far away to reach quickly, the crossbow gives the player a way to deal with it. NavMesh navigation and ScriptableObject enemy data support these different roles.

Sword and crossbow combat against warriors, archers and mages in an authored dungeon.

Changes after player feedback

Reading attacks and potions

During playtests, people took damage and couldn’t tell where it came from. They also picked up potions without knowing what had changed. I added attack effects and sounds, then gave potions a pickup sound, particles and a HUD label for the effect.

Dealing with the Mage

The original Mage attacked from too far away, even when unseen, and could survive a crossbow shot to cast again. I reduced its range and health and added clearer attack feedback. Current code checks sight at attack start, not again when damage lands.

Level Editor and Runtime Loading

I started by typing layouts into files. That got awkward once I wanted to rotate objects and build across floors, so I made an editor inside the game.

Pick from 26 selectable prefab types and snap an object onto a free grid cell. I save its ID, position and rotation in JSON. When the level loads, the game looks up those IDs, places the objects and builds the NavMesh so enemies can find their way around. Each saved level keeps its own high score.

Dungeon Wipe level editor showing a placement grid, prefabs, grid controls, and save actions
Custom editor used to author and save dungeon layouts.

From editor to playable level

A 35-second recording. Jump to the part you want to inspect.

  1. Place objects on the editor grid and assemble the dungeon.

  2. Save the authored layout so it can be reconstructed outside the editor.

  3. Select the saved level, then play the layout rebuilt at runtime.

  4. Save the run result against that level and find it in the high-score list.

A level authored in the editor, saved, then loaded back and played, with its score kept against that level.

Build the layout

Adaptive healing

I wanted to support struggling players without making the adaptation obvious or changing the enemy threat. Healing potions adjust recovery support while enemy count, health, damage and behaviour stay unchanged.

Health bands were the simplest predictable, testable implementation. They select potion eligibility and value. Successful spawns use a fixed wait. The limitation is practical: support only helps if the player reaches and collects the potion.

  1. Read player health
  2. Check potion eligibility
  3. Select healing value
  4. Spawn potion, then wait the fixed interval
If no potion is eligible, check again next frame.

The paper describes the approach through anxiety, empowerment and expected health. This health-threshold implementation was used in the student study and formed the basis of the simulation. That does not mean the current source reproduces every equation or parameter in the manuscript.

Did players notice the extra healing?

What players noticed

Of 38 computer-science students who played, 83% did not notice the adaptation. That tells me how visible it was to this group. I’d need a separate study to measure whether it made the game more enjoyable.

How often the simulated player failed

  • Uniform distribution40%
  • Random distribution56%
  • Adaptive healing8%
I compared three potion distributions in a Monte Carlo simulation with five levels and 1,000 runs per level. Each bar uses the same 0–100% scale.

First author · Félix, T., Mourato, F., Morais, J. · ICEC 2024 · Springer LNCS 15192 · pp. 323–330

Outcome and evidence

I released Windows and WebGL builds with the editor-to-runtime workflow, combat and per-level saves. The recorded browser download fell by about 74%, from 149 MB to 39 MB. The adaptive-healing implementation also supported my peer-reviewed ICEC 2024 paper.

  • The release record covers Windows play from menus through combat and return, plus the published browser build’s level list, loading, combat and persistent browser saves.
  • The build script provides repeatable Windows and WebGL build entry points. These delivery results are separate from the paper’s player study and simulation.

What I learned

Keeping layout data separate from scene objects let me test more than one dungeon with the same combat code. The Mage iteration also taught me to check what a player can read before adding more enemy pressure.