Inspiration

Most of us met ancient Egypt in a textbook: a few photos of pyramids, a timeline, a list of pharaohs to memorise. But Egypt's story is about people: farmers reading the Nile's flood, crews hauling stone, scribes writing on papyrus. We wanted students to do those things, not just read about them.

VR lets you stand at the foot of the Great Pyramid. The web lets anyone with a headset or a laptop get there from a single link, with no app store and no install.

What it does

PastPort: Egypt is a WebXR history adventure covering 3,000 years of the Nile, from the first farming villages (about 5000 BCE) to Greek Alexandria (30 BCE). There are eight chapters, and in each one you learn by doing:

  • 🌾 Sow seed and cast a fishing net in a Nile village
  • 👑 Crown the first king of a united Egypt
  • 🔺 Pour water on the sand, then pull the rope with the crew to haul a pyramid block on a sledge
  • ⛏️ Dig silt out of a canal with a shovel
  • 🔥 Light braziers and shake a sistrum at Karnak
  • 📜 File scrolls in the library at Alexandria

The world reacts to you. Clay pots shatter when you throw them hard enough (an impact faster than \( v = 3.2\ \text{m/s} \)). Heavy things feel heavy: they hang lower in your hand, and the controller's vibration tells you how much they weigh.

🎣 An AI guide you can talk to

The fisherman is an AI-powered guide. Hold a button and ask him anything about ancient Egypt by voice:

  • Your words appear on screen as you speak.
  • He knows what you're holding or pointing at, so "tell me more about this" works for a cow, a pot or a crown.
  • He answers out loud, in character, in a few short sentences.
  • He politely steers off-topic questions back to ancient Egypt.

A training room teaches the controls first. Arrows on the ground lead you to each task, and the treasures you collect can be downloaded as STL files to 3D print.

♿ Accessible to all

Accessibility was part of the design from day one:

  • Captions and adjustable text size
  • Calm mode (softer sounds, smaller crowds, less glow) and reduced flashing
  • One-handed grabbing, and a gesture assist that does the shaking or rubbing for you
  • Scene descriptions that read out what's around you
  • Windows you can move and resize, like on the Quest home screen

How we built it

Layer What we used
Engine three.js and WebXR in a single HTML page (Quest Browser and desktop)
Worlds Built mostly in code, with PBR textures, HDRI skies and baked ambient occlusion so they run on a Quest 2
AI guide Claude Haiku, streamed through a Cloudflare Worker that keeps the API key on the server
Voice Workers AI: Whisper for speech to text, and a text-to-speech voice for the fisherman (the Quest Browser has neither built in)
Deployment GitHub Actions → Cloudflare Pages (the game) and Cloudflare Workers (the AI relay), with keys stored as repository secrets
Testing A simulated VR headset in the browser, with two Quest-style controllers, so we could test VR interactions without putting a headset on

The game has its own interaction system for grabbing, throwing, drop zones and two-handed tasks. Physical tasks read your real arm movement: on the sledge rope, for example, each pull back of about \( 25\ \text{cm} \) counts as one heave with the crew.

For performance we followed Meta's WebXR performance guide. On a Quest 2 running at 90 Hz, every frame has a budget of

$$ t_{\text{frame}} = \frac{1}{90\ \text{Hz}} \approx 11.1\ \text{ms} $$

for everything: game logic, both eyes and the shadows. To stay inside it, we draw the sky last so only its visible pixels get shaded, tuned texture filtering, used fixed foveated rendering, and set the frame rate explicitly.

Challenges we ran into

  • Making VR feel physical. Pulling a rope hand over hand, digging with a shovel and throwing a net each needed its own motion detection, tuned until real arm movements counted and nothing double-counted.
  • Voice on the Quest. The Quest Browser has no speech recognition or text-to-speech, so we built both through our own relay.
  • Keeping the API key secret in a public web app. The game never sees the key: it only talks to our relay.
  • Too many voices at once. Characters sometimes spoke over each other, so we made sure only one character talks at a time.
  • An optimisation that backfired. One performance change made the scene look jittery in the headset. The causes were a refresh rate that dropped on its own, shadows updating every third frame and guide arrows hopping as you walked. We fixed it by keeping the headset at 90 Hz, updating shadows every frame and pinning the arrows to the path. We also snapped the shadow area to whole shadow-map texels:

$$ \Delta = \frac{2 \times 32\ \text{m}}{1024\ \text{texels}} = 6.25\ \text{cm per texel} $$

so shadow edges stop shimmering as you move.

Accomplishments that we're proud of

  • An AI character who understands what you're holding and pointing at, talks back out loud and never leaves ancient Egypt
  • Eight playable chapters, each built around doing things rather than reading
  • Accessibility features woven through the whole game, not added at the end
  • It all runs in a browser on a Quest 2, from one link

What we learned

  • Interaction design in VR is mostly about forgiveness: generous grab ranges, assists and clear feedback matter more than perfect realism.
  • A short spoken answer from a character beats a paragraph of text on screen.
  • Performance work has to be checked on the device you ship to.
  • Accessibility features like captions, calm mode and gesture assist help everyone, not just the players they were designed for.

What's next for PastPort

  • [ ] Playtests with classrooms, and lesson plans for teachers
  • [ ] More civilisations: Mesopotamia, Rome and the Indus Valley
  • [ ] Multiplayer field trips, where a class explores together and a teacher guides
  • [ ] Hand tracking without controllers
  • [ ] More languages for the guide and the captions

Play it now: pastport.pages.dev

Built With

  • 3d-printing
  • anthropic-api
  • claude
  • claude-haiku
  • cloudflare-pages
  • cloudflare-workers
  • cloudflare-workers-ai
  • deepgram-aura
  • github-actions
  • html5
  • javascript
  • kokoro-tts
  • meta-quest
  • node.js
  • poly-haven
  • stl
  • three.js
  • web-audio-api
  • web-speech-api
  • webgl
  • webxr
  • whisper
  • wrangler
Share this project:

Updates

Submission history