All projects

Bastionfall.

AI narration with validation and fallbacks

Backend developer in a team of three · November 2026

  • TypeScript
  • Next.js
  • Gemini API
  • Zod
Open live demo
Bastionfall gameplay showing the city, resource management, and an incoming Orc Host wave

Actual application screenshot

My contribution

I built the TypeScript game engine and integrated Gemini-generated events with Zod validation and fallback handling for a 100-day city-defense campaign.

  • TypeScript game engine
  • Gemini-generated events
  • Zod validation and fallbacks
  • Delayed consequences and difficulty simulations

The engineering challenge

The campaign combines AI-generated narrative with game rules and delayed consequences. Generated event data needs a validation boundary before the game uses it.

Implementation approach

Zod validation and fallback handling support the AI integration. The game engine manages campaign state and consequences in TypeScript, while Gemini supplies generated narrative events.

Validation & resilience

The project work included difficulty simulations, alongside validation and fallback handling. These are the implementation areas behind the campaign shown in the live demo.