DEV Community

Justin
Justin

Posted on

GridyPig Quiz Clash: Turning Prompts into Playable Multiplayer Games with Hermes Agent

Hermes Agent Challenge Submission: Build With Hermes Agent

This is a submission for the Hermes Agent Challenge

What I Built

I built GridyPig Quiz Clash, an AI-assisted quiz creation and multiplayer game mode inside GridyPig, a multi-tenant real-time game platform.

The problem I wanted to solve is simple: creating a good quiz for an event, launch party, classroom, community night, or team activity is slow. You have to think of questions, balance difficulty, write answer options, validate the correct answer, format everything, and then still turn it into something people can actually play together.

GridyPig Quiz Clash turns that into a much faster flow:

  1. A creator describes the quiz they want in plain English.
  2. Hermes Agent helps generate structured questions, options, correct answers, explanations, and difficulty levels.
  3. The creator can edit, collapse, import, dictate, or save questions into a reusable quiz bank.
  4. The quiz becomes a live multiplayer room with turn handling, scoring, inactivity countdowns, and final standings.

The result is not just "AI generated text." It is an agent-assisted path from idea to playable game.

Demo

Demo link: https://www.loom.com/share/d5f3b92457fa489cb5310cf69bfd901f

Recommended demo path:

  1. Open a tenant workspace, for example https://justin.gridypig.com.
  2. Create or sign in as a player/creator.
  3. Start a new game and choose Quiz Clash.
  4. Use the AI quiz builder prompt, for example:
Create a fun 8-question quiz about Nigerian tech startups for a launch party. Mix simple and tricky questions.
Enter fullscreen mode Exit fullscreen mode
  1. Show Hermes-generated questions appearing in GridyPig's editable quiz format.
  2. Save the quiz set and open a live room.
  3. Join with another player or show the simulation/live room flow.
  4. Play through a few turns and show the final leaderboard.

Screenshots/video placeholders:

  • Game landing page
    Game landing page

  • Quiz Builder with Hermes Agent
    Quiz Builder with Hermes Agent

Code

Repository: github.com/cjustinobi/greedy-pig

Key areas:

  • Hermes Cloud Run adapter: deploy/hermes/
  • Backend quiz generation service: apps/backend/src/quiz/quiz-ai.service.ts
  • Quiz APIs and quiz bank: apps/backend/src/quiz/
  • Frontend quiz setup UI: apps/frontend/src/components/quiz/
  • Real-time game room: apps/frontend/src/components/game/

My Tech Stack

  • Frontend: Next.js, React, Tailwind CSS, Framer Motion
  • Backend: NestJS, Prisma, PostgreSQL/Supabase
  • Realtime: Socket.io
  • Agent Runtime: Hermes Agent behind an OpenAI-compatible Cloud Run adapter
  • Infrastructure: Google Cloud Run, Docker, Vercel, GitHub Actions
  • Product Layer: Multi-tenant workspaces, PWA support, referral system, reusable quiz bank, wallet-aware game modes

How I Used Hermes Agent

Hermes Agent powers the AI quiz generation layer. I wrapped Hermes in a small Cloud Run service that exposes an OpenAI-compatible /v1/chat/completions endpoint. That allowed the existing GridyPig backend to treat Hermes like a pluggable AI provider while still keeping provider details outside the game engine.

The integration has three important parts.

1. Prompt-to-Playable Structured Output

GridyPig does not need a paragraph of generated text. It needs valid game data.

Hermes receives the creator's intent and is instructed to return a strict quiz schema:

{
  "questions": [
    {
      "prompt": "Question text",
      "type": "MULTIPLE_CHOICE",
      "options": ["A", "B", "C", "D"],
      "correctAnswers": ["A"],
      "difficulty": "MEDIUM",
      "explanation": "Why the answer is correct"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

The backend then validates and normalizes the output before it ever reaches gameplay. If a question is malformed, it is rejected instead of silently breaking the room.

2. Agent Adapter Built for Production Constraints

Hermes Agent runs as its own Cloud Run service. During testing I hit real deployment issues: container startup, Cloud Run port binding, long-running agent loops, and noisy CLI output around JSON.

I solved this by building a dedicated adapter that:

  • Listens on Cloud Run's PORT correctly.
  • Secures requests with a shared secret between the backend and Hermes service.
  • Uses ephemeral runtime state so the agent does not hang on Cloud Storage/FUSE SQLite WAL files.
  • Bounds generation to a single quiet chat turn for predictable response time.
  • Extracts clean quiz JSON even when the CLI returns session noise or markdown wrappers.

That adapter made Hermes usable as a real service, not just a local experiment.

3. Human-in-the-Loop Creation

I intentionally kept the creator in control. Hermes accelerates quiz creation, but the creator can still:

  • Edit every generated question.
  • Choose predefined or custom categories.
  • Pick question type: yes/no or multiple choice.
  • Use voice dictation for questions and options.
  • Import questions from a template.
  • Save questions into a reusable quiz bank.
  • Search and reuse existing quiz questions later.

This matters because a great quiz is partly AI generation and partly human taste. Hermes gets the creator 80% of the way there, then GridyPig gives them tools to polish the final game.

What Makes It More Than a Quiz Generator

The generated quiz becomes part of a full multiplayer game system:

  • Turn-by-turn Quiz Clash: players answer in sequence and the highest score wins.
  • GridyPig streak mode: correct answers can keep a player in control, preserving the push-your-luck feel of the original game.
  • Server-side validation: scoring and turns are enforced by the backend, not trusted to the browser.
  • Inactivity countdowns: if a player stalls, the room warns everyone and passes the turn safely.
  • Final standings: the game ends with a leaderboard showing how each participant performed.
  • Tenant workspaces: each business/community can run its own branded games.
  • Reusable quiz bank: creators can build from scratch or reuse questions over time.

What I Learned

The biggest lesson was that agentic features need product boundaries.

It is tempting to let an agent do everything, but a real-time game needs deterministic behavior. Hermes is excellent at helping create the content, but the platform still needs strict validation, typed payloads, server-side scoring, and predictable fallback behavior.

So the winning architecture became:

Creator intent -> Hermes Agent -> Structured quiz draft -> Backend validation -> Human editing -> Live multiplayer game
Enter fullscreen mode Exit fullscreen mode

That separation keeps the AI useful without letting it destabilize the game loop.

What's Next

I want to expand the Hermes layer from quiz generation into a full game-master assistant:

  • Suggest better distractor options for weak multiple-choice questions.
  • Rebalance difficulty based on historical answer rates.
  • Generate themed quiz packs for events, product launches, schools, and community nights.
  • Help creators convert reusable quiz-bank content into polished game sessions.
  • Create post-game summaries that explain what players struggled with and what they learned.

GridyPig started as a dice game. With Hermes Agent, it is becoming a creator-powered game platform where anyone can turn an idea into a live multiplayer experience.

Top comments (0)