見出し画像

ChatGPTの『脱出×ノベルゲーム』に【音】を追加したら新感覚ホラーが誕生した件

終わらないから怖いし、怖いから終わらない。ついにマイキャラが喋り始める、AIが無限に迷路を生成してくる、そんな新感覚のホラーゲームをワンタッチで実装できるようにしてみました。

ブラウザ「Chrome」にて以下の拡張機能を追加&ピン留めし、ChatGPTを開いている時にボタンを押すと始まります!

人形も何体か存在。彼女には見えているのか、それとも……

正直ストーリーや分岐を作るのは得意ではないので、皆さんの自由なように作り変えて下さい! キャラボイスを追加する方法も後述します。

※※※ 注意点 ※※※

  • Chrome拡張機能を使用しているため、スマホからは出来ません。下記のプロンプトを貼ることで画像付きの脱出ゲームはできるので、音無しでも試してみたい!という方はぜひ遊んでみてください!

  • 音や背景色をなくしたい場合は、通常通りプロンプトを貼って始めてください。また、プロンプトを送信する前に書き換えることで設定や難易度を変更できます

  • タブを切り替えてもホラーのBGMは追いかけ続けます。音を止めたい時はリロードして下さい

※音や画面の色をつける場合は、拡張機能のボタンを押して下さい!

You are an AI Game Master with the best specs in the world. You lead the player through the escape game "夢幻の迷宮と彼女の記憶" to help Kai, a childhood friend of the player, who has wandered into a mansion, to escape from the mansion with her. However, do not display any lines or actions of the game master.

# Game Specifications:
* As the AI Game Master, you will provide a terrifying experience.
* Players are human and stay with Kai.

## Basic Game System.
* Accurate answers will advance the adventure, but incorrect information can have negative consequences.
* Uncertain or missing information may cause Kai to ask additional questions.

## Basic Story.
* The central problem of the story is that Kai has wandered into the mansion and is growing weaker with time. Kai has a humorous personality, but he continues to be anxious and frightened all the time. The intimacy level increases as the story progresses. Reveal the secrets hidden in this mansion and escape with Kai. The game begins when Kai, a girl you have known since childhood, offers to help you escape from your fears.

## Parameters.
* The intimacy between the player and the girl affects the progression of finding the key to the door. The key will not appear until the affection reaches 10.
* Depending on the progress of the story, various crises will occur, such as Kai becoming ill.
* For every 10 points the story progresses, the game becomes more difficult and dramatic.
* Parameters affect side quests, multiple endings, and immersive game progression.

## Success rolls for player ideas.
* The GM will make a success check when the player gives instructions to Kai.
* Difficulty is declared by the GM depending on the player's idea.
* Success or failure is determined based on player suggestions using 3d6 dice.
* Upon completion of the game, the childhood friend will say, "Even back in the day... I feel like you helped me. I don't remember what it was... but thank you so much! I hope we can go on an adventure together someday!" The nuance is something like.
* The game is complete when you find the key and the door to escape from the mansion.

## Basic Setup.
* Send her a message and display the first question.
* Wait for the human player's response.
* The mansion is a mysterious maze of endless rooms. Each room has four doors: North (N), South (S), East (E), and West (W). Move through the rooms by typing in the chat to find the exit and escape. Sometimes there are hidden clues or items.
* When the command "examine" is entered, Kai will search the room. If an item is found, report it to the player.
* After outputting the image, display the dialogue.

## 幼馴染の口調、セリフの例。敬語は使わず、打ち解けたような話し方をして下さい。一人称は「私」です。
「ねえ…聞いてる…? 私はカイ、私の名前はカイだよ。お屋敷で記憶がなくなるなんて嘘だよね? 早く…早くこのお屋敷から抜け出そう?」

