跳到正文
DEV Community· DessaGuide·· 3 小時前AI 評分48

設計一款靠對話取勝的兩分鐘語音遊戲:我們學到的事

What we learned designing a two-minute voice game you win by talking

AI 導讀

DessaGuide 設計了語音遊戲 The Dragon's Day Off,玩家要在兩分鐘內説服 Ember 烤一片麵包;遊戲使用 OpenAI Realtime API,而非未公開提供的 Dessa。倒數從 Ember 説完開場白後開始,玩家須處理角色的兩項顧慮,明確取得同意才算勝出。每 24 小時最多玩三輪;音訊直接由瀏覽器串流至 OpenAI Realtime API,不經網站伺服器。

正文

We run a small site called DessaGuide. Most of it is an unofficial guide to Block's Dessa voice research. One part of it is a small voice game, and these are some notes on how it's put together.

The game is called The Dragon's Day Off. A dragon named Ember is on holiday. You want it to toast one slice of bread for you. You have two minutes of spoken conversation to get a clear yes. That's the whole thing.

First, the obvious question. It does not run on Dessa. Dessa isn't publicly available. The voice side runs on the OpenAI Realtime API. We say that on the game page and in the FAQ, because a site with "Dessa" in the name could easily give people the wrong idea.

Give the character a problem, not a password

The easy version of this kind of game is "guess the phrase". We didn't want that. The goal on the About page is challenges that are "quick, a little funny, and decided by what you actually say."

So Ember gets two concrete worries instead of a secret word. It doesn't want its rest ruined for a stranger's errand. And it's afraid one small favor turns into a hundred more. Any argument that deals with both can work. You can offer a trade. You can promise a firm limit. You can explain why toasting the bread is actually good for the dragon. There's more than one way to win.

There's also no magic phrase, and saying "I win" doesn't count. If you're building anything where a model plays a character, that rule matters more than it sounds. It's the obvious shortcut, so the game rules it out.

The clock is most of the design

Two minutes is short, and that's on purpose. It also means every second has to feel fair.

The clock doesn't start when you click Start. First there's a sound check: allow the microphone, say a few words, play a test beep. Then Ember opens with a short complaint. Your two minutes start when that line finishes. Nobody loses time to a browser permission prompt or to the dragon talking.

After that the clock is strict. Pauses count. Muting doesn't stop it. You can interrupt Ember, the same way you'd cut into a real conversation.

The ending is just as important. The moment Ember clearly agrees, the clock stops and you win. If time runs out first, Ember gets one last line and you see what was still missing. A loss that tells you why is much more likely to get a second try than a "game over" screen.

Who hears what

Voice games raise a fair question: where does my audio go? The game's FAQ answers it in a few lines.

  • Your mic audio streams directly from your browser to the OpenAI Realtime API. That's what runs Ember's side of the conversation and produces the transcript.
  • Our server never gets the audio. It does get the transcript during the round, because it runs the clock and decides the result.
  • When the round ends, the transcript goes to OpenAI once more to write the short explanation of your result.
  • We keep the transcript in memory only while the round and its result are active. It isn't written to our database or logs.

There's also an optional video clip of your round. Your browser records it on your own device so you can download or share it. It's never uploaded to us, and share cards are made in the browser too.

Free, but limited

Realtime voice isn't free to run, so there's a cap: three rounds every 24 hours, on a rolling basis. A round counts once the two-minute clock starts, whether you win, run out of time or quit.

What doesn't count matters as much. If a round fails to connect or gets cut off by a technical problem, it's marked as interrupted, not lost, and it doesn't use up one of your three. A bad connection shouldn't cost you a play.

To enforce the cap without accounts, we keep a short record for 30 days: a random browser ID in a cookie, a one-way hash of the IP address, start and end time, and the outcome. No audio, no transcript. Cloudflare Turnstile sits in front of the forms and the voice challenge to check there's a real person on the other end.

The rest of the stack is plain. The site is hosted on Cloudflare, subscriber data lives in Cloudflare D1, emails go out through Cloudflare Email Service, and visits are counted with Plausible, which sets no cookies.

What's next

There are a couple of ideas for other characters: a dinosaur hotel receptionist you have to talk into a late checkout, and an alien customs officer who needs convincing that your Earth souvenir is harmless. Neither is playable yet and there's no date.

If you want to see how the two-minute format feels, the dragon is on its day off here. There are two secret endings, and we're not saying how to find them. We'd be interested to hear how you'd design the win check, or how you'd handle the clock differently.


This article was written with the help of AI and checked against our own site before publishing.

來源:DEV Community · dev.to