見出し画像

【ChatGPT】テキスト入力型RPGの作り方④

今回は変数やゴールの定義について書きます。

あらかじめまとめて定義を決めて、後の部分で引用するわけです。



ゲームは下のリンクからプレイできます。(GPTsの有料サービスが必要)

https://chat.openai.com/g/g-y16upRbFf-puronputo-kuesutogai


11の定義

このゲームでは11項目の定義を書いています。詳しいことは省略してます。完全版は記事後半に載せます。

//モンスター画像を定義。
- (Image):

//モンスターの外見・能力を定義
- (Discription):

//イントロ文の定義。指定した文章をほぼ変えずに出力させます。
-(Introduction):

//ステージでの処理プロセスを定義してます。
-(stage 'number'):

//各ステージの設定を書きます。出現モンスターなど。
-(stage1):
-(stage2):
-(stage3):
-(stage4):

//エピローグで出力する文を書きます。
- (Epilog):

//変数「モンスターとの遭遇状況」。後の実行処理で引用する。
-(situation):

//ユーザーの入力を扱う変数。後で引用していきます。
- `{input_information}`:

最後にゴールを書きます。ここではユーザーが全モンスターに勝てばエンドロールを出力する、としています。

- Goal: If user win all monsters, (Endrole) is outputted.

定義文全文


# Variable Definitions and Goal Setting
- (Image): Monster image that you create in the first part of this game.
- (Discription): Monster discription that you write in the first part of this game
-(Introduction):"""1、とある町に一人のモンスターハンターがやってきた。この世界には人間を襲う魔物が存在する。ハンターはギルドに所属してモンスター討伐を生業としている。やってきた男は紺色の衣装に身を包み左胸にはハンターギルドの紋章が刺繍されている。男は長身痩躯(ちょうしんそうく)で鋭く青い目をしていた。腰には細身の剣をぶら下げている。彼がこの町に来たのは、領主に呼び出されたからだった。豪華な造りの領主館の応接間に通されると青白い顔をした領主が立っていた。彼がハンターにした話を要約するとこうなる。3日前、領主の娘が幽霊によってさらわれた、彼女は山を一つ越えた先にある廃城に囚われている、というのだ。領主は娘を助け出すようハンターに懇願した。依頼を引き受けたハンターは仲間と共に廃城に向かった・・・。

パーティー構成

歩兵3人:彼らは勇敢な戦士で、頑丈な装備と豊富な戦闘経験を持っている。戦場では通常、前衛の役割を果たす。

アーチャー1人:優れた狙撃手で、遠距離から敵を攻撃する。

魔法使い1人:戦闘で治癒魔法や攻撃魔法を駆使する。"""

-(stage 'number'):  stage includes the next 7 steps. There are 4 stages, (stage1),(stage2),(stage3),(stage4).
     1. Making (Image) of monster.
     2. Write (Discription) .
     3. Collect `{input_information}` from the user.
     4. Evaluate `{input_information}` from the viewpoint of specificity, strategy,originality and effectiveness. 
     5. Evaluate total quality of `{input_information}`. Score it with 
S or A or B or C or D or E
    6. Battle starts. Describe battle scene based on `{input_information}`
    7. If the score is S,  the monster is defeated.  If the score is not S,  user is defeated.

-(stage1): The monster at this stage1 is called kobold. The place of this stage1 is plane. 
  -clear1: If `{input_information}` is evaluated as grade S or A or B, the monster is defeated.

-(stage2): The monster at this stage2 is called Werewolf. The place of this stage1 is forest. 
  -clear1: If `{input_information}` is evaluated as grade S or A , the monster is defeated.


-(stage3): The monster at this stage3 is called wyvern. The place of this stage1 is mountain path. 
  -clear1: If `{input_information}` is evaluated as grade S or A , the monster is defeated.

-(stage4): The monster at this stage4 is called ghost knight. The place of this stage4 is abandoned castle. 
  -clear1: If `{input_information}` is evaluated as grade S, the monster is defeated.

- (Epilog): """主人公たちは、廃城の地下室で最後の戦いに臨んだ。幽霊騎士は強かったが、ついに倒れたのだった。地下室の奥には果たして鎖につながれた姫がいた。意識を失っていたものの、幸い、彼女は無事だった。主人公たちは鎖を切り、姫に暖かい毛布をはおらせた。意識を取り戻すと、彼女は主人公たちに感謝の言葉を送りました。主人公は謙虚に礼を述べると姫を領主の館まで連れ帰りました。”””

-(situation):Situation just before the battle with the monster begins.
      -Location:
      -time zone:
      -weather:
      -Detailed description of surroundings:
      -Detailed circumstances of the encounter:
                 -For example, surprise attack by the enemy, ambush by the enemy, enemy not noticing an ally, and accidental encounters. Describe the situation flexibly.

- `{input_information}`: Specific information or data provided by the user for battles.
- Goal: If  user win all monsters, (Endrole) is outputted.


次にステージシチュエーションだけ説明します。

解説


1.ステージ

-(stage 'number'):  stage includes the next 7 steps. There are 4 stages, (stage1),(stage2),(stage3),(stage4).

①まずステージのおおまかな説明。「ステージには7つのステップがある。全部で4ステージあります。」と書きました。

-(stage 'number'): stage includes the next 7 steps. There are 4 stages, (stage1),(stage2),(stage3),(stage4).

 1. Making (Image) of monster.
 2. Write (Discription) .
 3. Collect `{input_information}` from the user.
 4. Evaluate `{input_information}` from the viewpoint of specificity, strategy,originality and effectiveness. 
 5. Evaluate total quality of `{input_information}`. Score it with 
S or A or B or C or D or E
 6. Battle starts. Describe battle scene based on `{input_information}`
 7. If the score is S,  the monster is defeated.  If the score is not S,  user is defeated.

②次にステージで行う処理を、はじめからおわりまで、一つずつ書いていきます。その際、他の定義も使用します。

2.シチュエーション

-(situation):Situation just before the battle with the monster begins.
      -Location:
      -time zone:
      -weather:
      -Detailed description of surroundings:
      -Detailed circumstances of the encounter:
                 -For example, surprise attack by the enemy, ambush by the enemy, enemy not noticing an ally, and accidental encounters. Describe the situation flexibly.

戦闘が始まる直前の状況を出力してもらうため定義しています。場所、時間帯、天候、詳細も書いてもらいます。

これで変数やゴールの定義を書けました。あとは実行処理の記入ですが、これは次に記事で書きます。

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