💡 Inspiration
The inspiration for Mythara AI comes from a desire to combine the tactile, territorial control mechanics of Ingress with the creative depth of Lovecraftian cosmic horror and myth-weaving. We wanted to explore how generative AI could step beyond simple chatbots to act as a living, breathing Game Master, turning player territorial battles into permanent, canonized mythology.
🔮 What It Does
Mythara AI is a collaborative mythology engine and territory conquest simulator:
- Weave Deities: Players write natural-language concepts to summon customized gods. The AI structures these into a deterministic "Deity DNA" schema with cosmic alignments (Creation, Destruction, Chaos) and stats.
- 3D Atlas Leyline Map: A dynamic, real-time 3D canvas (Three.js) displays leyline networks and portals. Weaved deities materialize as alignment-colored spinning crystals that orbit their portals.
- Leyline Conquest (Ingress Loop): Players select portals on the 3D map to open the Portal Action Sheet, where they can consume Exotic Matter (XM / Cosmic Essence) to Hack portals for items, Deploy divine anchors (resonators) to claim nodes, Recharge anchors to prevent energy decay, and Fire bursters to neutralize enemy nodes.
- Establish Fields: Link three claimed portals in a triangle to establish a Control Field, capturing Mind Units (MU) to secure faction dominance.
- Oracle Prophecy Quests: Players can query the RAG Oracle for quests (e.g. by typing
questormisi). The Oracle bestows custom daily tasks (Hack, Deploy, Recharge, Link) tracked inside the Quest Codex that reward XP and Essence upon completion. - Divine Alchemical Forge (Crafting): Inside the Weaver Pack, players can forge high-tier items: combine 3 Ember Bursters into 1 Prismatic Burster (deals 100 HP damage to all enemy anchors) or 2 Chargers into 1 Resonance Core (100% full anchor recharge).
- Fates Court & Archives: Players vote to canonize high-impact events into permanent world lore, which is stored and indexed in a vector database for semantic search via the RAG-powered Oracle Chatbot.
🛠️ How We Built It
- Frontend & Framework: Built using Next.js 16.2 (App Router, Turbopack) and React 19 for server-rendered page efficiency and component performance.
- Real-Time Database Sync: Integrated AWS Amplify Gen 2 and AWS AppSync (GraphQL) to write/read game states from Amazon DynamoDB with sub-second, real-time synchronization.
- Lore & RAG Database: Deployed Amazon Aurora Serverless v2 PostgreSQL using Drizzle ORM. It uses
pgvectorto store embeddings of historic chronicles to power the RAG Oracle Chatbot. - Interactive 3D Graphics: Programmed a web-native Three.js renderer that handles particle-flow leylines, custom geometries, orbital physics, and collision raycasting.
- Synthesized Soundscape: Implemented a procedural sound engine using the HTML5 Web Audio API to synthesize cosmic drone hums and retro-chime audio feedback without loading heavy external sound files.
- AI Inference Engine: Connected to the Google Gemini 2.5 Flash API to generate structured deity profiles, events, and answer context-aware RAG lore inquiries.
🚧 Challenges We Ran Into
- Autoplay Audio Restrictions: Modern browsers block Web Audio API sound engines until user interaction. We resolved this by building a floating HUD volume overlay that gracefully unblocks and manages audio tracks on first click.
- Aspect-Ratio Grid Collapses: Rendering relative 3D canvas interfaces alongside dynamic grid cards caused layout height collapses. We solved this by refactoring card layouts into a flexible, responsive accordion-based Divine Codex List.
- Deity Marker Overlapping: Because multiple deities can occupy a single portal, positioning markers with a static offset caused them to overlap perfectly and disappear. We solved this by calculating individual orbital offsets (speed, radius, initial angle) using 3D trigonometry so every deity has a unique orbit.
- Component State Dependency Sequencing: Adding real-time tracking for Oracle quests caused Next.js build-time type errors due to block-scoped callbacks being used before their declarations. We resolved this by auditing hook structures and reordering declaration positions so dependencies are initialized strictly before their registrations.
🎉 Accomplishments That We're Proud Of
- Zero-Asset Audio Synthesis: The entire soundscape (ambient космик hum, hover triggers, click swept saws, completion indicators) is generated dynamically via code using raw oscillator nodes and filters.
- Sub-Second Multi-Client Sync: Achieving real-time portal hack, deployment, and link state sync across browsers via AppSync subscriptions.
- Aesthetic Premium Dark Mode: A unified glassmorphism Abyssal design system leveraging tailored gradients, shadows, and Cinzel typography.
📖 What We Learned
- How to merge the low-latency document syncing of Amazon DynamoDB (hot game loop state) with the relational consistency and vector search of Amazon Aurora PostgreSQL (historic lore archives) in gaming.
- The intricacies of building clean, non-blocking Three.js graphics and Web Audio synths within React 19 concurrent rendering lifecycles.
🚀 What's Next for Mythara AI
- AR Geolocation Mode: Integrating the browser Geolocation API to allow players to claim portals based on their actual physical coordinates in the real world.
- Active Combat Phase: Turn-based or real-time battle stages where weaved deities fight enemy sentinels guarding contested portals.
- Multiplayer Guilds: Allowing Weavers to form sub-sects, pool cosmic essence, and construct multi-layered global faction shields.
Built With
- amazon-web-services
- amplify
- appsync
- aurorapostgres
- drizzle
- dynamodb
- next.js
Log in or sign up for Devpost to join the conversation.