The Haptic Maze
by Diletta Maria Dell'Utri
A maze you feel rather than see — vibration motors driven from an Umfeld sketch turn navigation into a tactile experience. A prime demonstration of Umfeld’s low-latency controller capabilities on embedded hardware.
Project Overview
The Haptic Maze is an interactive tactile game experience developed by Diletta Maria Dell’Utri at Hochschule für Künste Bremen (The Small Computing Group). Built in C++ using the Umfeld library and running on a Raspberry Pi 4 with a Battletron controller, the application transforms classic maze navigation into a sensory, haptic-driven experience where players navigate through controller vibrations.
Hardware Setup & Haptic Rumble System
The game pairs a Raspberry Pi 4 with a Battletron Gamepad connected via SDL3 gamepad input & rumble subsystems:
- Valid Movement Pulse: When moving to an open adjacent grid cell, the controller emits a gentle, short vibration impulse (
strength: 1000, 20ms). - Wall Collision Impact: Attempting to move into a wall or obstacle triggers an intense, long vibration effect (
strength: 5000, 1000ms), alerting the player immediately without needing visual feedback. - Direct Rumble Control: Implemented directly via SDL3’s
SDL_RumbleGamepad(pad, low_frequency, high_frequency, duration_ms)API within Umfeld’s event loop.
Gameplay Modes
The project features three distinct gameplay modes designed for single-player challenges and collaborative multiplayer:
- One Player - Easy Mode:
- Visual position tracking enabled (player dot and exit square rendered).
- Maze walls remain hidden, requiring players to visually estimate pathways while receiving haptic feedback.
- One Player - Hard Mode (Blind Tactile Navigation):
- No player position or walls rendered on screen (only maze outer border and exit square are visible).
- Players must rely entirely on controller rumble feedback to feel their way out of the maze.
- Two Player Co-Op Mode:
- Full maze layout, player dot, and exit are displayed on screen.
- Designed for co-op gameplay: one player holds the controller blindfolded while the second player views the display and gives verbal navigation directions.
Procedural Generation & Rendering Architecture
- Randomized DFS Generator (
MazeGenerator.h): Dynamic maze grid generation powered by a Depth-First Search (DFS) algorithm with backtracking. - Cached
PGraphicsOff-Screen Buffer: To maintain smooth 60 FPS performance on Raspberry Pi 4 hardware, maze wall geometry is pre-rendered once onto an off-screenPGraphicssurface (renderBackground()) and composited directly during frame draw cycles. - Dynamic Resizing: Maze size factor and grid dimensions automatically recalculate based on canvas size (
setMazeSize()).
Arcade State Machine & Leaderboard System
- Complete Game State Flow: State machine managing transitions between
MENU,PLAYING,PAUSED,WIN,ENTER_NAME,LEADERBOARD, andRULES. - Persistent Binary High Scores: Binary file serialization (
leaderboard.dat) tracking the top 10 fastest completion times per game mode, featuring arcade-style 3-letter name entry (AAA) controlled via D-pad. - Audio Subsystem: Integrated background music (
bg_music.wav) and win sound effects (win.wav) driven by Umfeld’sSamplerandaudioEvent()processing loop.