Cognitive Tasks Training App

a “Tower of London” Extensive Simulator

Index

  1. Why Tower of London
  2. Initial Prototype (Unreal Engine)
  3. UX Learnings & Iteration
  4. System Design & Flexibility
  5. Solving the Task Optimally: Breadth-First Search Algorithm
  6. App Structure (Unity 2D)
  7. Audio & Presentation
  8. Scope & Future Work

Why Tower of London

The idea for this project originated when a friend of mine was applying for an Air Traffic Controller (ATC) role and underwent a psychological evaluation as part of the selection process. One of the tasks included was the Tower of London.

While the Tower of Hanoi is widely known and has multiple existing apps, the Tower of London is comparatively niche.
I found that there were no dedicated training apps available on the app stores, despite the task being used in professional evaluation contexts.

I decided to prototype my own training tool to explore whether the task could be translated into a clear, repeatable, and user-friendly interactive experience.
The initial goal was to build a training-focused simulator capable of:

  • tracking number of moves per task
  • measuring time spent per attempt
  • providing full control over task difficulty

(These are features commonly found in other paid ATC-style cognitive training apps such as SkyTest, but missing for the Tower of London specifically)


Initial Prototype (Unreal Engine)

I first implemented the project as a PC-based prototype in Unreal Engine, using Blueprints and mouse input. This allowed me to rapidly explore interaction design, animation feedback, and system flow before committing to a mobile-first implementation.

The prototype supports full configuration of each exercise:

  • A GOAL state is shown at the top of the screen
  • The required minimum number of moves is configurable
  • The GOAL can be scrambled repeatedly to generate different starting states

Once an exercise starts:

  • The CURRENT state is presented in the lower half of the screen
  • Balls can be selected and moved between pegs, respecting task constraints
  • Moves are counted, and a timer tracks elapsed time
  • Players can reset and retry attempts without losing performance data

Upon completion, the user receives structured feedback:

  • star rating based on performance
  • time taken
  • minimum possible moves vs actual moves

This early version validated that the task translates well into an interactive format and that clear animation and feedback are essential to user understanding.


UX Learnings & Iteration

Through testing, I identified several UX improvements that informed the final direction of the app:

  • Visual feedback (outlining selected balls, smooth movement animations) significantly improved clarity
  • Relying on precise hit detection (OnHit) was too strict for touch interfaces
  • For the mobile version, input will instead be interpreted based on screen regions, allowing the system to infer user intent even when taps are imprecise

This approach prioritises usability and reduces friction, especially for first-time users.


System Design & Flexibility

One of the strongest aspects of the prototype is its system-driven generation of starting states and difficulty levels. This allows:

  • exploration of every possible valid configuration of the task
  • fine-grained control over difficulty progression
  • consistent comparison between optimal and user-performed solutions

Future extensions will build on this system to support:

  • replaying the player’s solution step-by-step
  • showing the optimal solution path after completion, which is extremely helpful if the user is struggling with a specific instance

Solving the Task Optimally: Breadth-First Search

To support difficulty scaling, performance evaluation, and meaningful feedback, the app needs to know the optimal solution for any given Tower of London configuration. This requires reliably finding the minimum number of moves needed to reach the goal state.
To achieve this, I implemented a Breadth-First Search (BFS) algorithm over the task’s state space.

Why Breadth-First Search?

Each Tower of London configuration can be represented as a state, with valid moves between states forming a graph. Since all moves have equal cost, Breadth-First Search is a natural fit:

  • It guarantees finding the shortest path (minimum number of moves)
  • It is deterministic and easy to reason about
  • It produces both the optimal move count and the full solution path

State Representation

Each state encodes:

  • the peg each ball is on
  • the vertical alignment of each ball (as you can only fit 3, 2 and 1 ball in each peg respectively)

States are serialised into a compact, comparable format, allowing:

  • fast equality checks
  • efficient storage in visited sets
  • safe traversal without revisiting previously explored configurations

Search Process

At a high level, the algorithm works as follows:

  1. Start from the initial configuration
  2. Generate all valid moves to neighbouring states (any topmost ball can be moved to another peg that contains an empty slot)
  3. Add unseen states to a queue
  4. Repeat until the goal configuration is reached

Because BFS explores states level by level, the first time the goal is found corresponds to the minimum number of moves required.

How This Is Used in the App

The BFS solution underpins several core features:

  • Difficulty control: tasks can be generated with an exact required number of optimal moves
  • Performance evaluation: player moves are compared against the minimum solution
  • Feedback and scoring: star ratings and results screens are grounded in objective data
  • Future features: replaying the optimal solution step-by-step for learning and correction

By grounding the experience in a well-defined algorithm, the app provides transparent, consistent, and explainable feedback, which is especially important in training-focused experiences.


Planned App Structure (Unity 2D)

The final app is being rebuilt in Unity 2D, with a mobile-first, touch-based interface.

Planned modes include:

How to Play

  • Brief explanation of the task
  • Interactive tutorial requiring a small number of moves
  • Focus on onboarding and clarity

Free Play

  • Fully configurable tasks
  • Open experimentation with difficulty and layouts

Career Mode

  • Progressive level grid
  • Each level unlocked by completing the task within time and optimal move constraints
  • Designed so that, by completion, the player has solved every possible Tower of London configuration

Challenge Mode

  • Mirrors actual evaluation-style conditions
  • 15 randomly selected tasks with increasing difficulty
  • Timed attempts
  • Persistent performance history, enabling comparison across runs

Speedrun Mode

  • Complete as many optimal solutions as possible within a time limit
  • Incorrect moves end the run

Audio & Presentation

The final app will include:

  • subtle sound effects for interaction feedback
  • calm, unobtrusive background music
  • a visual style designed to reduce cognitive overload and encourage focus

Scope & Future Work

Support for Tower of Hanoi will follow the same systems and design philosophy, but is intentionally scoped outside of the MVP to ensure focus and polish for the initial release.

Scroll to Top