Inspiration
We were inspired by the classic tension of The Oregon Trail—a game where every resource counts and every disaster feels personal. However, static event decks eventually become predictable. We wanted to see if we could use Gemini 3 to create a "Living Trail" where every crisis is authored live, specifically tailored to the player's current state. Our goal was to prove that LLM-driven narratives don't have to be "loose" or "hallucinatory"; they can exist within a strict, deterministic game engine to provide a reliable yet infinitely varied player experience.
What it does
- Travel 2,000 miles while managing food, water, ammo, wagon health, and party morale.
- Dynamic Events: Gemini 3 (
gemini-3-flash-preview) drafts events; resolutions are requested only when you pick a choice. - Deterministic Core: Strict JSON schemas, item catalog checks, and invariant enforcement gate every model output.
- Resilient UX: Async prefetch + cancellation + timeout logic ensures a non-blocking UI and instant fallback.
- Debug View: Logs event IDs, latency, and token counts for full judge transparency.
How we built it
- Engine: Python 3.12 with Pygame CE for 60 FPS rendering; background thread for Gemini calls.
- AI Stack:
google-genaiSDK +pydantic v2schemas to validateEventDraftandEventResolution. - Reliability:
FallbackDeckguarantees offline play; a robust state machine enforces determinism. - Tooling:
uvfor environment management andpytestfor validation paths.
Challenges we ran into
- Predictable Latency: Solved with prefetch logic, a 5s timeout, and an ESC-to-fallback feature to ensure the game never stalls.
- Safety and Continuity: Schema constraints and local catalog checks reject unsafe or anachronistic outputs.
Accomplishments that we're proud of
- Exclusive Gemini 3 integration verified in both the code and documentation.
- Fully implemented Requirement 10 latency resilience strategy.
- Playable demo even with no API key; deterministic tests remain green.
What we learned
- Schema-first prompts plus local validation make LLM gameplay reliable and trustworthy.
- Prefetch + cancellation is the most effective way to hide LLM latency in a real-time loop.
What's next
- Chapter events on
gemini-3-pro-previewfor deeper narrative arcs. - Prefetching choice resolutions to erase remaining wait times.
Built With
- dotenv
- gemini-3-api
- google-genai
- pydantic
- pygame-ce
- pytest
- python
- rdflib
- uv
Log in or sign up for Devpost to join the conversation.