A pixel-art spellcasting adventure played with custom wearable Arduino gloves & full-body computer vision
Twist a physical rotary dial on your wrist to spin a 12-spell elemental grimoire, weave timed spell rituals with fingertip buttons, swings and webcam body poses, dodge and parry incoming enemy strikes in real time, and battle across two laptops in co-op or high-speed PvP duels.
The Enchanted Gloves · The Story · Spell Weaving · Combat & Vision Defense · Co-op · Duel (PvP) · Architecture · Quick Start
Hardware meets dark-fantasy pixel art. Two custom-built wearable Arduino Uno R4 WiFi spellcasting gloves paired over Wi-Fi UDP to the live Aethren game client.
- Two Custom Wearable Spellcasting Gloves: Built from Arduino Uno R4 WiFi boards, Grove Base Shields, fingertip capacitive touch and tactile button sensors, a wrist-mounted rotary dial, a 3-axis I2C accelerometer, a piezo buzzer, and a 16×2 RGB LCD—streaming raw telemetry over Wi-Fi UDP at 40 Hz.
- Timed Ritual Spell Weaving: Every spell in the 12-rune grimoire (Fire, Frost, Storm) is cast by chaining physical glove inputs (
B1,B2,T,Swing) and live webcam body poses (↑ Raise Arm) against a sweet-spot timing bar (★ Perfect ×1.45 power). - Full-Body Computer Vision Defense: MediaPipe Pose Landmarker runs locally in the browser at 30 fps. When enemies attack, a translucent silhouette of your body and shrinking impact rings appear on screen—physically sidestep, duck, or raise your arm to dodge or block.
- Two-Screen Co-op & Real-Time PvP Speed Duels: Two laptops on the same hotspot pair automatically through the Glove Hub. Team up against the 360 HP Ruined Gatekeeper in first-person co-op, or race head-to-head in Duel (PvP)—weaving spells at up to 2× Blitz speed while dodging staggered Osu!-style target circles on your body pose.
Each controller is a wearable gauntlet built around an Arduino Uno R4 WiFi and a Grove Base Shield V2. The firmware (firmware/enchanted_glove/enchanted_glove.ino) is a zero-blocking state machine (millis()-driven, no delay() calls) that streams raw sensor frames over Wi-Fi UDP 40 times per second while driving non-blocking piezo haptic melodies and live LCD prompts.
| Grove Socket | Component | Role in Aethren |
|---|---|---|
| A0 | Rotary Angle Sensor (Potentiometer) | Spins the 12-wedge radial spell wheel & navigates every menu with slot hysteresis so boundaries never flicker |
| D4 | Tactile Button 1 (B1) |
Opens the selected spell's ritual stage, performs [B1] ritual steps, and confirms menu choices |
| D8 | Tactile Button 2 (B2) |
Jumps between Fire / Frost / Storm on the wheel, performs [B2] ritual steps, Hold B2 to Rest (+MP & Stance) or skip dialogue, and parries on enemy turns |
| D7 / D3 | Capacitive Touch Sensor (T) |
Cycles enemy targets (or Cast Speed in Duel mode), performs [T] ritual steps, parries incoming attacks, and Hold T opens the Pause/Settings menu |
| I2C | 3-Axis Digital Accelerometer | Auto-detects LIS3DHTR, ADXL345, or MMA7660. Swings over 1.85 g classify as slash, thrust, or shake to complete [Swing] steps (up to ×1.45 power) or trigger a Glove Ward parry |
| D5 | Piezo Buzzer | Non-blocking haptic audio cues: tick (dial step / parry / turn start), rising cast chirp, falling fizzle on refused/dodged casts, and double-thud hit when wounded |
| I2C | 16×2 RGB Backlight LCD (0x3E / 0x62) |
Displays active spell name, MP cost, HP/MP bars, and button hints on LCD v4; uses status backlight color coding (Orange / Green / Red) on LCD v2 |
A rift of light splits a rainy forest at midnight, and a child steps out of it. Two hooded figures watch from the trees. One whispers run, little shadow, and the other says stay. Whatever you choose, something in the undergrowth has already found you.
There are 12 spells across Fire, Frost, and Storm. In the story campaign you begin knowing three starter runes (Ember Bolt, Frost Shard, Storm Spark) and unlock the remaining nine mid-battle by reading grimoire hints and weaving their rituals.
| Element | Spell | Cost | Ritual Sequence | Effect & Elemental Combo |
|---|---|---|---|---|
| 🔥 Fire | Ember Bolt (Starter) | 2 MP | ↑ Arm → B1 → Swing |
14 dmg. Quick & cheap. Shatters Chilled or Frozen foes for +50% damage. |
| 🔥 Fire | Fire Lance | 4 MP | ↑ Arm → B1 → B2 → Swing |
32 dmg that pierces armor. Shatters Chilled/Frozen (+50% dmg). |
| 🔥 Fire | Immolate | 3 MP | B2 → Swing |
8 dmg + applies Burning (6 armor-ignoring dmg/turn for 3 turns). Primes Storm Conductive. |
| 🔥 Fire | Meteor | 7 MP | ↑ Arm → B1 → B2 → T → Swing |
34 dmg to primary target + 16 splash dmg to all other foes. Undodgeable pack devastation. |
| ❄️ Frost | Frost Shard (Starter) | 2 MP | T → Swing |
10 dmg + applies Chilled (−30% attack & stance dmg; blocks Jaw & Grab). |
| ❄️ Frost | Ice Shield | 3 MP | ↑ Arm → T → B1 |
Self ward: absorbs 18 damage for 2 turns and blocks Bleeding, Scorn, and Eclipse curses. |
| ❄️ Frost | Frost Prison | 5 MP | ↑ Arm → T → B1 → Swing |
Encases target in ice: strips Roused and Freezes for 2 turns (1 turn on Gatekeeper). |
| ❄️ Frost | Frost Nova | 4 MP | T → B2 → Swing |
12 area dmg to every enemy and applies Chilled to the entire pack. Undodgeable. |
| ⚡ Storm | Storm Spark (Starter) | 1 MP | ↑ Arm → B2 → B1 |
7 dmg. Near-instant bolt. Conducts on Burning/Chilled foes (+4 dmg & refunds 1 MP). |
| ⚡ Storm | Chain Lightning | 4 MP | ↑ Arm → B2 → T → Swing |
16 dmg to primary target, then arcs to remaining enemies for 10 and 6 dmg. Undodgeable. |
| ⚡ Storm | Static Shock | 3 MP | T → B1 |
8 dmg, strips Roused (+5 bonus dmg), and Drains all energy so the foe must Rest. |
| ⚡ Storm | Overcharge | 2 MP | ↑ Arm → B2 → Swing |
Self buff: your next damaging spell deals ×1.5 damage (and refunds 1 MP if Storm). |
The opening encounter walks new players through an interactive 6-step Glove Training tutorial (spinning the dial, switching elements, cycling targets, weaving a ritual, casting, and parrying a mid-lunge wolf attack).
When enemies attack, you can defend physically in two ways:
- Webcam Pose Defense (MediaPipe Vision):
- Stand in front of your laptop camera to calibrate your neutral torso zone (with automatic virtual-hip estimation when sitting or standing close to a laptop webcam).
- During an enemy windup, a translucent cyan projection of your body and shrinking impact rings appear over the targeted area:
- Sidestep Left / Right: Move your entire torso past the red danger line to completely evade lunges and grabs.
- Duck: Drop your shoulder line below the horizontal danger line to slip under high slashes.
- Raise Right Arm: Hold your guard arm up to block (cuts health damage to 25%, halves stance damage, and prevents Bleeding and boss curses).
- Glove Ward Parry:
- Shake the glove or tap
T/B2during an enemy attack to raise a Glove Ward—halving incoming damage and reflecting 6 damage back at the attacker.
- Shake the glove or tap
At the castle gate, the Ruined Gatekeeper crashes down from the battlements (240 HP solo / 360 HP in co-op, 4 armor) wreathed in purple Scorn flames:
- Scorn Cleave: Heavy axe slash that inflicts Scorn (−3 HP per turn) and carves a jagged purple gash across the screen.
- Eclipse of Scorn: Dark shockwave that inflicts Eclipse (−4 HP per turn and halts passive MP regeneration).
- Scorn Inferno: Ultimate blast that ignites the entire battlefield for 5 turns.
Two gloves, two laptops, one shared battlefield. Each player claims their own wireless glove through the Glove Hub.
Two players on separate laptops—each wearing their own enchanted glove—can team up against the Ruined Gatekeeper:
- Automatic Gate Pairing: When both laptops reach the castle gate (or click Boss fight in the bottom-left dev tools on the title screen), they discover each other automatically over the Glove Hub WebSocket relay (
:8765). - Shared Turn-Based Boss Battle: Turns alternate Host → Partner → Gatekeeper (360 HP). The Gatekeeper's single-target Scorn Cleave dynamically targets whichever hero dealt him the most damage since his last swing.
- First-Person Partner VFX & Low-Latency Defense: Your spells launch from your own hand in the center, while your partner's spells streak in from the right edge of your screen. Both players can parry with their gloves or dodge/block on their own webcams with optimistic local feedback.
Select Duel (PvP) on the title screen to enter the moonlit forest clearing and face a Rival Spellbearer in a real-time Speed Spellcasting Contest—either against a second player on another laptop, or solo against the AI Speed Caster.
- Left-Docked 12-Spell Wheel & Live Rival Telemetry: Uses the exact moonlit clearing stage, rain atmosphere, and 12-spell radial wheel + ritual bar as the main game, docked to the left side of the screen so the Rival Spellbearer sprite in the center of the clearing stays completely unobstructed. Above your rival's health bar, live intent tags show which spell they are weaving in real time (
⚡ Weaving Fire Lance (2/4) · 1.5× Rapid). - Selectable Spell Cast Speed Tiers (
1× Swift,1.5× Rapid,2× Blitz): TapTon the wheel (or click the speed buttons in the top bar) to choose how fast your ritual slider moves—and how fast the Osu! target circles shrink on your opponent's body:
| Cast Speed Tier | Ritual Slider Duration | Enemy Osu! Ring Windup | Stagger Between Rings | Damage Multiplier |
|---|---|---|---|---|
| 1× Swift | 2.20 s / step |
1.45 s |
0.65 s |
×1.00 |
| 1.5× Rapid (Default) | 1.45 s / step |
1.05 s |
0.48 s |
×1.15 |
| 2× Blitz | 0.95 s / step |
0.76 s |
0.36 s |
×1.30 |
- Disjoint (Staggered) Osu! Body-Part Rings: Every offensive spell spawns 2 to 3 Osu!-style shrinking target circles locked onto random locations on the defender's projected body pose (
#1 HEAD,#2 L ARM,#3 R ARM,#4 CORE) with disjoint, staggered start and impact timers. Each ring locks onto your body part at the exact millisecond its individual timer begins—so you cannot clear all of them with a single early movement; you must dodge or parry Ring#1, then#2, then#3in sequence. - Simultaneous Weaving & Defense: You never stop casting to defend. Move the targeted body part out of each shrinking circle (or raise your right arm, shake the glove, or tap
Tto Parry the next closing ring for 70% damage reduction) while continuing to weave your own spell ritual withB1,B2, andSwing.
| Layer | Stack | Responsibilities & Latency Optimizations |
|---|---|---|
Glove Firmware (firmware/enchanted_glove) |
Arduino C++ (WiFiS3, rgb_lcd, Wire) |
Reads digital pins (D3/D7, D4, D8), rotary ADC (A0), and I2C accelerometer (LIS3DH / ADXL345 / MMA7660) at 40 Hz; streams compact JSON over UDP :4211; steps non-blocking piezo melodies and LCD pages on :4210. |
Glove & Co-op Hub (firmware/glove-hub.ts) |
Node.js (zero external deps, raw UDP + WebSocket) | Bridges UDP :4211 to WebSocket :8765 with socket.setNoDelay(true) (TCP_NODELAY), manages exclusive per-player glove claims, filters 40 Hz sensor streams per owner so secondary laptops only receive their own glove's frames, and relays Co-op & Duel packets. |
Game Client (client/) |
React 19 · Vite 6 · Zustand · Motion · MediaPipe | Runs the visual novel, 12-spell radial wheel, timed ritual engine, Web Audio synthesized spell SFX, MediaPipe Pose Landmarker, zero-re-render SVG Osu! defense overlay, and in-memory HTMLImageElement.decode() asset preloader. |
Story & Combat Server (server/) |
Express · Socket.IO | Serves the production client bundle with immutable asset caching (Cache-Control: public, max-age=86400, immutable), hosts 4-letter story room codes, and runs the round-based combat engine for /debug/server. |
Shared Contracts (packages/shared) |
TypeScript | Shared pose landmark indices, calibration thresholds, buzzer patterns, and Socket.IO payload types. |
Requirements: Node >=22 and pnpm >=10. The game is 100% playable with or without the physical Arduino gloves.
pnpm installEvery start script launches both the Game Server and the Glove Hub together in a single terminal (Ctrl+C cleanly stops all processes):
# Development mode: Vite client (:5173) + Game Server (:3001) + Glove Hub (:8765 / UDP :4211)
pnpm dev
# Production demo mode: builds client/dist and launches Game Server (:3001) + Glove Hub (:8765)
pnpm demo
# Fast start: launches Game Server (:3001) + Glove Hub (:8765) using the existing build
pnpm start- Copy
firmware/enchanted_glove/wifi_secrets.example.htofirmware/enchanted_glove/wifi_secrets.hand setWIFI_SSIDandWIFI_PASSto your Wi-Fi hotspot (enable 2.4 GHz / Maximize Compatibility on iPhone hotspots). - Flash each Arduino Uno R4 WiFi glove with its hardware variant and unique ID:
cd firmware ./flash.sh v4 # Glove 1 (LCD v4, Touch on D7) ./flash.sh v2 2 # Glove 2 (LCD v2, Touch on D3)
- On the host laptop, run
pnpm demo(orpnpm dev). The hub prints its LAN WebSocket address on startup. - On the second laptop, open the host's LAN URL with the
?hub=parameter:http://<host-laptop-ip>:3001/?hub=ws://<host-laptop-ip>:8765 - Click Preload game in the bottom-left corner of the title screen on each laptop to download and pre-decode all scene art, audio, video, and MediaPipe WASM/model files into RAM before playing.
(To test multi-glove features without physical boards, run pnpm --dir firmware hub:simulate to spawn two simulated Wi-Fi gloves.)
pnpm typecheck
pnpm testAll engineering and hardware diagnostic tools live under /debug:
| Route | Diagnostic Lab |
|---|---|
/debug |
Command center & route index |
/debug/hardware |
Live 40 Hz glove telemetry, interactive Grove Wiring Map (auto-detects misplaced pins and I2C addresses), LCD text/RGB tester, and software glove simulator |
/debug/vision |
Webcam MediaPipe pose calibration, Osu! shrinking body-part ring tester, whole-body strobe blasts, and the 15-wave Survival Gauntlet |
/debug/combined |
Side-by-side physical glove + live webcam pose integration testbed |
/debug/audio |
Zero-API neural narrator voice lab (Kokoro-82M ONNX, Edge Neural TTS, macOS say) + Web Audio DSP FX rack |
/debug/server |
Dual-seat multiplayer combat simulator against the authoritative Socket.IO server |
.
├── client/ React 19 + Vite 6 frontend
│ ├── public/art/ Pixel art scenes, spellbearer & wolf sprites, boss MP4 clips, particles
│ ├── public/audio/ Original soundtrack, rain ambience, and combat SFX
│ └── src/
│ ├── combat/ 12-spell catalogue, timed rituals, battle store, status effects, boss AI
│ ├── duel/ Real-time PvP & AI speed duel arena, speed tiers, staggered Osu! rings
│ ├── glove/ Glove session provider, menu navigation, radial spell wheel & ritual UI
│ ├── hardware/ WebSocket hub client, wiring map diagnostics, Web Serial & simulator
│ ├── vision/ MediaPipe PoseLandmarker service, torso/dodge classifiers, survival gauntlet
│ ├── net/ Two-laptop Co-op relay link, room store, in-memory decoded image preloader
│ └── ui/ Visual novel scenes, Wolf & Gatekeeper stages, HUD, synthesized spell VFX
├── firmware/ Arduino Uno R4 WiFi sketch (enchanted_glove.ino), flash.sh, and glove-hub.ts
├── server/ Express + Socket.IO server, room service, and round-based combat engine
├── packages/shared/ Shared TypeScript contracts and constants
└── docs/ Architecture diagrams, hardware photos, and combat design reference
Spell particle masks by Kenney. Pixel fonts: Pixelify Sans, Silkscreen, and VT323 (OFL).














