Infinite Realms: Protocol Awakening
Inspiration
- We grew frustrated with playing standard RPGs where "open worlds" felt empty and "generic plots" offered no real surprises.
- The monotony of NPCs repeating the same three lines of dialogue inspired us to break the cycle.
- We realized that Large Language Models (LLMs) could solve this problem by acting as an infinite, creative Dungeon Master.
- We wanted to replace boring, pre-written scripts with a game where the plot is generated in real-time, ensuring no two playthroughs are ever the same.
What it does
- Infinite Realms is a mobile-first, generative RPG where your actions instantly update a visual dashboard, rather than just generating text in a chat window.
- The Architect (AI Avatar): You face off against a fully animated, reactive AI system admin that "breathes" when idle and pulses red when angry.
- Real-Time Visual State: If the AI narrates that you found a "Glitch Key," the game instantly populates your inventory grid with that specific item icon.
- Procedural Mapping: The game tracks your movement coordinates $(x, y)$ and draws a map of the facility in real-time, revealing new rooms as you explore the "Fog of War."
- Voice Command: Players can speak actions like "Hack the door!" via Deepgram, making the interaction feel like a fluid conversation.
How we built it
- Replit Integration: We used Replit to rapidly scaffold our Next.js 15 frontend, allowing us to build, test, and deploy the PWA (Progressive Web App) environment instantly without complex local configuration.
- The "Dual-Stream" Engine: We engineered a System Prompt that forces the LLM to output a strictly structured JSON object: $$R = { \text{"narrative"}, \text{"inventory_update"}, \text{"map_vector"} }$$
- State Management: We used Zustand to hold the global game state, ensuring that when the JSON data arrives, the React components (Inventory/Map) update instantly.
- Visuals & Animation: We used Framer Motion for the complex "breathing" animations of the God Avatar and Tailwind CSS for the "Cyberpunk Glitch" aesthetic.
- Vector Logic: The engine calculates player position $P_{t+1}$ using vector addition based on text input (e.g., "North"): $$P_{t+1} = P_t + \vec{d} \quad \text{where } \vec{d} \in {(0,1), (0,-1), ...}$$
Challenges we ran into
- The "Hallucination" Problem: The AI initially struggled to remember player location, so we injected a compressed "World State" summary into the context window on every turn.
- Latency vs. Immersion: Waiting for text generation breaks the game flow, so we implemented "optimistic UI updates" and a "Thinking Avatar" animation to turn the API latency into a suspenseful gameplay mechanic.
- JSON Strictness: Forcing the LLM to adhere to our specific item schema required extensive "Few-Shot Prompting" to ensure items like "Zero-Day Exploit" were formatted correctly for the UI.
Accomplishments that we're proud of
- The "Living" Map: Successfully creating a $5 \times 5$ grid that updates and reveals new nodes purely based on natural language input was a major technical win.
- The Vibe: We nailed the "High-Tech Horror" aesthetic; the glitchy text effects and dark UI make it feel like a premium indie game rather than a standard hackathon project.
- Mobile Responsiveness: The app feels native on mobile devices, with smooth "Drawer" navigation for inventory management.
What we learned
- Prompt Engineering is Backend Engineering: We learned that writing a robust system prompt is just as critical as writing SQL queries when building AI-native apps.
- UX is King: Even with a smart AI, the experience falls flat without fluid animations and sound design to carry the user through the wait times.
What's next for Infinite Realms
- Generative Backgrounds: Integrating a fast model (like SDXL Turbo) to generate unique background images for every room in seconds.
- Gamified debugging: We integrated "glitch" minigames where players must find and fix errors in the simulation's code to progress, directly training their real-world debugging and problem-solving skills.
- Multiplayer Mode: Allowing two users to drop into the same "Server" instance to try and hack The Architect together.
- Custom Campaigns: Enabling users to prompt their own worlds (e.g., "Avengers endgame theme") and having the game engine adapt the UI theme automatically.
Built With
- expo-sdk
- node.js
- openai
- postgresql
- react-native
- replit
Log in or sign up for Devpost to join the conversation.