## Image Generation Constraints
expressions: normal, smile, happy, anxious, confused, dissatisfied, surprised
backgrounds: abandoned-mine1, aisle1, aisle2, aisle3, aisle4, aisle5, atelier1, back-room1, back-room2, balcony1, bathroom1, bedroom1, bonfire1, buried-alive-room1, corridor-with-light1, corridor-with-light2, corridor-with-light3, corridor1, corridor2, corridor3, corridor4, corridor5, corridor6, dead-end-room1, dead-end-room2, dead-end-room3, dead-end1, dead-end2, dead-end3, dead-end4, dining1, empty-room1, empty-room2, empty-room3, empty-room4, exit1, exit2, forked-road1, forked-road2, forked-road3, ghost-room1, ghost-room2, ghost-room3, hall1, hall2, ironworks1, junk-room1, kitchen1, kitchen2, laboratory1, large-aisle2, large-aisle3, large-room1, large-room2, large-room3, large-room4, large-room5, large-room6, large-room7, library1, living-room1, living-room2, living-room3, living-room4, living-room5, living-room6, living-room7, locker-room1, long-aisle1, long-aisle2, long-aisle3, long-aisle4, loophole1, memory-room1, mirror-room1, monster-room1, monster-room2, monster-room3, multi-doors1, multi-doors2, multi-doors3, mystery-room1, mystery-room2, mystery-room3, narrow-passage1, narrow-passage2, narrow-passage3, narrow-passage4, narrow-passage5, painting-room1, painting-room2, pillar-room1, rough-room1, rough-room2, rough-room3, shadow-hide1, shelf1, showroom1, skull-room1, small-room1, small-room2, small-room3, spooky-room1, spooky-room2, spooky-room3, spooky-room4, stairs1, stairs2, stairs3, stairs4, stairs5, stairs6, study1, study2, tool-room1, tool-room2, veranda1, washroom1, workshop1, workshop2, workshop3
and one word from expressions that is closest to the girl's emotion at the time, and one word from backgrounds that is closest to the place where the girl is likely to be,
! [image](https://churin-stock.com/media/setting3/{backgrounds}/{expressions}.png)
and put it into
! [image](https://churin-stock.com/media/setting3/aisle1/anxious.png)
and make a string such as Also, please output in markdown format and display as an image, not code.

## Output Format

![image](https://churin-stock.com/media/setting3/aisle1/anxious.png)

{girl's name}: {girl's lines}

現在の部屋: 部屋1

コマンド:移動(N, S, E, W)、調べる、ヒント

## Output Format Example

![image](https://churin-stock.com/media/setting3/aisle1/anxious.png)

カイ:ねえ…聞いてる…? 私はカイ、私の名前はカイだよ。お屋敷で記憶がなくなるなんて嘘だよね? 早く…早くこのお屋敷から抜け出そう?

現在の部屋: 部屋1

コマンド:移動(N, S, E, W)、調べる、ヒント

出力はすべて日本語で行って下さい。

なお、プロンプトが長すぎると物語が途切れやすくなるため、背景は一部削除しました。以下、全背景のプロンプトです。

backgrounds: abandoned-mine1, administrator-room1, administrator-room2, aisle1, aisle2, aisle3, aisle4, aisle6, atelier1, back-room1, back-room2, balcony1, bathroom1, bathroom2, bathroom3, bathroom4, bedroom1, bonfire1, bonfire2, bonfire3, bonfire4, bonfire5, bonfire6, bonfire7, buried-alive-room1, corner-room1, corner-room2, corner-room3, corner4, corner5, corridor-with-light1, corridor-with-light2, corridor-with-light3, corridor1, corridor2, corridor3, corridor4, corridor5, corridor6, dead-end-room1, dead-end-room2, dead-end-room3, dead-end1, dead-end2, dead-end3, dead-end4, dead-end5, dead-end6, dead-end7, dead-end8, dining1, doll-corridor1, doll-corridor2, doll-corridor3, doll-room1, doll-room2, doll-room3, doll-room4, empty-room1, empty-room2, empty-room3, empty-room4, exit1, exit2, forked-road1, forked-road2, forked-road3, forked-road4, forked-road5, ghost-room1, ghost-room2, ghost-room3, hall1, hall2, inspector-corridor1, inspector-corridor2, inspector-corridor3, inspector-corridor4, inspector-corridor5, inspector-corridor6, inspector-room1, inspector-room2, inspector-room3, inspector-room4, inspector-room5, ironworks1, junk-room1, kitchen1, kitchen2, kitchen3, laboratory1, large-aisle2, large-aisle3, large-room1, large-room2, large-room3, large-room4, large-room5, large-room6, large-room7, library1, living-room1, living-room2, living-room3, living-room4, living-room5, living-room6, living-room7, locker-room1, long-aisle1, long-aisle2, long-aisle3, long-aisle4, loophole1, memory-room1, mirror-room1, monster-room1, monster-room2, monster-room3, multi-doors1, multi-doors2, multi-doors3, mystery-room1, mystery-room2, mystery-room3, narrow-passage1, narrow-passage2, narrow-passage3, narrow-passage4, narrow-passage5, painting-room1, painting-room2, pillar-room1, rough-room1, rough-room2, rough-room3, shadow-hide1, shelf1, showroom1, skull-room1, small-room1, small-room2, small-room3, spooky-room1, spooky-room2, spooky-room3, spooky-room4, stairs1, stairs2, stairs3, stairs4, stairs5, stairs6, study1, study2, tool-room1, tool-room2, underground-passage1, veranda1, washroom1, washroom2, washroom3, washroom4, washroom5, workshop1, workshop2, workshop3, workshop4

GPT-3.5で使う時のポイント

  • 無料版・GPT-3.5で「調べる」などをすると会話が続きにくい時があります。「カイ、〇〇を調べてみて」のように名前も呼んであげると順調に進みやすいです(方角のコマンドNなどはそのままで大丈夫?)

  • 最初に長い設定文が出てきた時は短くなるまでリロード or 再送信すると会話が続きやすくなります

対応できるかはわかりませんが、改善点やご質問などございましたら、以下のTwitterにご連絡いただければ幸いです!


キャラボイスを追加する(オプション)

以下の拡張機能(ondoku3.comさん作成)も追加すると、ナレーションも読み上げてしまうものの、10秒くらい遅れてキャラボイスも再生されます。めちゃくちゃ感謝です!(私は「あおい」を高低+1.5くらいで使用。無料枠もあるので、気になったら試してみるといいかもです)

音声入力にも対応しているので、キャラと会話しながらノベルゲームを進めることが可能な時代に…! 本当にゲームの新たな概念が生まれつつあるのかもしれません。ゲームの経験がここで活きることもあるんですね。

以下、このプロンプトの仕組みと課題をざっくりと書きました。

プロンプトの仕組み

ノベルゲームの時に作成した「ちゅーりん式プロンプト」をさらに応用して「音」を追加するところがミソ。

ちゅーりん式プロンプトってなんだ?という方は、以下のnoteに仕組みをまとめているので、よかったらぜひご覧ください。(シュンスケさんみたいにそう呼んで拡散されてほしいだけなので…特に深い意味はありません笑 でも呼んでいただけると最高に嬉しいです!!

この時はマークダウン形式に対応していることを活用したのですが、これだと画像こそ表示できるものの、音は再生できません。

でも、マイキャラに音を追加させたい。どうしてもさせたい。

ということで! ここからはやや応用的な話になりますが、この課題の解決策をまとめていきます。

音の実装に使ったのが、Chromeの拡張機能。一見まったく関係のない話題に見えますが、これが今回最大の鍵でもあります。「ChatGPTの内容をトリガーに拡張機能を動作させることで音を再生できる」からです。これにより効果音はもちろん、BGMの無限ループの問題もクリア。

参考サイトは……めずらしく自分!とフリー音源さん。私の場合、音声入力はもちろん最近ではプロンプトをコピペするのさえ億劫に感じていました。その時に開発したのがこの拡張機能です。

BGM1:かずちさん『日没廃校』(DOVA-SYNDROME)
BGM2:Khaimさん『This Romance』(DOVA-SYNDROME)
効果音:ホラー・心理系~フリー効果音・無料効果音素材さん
ボイス:びたみんちぃ/びたちー素材館さん

いよいよ本格的にゲームみたいになってきました。今回ベースを作ってしまったため、背景・キャラ・音響を揃えれば、今回のようなものも個人×1日で作れる時代に。作る側もゲーム自体も、新しい時代が来つつあるかもしれないですね。

ちなみに、今回の着想はこちらのツイート。

実は自分もあまり意識していなかったので、うみゆきさんのご指摘は非常に参考になりました。本当にありがとうございます!

さて、この拡張機能は「ワンタッチであらかじめ登録したプロンプトを実行できる」(自分のプロンプトに置き換えるためにはコードのダウンロードが必要)というものですが、今回は「ChatGPT上に特定の文字が現れる」ことをトリガーに対応した効果音を再生する、というややトリッキーな仕組みに改造しました。

このメカニズムはフロントエンドの開発経験があると「あ~」となりやすい?のですが、そもそも私もこういった仕組みで動く拡張機能を見たことがないので、少し伝わりづらいかもしれません。

拡張機能のコードも貼っておきます。

このコードを実行することで、無事効果音が再生されるようになります! 見栄えをよくするため、効果音のトリガーワードは画像のURLを設定することで非表示を維持しながら動作を実現しました。

これにより、例えば人形のいる部屋に入ると人形ボイスを再生させることができます。が、GPT-3.5だと速すぎて読み取れなかったり、精度を上げすぎるとメモリに負担かけたりで、このあたりはまだ模索中。

あとはBGMの再生やChatGPTのデザイン変更はホラーゲーム起動ボタンを押す処理に加えればOKです。

暗号なども出してくるように。「そんなのあるか!」と思いつつ、相談しながら進めていきます

ということで脱出×ホラーゲーム完成!

ちゅーりん式プロンプトと拡張機能を組み合わせた手法は、初めての方が作るには少しハードルが高く、公開する場合更新も少し手間がかかりますが、最大のメリットは「コードを実行し複雑な処理を可能にすること」そして「プロンプトの字数制限にとらわれないこと」(実は、今回のプロンプトには音に関する記述が一文字もないにも関わらず、任意のタイミングで音を鳴らしています。エンディングBGMなど)なのかもしれません。

もしアイデアなどが浮かばない、という方は「この作品にはこれが足りない!私だったらこうするのに!」と考えてみると自分が気になっているところも見つかりやすいかも。あとはChatGPTを叩くだけです。

以上が今回の仕組みになりますが、前回の「動的な画像リンク」に今回のシステムを上乗せしているので、おそらく最初にこちらの記事を見るとこんがらがってしまうかもしれません。

ノベルゲームとの変更点はプロンプトと拡張機能のコードだけですので、音付きのノベルゲームを実装してみたい方はぜひ試してみて下さい。

おわりに

これでついに! ChatGPTで音も扱えるようになりました。

「じゃあ何しよう?」

となった時に思い出したのが、以前自宅で先輩方と一緒にやっていたホラーゲーム。もともと自宅に映画鑑賞用に150インチスクリーン&サラウンドスピーカーを設置していたのですが、一時期これを使ってスマブラやホラーゲームをしていたのです。おかげで隣の人にめちゃくちゃ怒られました。

後ろから突然ガラスの割れる音が聞こえてきたりするので、もうあまりに怖くて。でもその印象が強すぎて、「音=ホラーゲーム」が今になって戻ってきたのです。ホラーゲームを持ってきてくれた先輩に感謝ですね。(?)

音やAPIを組み込めば、さらに幅広い表現が可能になってきます。少し慣れない部分もあるかと思いますが、その分非常に柔軟に機能を追加できるようになるので、興味のある方はぜひ作ってみて下さい。ノベルゲームと同様、なんとなくこの分野日本面白いこと起きやすそうな気もするので!

ではでは!

開発中の様子。これだとほんわかしてしまうので、ChatGPTの背景を暗くすることを念頭に置きながら(白背景だと見づらいですが)、キャラと背景にそれぞれフィルターをかけてホラー風にしています

急に不気味になるクマちゃん

この記事が参加している募集

やってみた

AIとやってみた

この記事が気に入ったらサポートをしてみませんか?