Inspiration

Traditional role-playing games often rely on predefined dialogue, scripted encounters and predictable quest sequences. We wanted to explore something different: a game where artificial intelligence actively participates in the experience, responds to player actions and creates more dynamic interactions.

This inspired us to develop VEILBREAK, an anime-inspired supernatural fantasy RPG that combines on-device and cloud AI to create a more responsive and immersive gaming experience.

Our vision was to bring together the atmosphere of dark fantasy RPGs and the possibilities of hybrid AI, creating a world where every interaction could lead to something unexpected.

What it does

VEILBREAK takes place in Ashveil Settlement, a dark fantasy world threatened by dimensional rifts that release supernatural creatures.

Players take the role of Hunters trained to investigate these rifts and protect the settlement.

The project features two complementary AI systems:

  1. AI Game Master — Cloud Intelligence

Powered by Gemini 3 Flash through Firebase AI Logic, the Game Master generates contextual narratives, threat assessments, world events, objectives and recommended actions.

When a Hunter investigates the Rift Altar, the AI analyses the game context and generates a structured decision that is validated before being displayed in the game.

  1. Tactical Companion — Hybrid Intelligence

The Tactical Companion uses Firebase AI Logic with InferenceMode.PREFER_ON_DEVICE.

It attempts to process player actions using Chrome's built-in on-device AI capabilities. When local inference is unavailable, it can fall back to cloud inference.

We have successfully tested both execution paths:

ON_DEVICE: AI inference runs locally on the user's device.

IN_CLOUD: AI inference runs through Firebase's cloud backend.

The actual inference source is detected and displayed in the game HUD.

  1. Supernatural RPG Experience

VEILBREAK's gameplay development includes:

An atmospheric Ashveil Settlement environment.

An original anime-inspired Dark Armored Knight called Shadow Vanguard.

Third-person 3D character movement.

Sword attack animations.

A supernatural Rift Altar.

AI-driven encounter and enemy-combat prototypes.

Dark fantasy environments, magical effects and cinematic lighting.

How we built it

We built VEILBREAK using React and TypeScript for the application architecture and interface.

Firebase AI Logic forms the core of our hybrid AI architecture. Gemini 3 Flash powers the cloud-based Game Master, while Chrome's built-in AI capabilities enable local inference through Firebase AI Logic.

We implemented InferenceMode.PREFER_ON_DEVICE to prioritize local inference and support cloud fallback when on-device execution is unavailable.

Three.js is used for the 3D environment and character development, while Phaser 3 powers the original gameplay and encounter prototype.

Firebase App Check is integrated to protect AI requests.

An important architectural decision was separating AI-generated decisions from game execution. The Game Master generates structured responses, which are validated before being used by the application.

Challenges we ran into

One of our biggest challenges was implementing genuine hybrid inference instead of simply switching between two different AI interfaces.

We had to ensure that the on-device model initialized correctly after user interaction, that the application detected the actual inference source, and that cloud fallback worked when local inference was unavailable.

Another challenge was integrating Firebase App Check with Firebase AI Logic while maintaining a reliable request flow.

We also encountered difficulties connecting asynchronous AI responses to gameplay. Initially, the Rift Altar displayed predefined content even though Gemini was generating its own decisions. We addressed this by connecting the validated AI response to the game's interaction interface.

As the project evolved, transitioning from a 2D gameplay prototype to a 3D RPG experience introduced additional challenges involving rendering, character movement, animation and preserving existing AI functionality.

Accomplishments that we're proud of

We are particularly proud of successfully demonstrating both sides of hybrid AI inference within an interactive gaming experience.

Our major accomplishments include:

Successfully integrating Firebase AI Logic into an interactive RPG.

Implementing a Gemini-powered AI Game Master using Gemini 3 Flash.

Successfully executing genuine Chrome on-device AI inference.

Implementing and verifying automatic cloud fallback.

Detecting and displaying the actual ON_DEVICE and IN_CLOUD inference sources.

Connecting AI-generated narratives and structured decisions to the game interface.

Developing an original anime-inspired Shadow Vanguard character.

Building a 3D Ashveil Settlement environment and combat prototypes.

Implementing an AI-driven Rift Encounter prototype with enemy behaviour, combat mechanics and progression.

Most importantly, we demonstrated that on-device and cloud AI can complement each other within a single interactive application.

What we learned

Throughout development, we gained practical experience with Firebase AI Logic, Gemini models, Chrome's built-in AI capabilities and hybrid inference architecture.

We learned how to initialize on-device models, handle cloud fallback, identify inference sources, validate structured AI responses and connect asynchronous AI operations to an interactive application.

We also explored 3D game development with Three.js, character modelling, animation, movement systems and game-engine integration.

One of our biggest takeaways was that hybrid AI is not simply about using multiple models. It is about choosing an appropriate inference path while maintaining a consistent experience for the user.

What's next for VEILBREAK: Hybrid AI RPG

VEILBREAK is an evolving project, and we envision expanding it into a more complete AI-powered RPG.

Our future plans include:

Fully synchronized real-time multiplayer sessions.

Additional Hunter classes with unique abilities.

More intelligent enemy behaviour and advanced combat mechanics.

AI-generated dynamic quests and NPC conversations.

Inventory, equipment and weapon progression.

Persistent player statistics, Hunter ranks and achievements.

Larger explorable environments and more dimensional rifts.

More interactive world events powered by the AI Game Master.

Our long-term vision is to create a world where AI does not simply narrate the adventure but actively helps shape the experience.

Master the Veil. Or be consumed by it.

Built With

Share this project:

Updates

Submission history